|
All Methods zio package context |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object zio.Zio
The Zio
class is a method defining class that
contains a potpourri of methods. Some
of these aid the other classes in the zio package.
Others provide a one stop shopping place for beginners looking
for a few simple actions to use in conjunction with the
zio package.
Constructor Summary | |
Zio()
|
Method Summary | |
static void |
abort(java.lang.String message)
Writes a message in the command window, starts a new line, and aborts the program. |
static boolean |
ask(java.lang.String question)
Pops a window up that asks a yes/no question. |
static char[] |
extractChars(java.lang.String str)
Splits a String into a character array. |
static java.lang.String[] |
extractLines(java.lang.String str)
Splits a String into an array of lines. |
static java.lang.String[] |
extractTokens(java.lang.String str)
Splits a String into an array of tokens. |
static java.awt.Color |
getGlobalBackground()
Get the global background color. |
static java.awt.Color |
getGlobalForeground()
Get the global foreground color. |
static java.awt.Dimension |
getLargestZObject()
Finds the size of the largest ZObject that will
fit on this screen with this motif. |
static java.awt.Color |
getOriginalGlobalBackground()
Get the default background color. |
static java.awt.Color |
getOriginalGlobalForeground()
Get the default foreground color. |
static java.awt.Dimension |
getScreenSize()
Finds the size in pixels of the current moniter. |
static void |
registerShutdown(ZioShutdown g)
Registers a subclass of ZioShutdown to change the actions taken under normal and abnormal shutdowns. |
static void |
setGlobalBackground(java.awt.Color bg)
Set the global background color. |
static void |
setGlobalForeground(java.awt.Color fg)
Sets the global foreground color. |
static void |
show(java.lang.String str)
Writes a string in the command window and starts a new line. |
static void |
stop()
Stops the program. |
static void |
tell(java.lang.String message)
Pops a window up that tells the user something. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Zio()
Method Detail |
public static final java.awt.Dimension getLargestZObject()
ZObject
that will
fit on this screen with this motif.
ZObject
public static final java.awt.Dimension getScreenSize()
Dimension
giving the screen sizepublic static final java.awt.Color getOriginalGlobalForeground()
setGlobalForeground()
or some
relevant suffix. Foreground is the color
used when printing and drawing on the
screen.
public static final java.awt.Color getOriginalGlobalBackground()
setGlobalBackground()
or some
relevant suffix.
public static final java.awt.Color getGlobalForeground()
public static final java.awt.Color getGlobalBackground()
public static final void setGlobalForeground(java.awt.Color fg)
fg
- a new global foreground colorpublic static final void setGlobalBackground(java.awt.Color bg)
bg
- a new global background colorpublic static void registerShutdown(ZioShutdown g)
g
- a subclass of ZioShutdownpublic static final void show(java.lang.String str)
String
replacement for
System.out.println
that is
included for the convenience of beginners using
the InOut.readText()
method.
str
- the string to be writtenpublic static final void abort(java.lang.String message)
message
- the string to be writtenpublic static final void stop()
public static final char[] extractChars(java.lang.String str)
String
into a character array.
This method included for the convenience of beginners
using the InOut.readText()
method. All characters
including end of line symbols will be placed into the
returned character array. new String( Zio.extractChars(str))
will return a String
with the same char
s in the
same order as str
.
str
- a string
public static final java.lang.String[] extractLines(java.lang.String str)
String
into an array of lines.
Lines are returned in an array of String
s
without their end of line symbols.
Note an empty file or a file containing one empty
line will produce an array with one empty string in it.
str
- a string
public static boolean ask(java.lang.String question)
question
- the question to ask the user
public static void tell(java.lang.String message)
message
- a warning messagepublic static final java.lang.String[] extractTokens(java.lang.String str)
String
into an array of tokens.
Think of a token as a word. (Actually a token can contain
punctuation characters as well as letters) This method
is included for the convenience of beginners using
InOut.readText()
. A more careful definition of a
token is that it is a string consisting of characters that
are not seen as whitespace. (That means ' ', '\n', and
'\t' are excluded.) This method finds all the longest
possible tokens in its argument and returns them
in order as an array of String
s.
str
- a string
|
author context |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |