|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.cke.MainWindow
This class implements the application manager. It is the one class that organizes the rest of the classes in the application. It holds the localized resource bundle and available actions for the program.
This class is a Singleton which means only one instance of this class exists. You use the instanceOf() method to access that instance.
Field Summary | |
protected java.util.Hashtable |
actions
Table of available actions in our program. |
protected static java.lang.String |
actionSuffix
Suffix added to command string to retrieve action classes. |
protected static MainWindow |
instance
Reference to the single instance of this class. |
protected java.util.ResourceBundle |
resources
String and object resources for our program. |
protected java.util.Vector |
windows
The list of main windows in this application. |
Constructor Summary | |
protected |
MainWindow()
No-arg constructor for Visualizer class. |
Method Summary | |
void |
addAction(javax.swing.Action cmd)
Stores the action in the command table. |
javax.swing.Action |
getAction(java.lang.String cmd)
Retrieves the action corresponding to the given command string. |
java.net.URL |
getResource(java.lang.String key)
Retrieves an object from the localized resource bundle. |
java.lang.String |
getResourceString(java.lang.String name)
Retrieves a string from the localized resource bundle. |
static MainWindow |
instanceOf()
Returns the reference to the single instance of this class. |
Visualizer |
newWindow()
Creates, shows, and returns a new main window. |
void |
removeWindow(Visualizer win)
Closes and removes a main window. |
static java.lang.String[] |
tokenize(java.lang.String input)
Take the given string and chop it up into a series of strings on whitespace boundries. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static MainWindow instance
protected java.util.Vector windows
protected java.util.ResourceBundle resources
protected java.util.Hashtable actions
getAction()
method.
protected static java.lang.String actionSuffix
Constructor Detail |
protected MainWindow()
Method Detail |
public java.lang.String getResourceString(java.lang.String name)
name
- key name of the string resource to find
getResource(java.lang.String)
public java.net.URL getResource(java.lang.String key)
key
- key name of the resource to find
getResourceString(java.lang.String)
public static MainWindow instanceOf()
public Visualizer newWindow()
removeWindow()
.
public void removeWindow(Visualizer win)
win
- main window to close and removepublic static java.lang.String[] tokenize(java.lang.String input)
input
- string to be split apart
public void addAction(javax.swing.Action cmd)
getAction()
.
cmd
- action to store in command tablegetAction(java.lang.String)
public javax.swing.Action getAction(java.lang.String cmd)
cmd
- command string to find action for
addAction(javax.swing.Action)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |