provides an applet for hosting the view when run as an applet
-
ComponentController()
- Default constructor.
-
addAndDo(Command)
- Invoke the command processor to perform the command and update the
UI of the undo/redo commands.
-
addModelSelectionChangeListener(ModelSelectionChangeListener)
- Add listener to the list of listeners for model selection change.
-
fileIn(String)
- Read model in from file.
-
fileOut(String)
- Write model out to file.
-
fireModelSelectionChange()
- Notify listeners of model selection change.
-
getApplicationName()
- Return the name of the application.
-
getCommandProcessor()
- Return the command processor.
-
getComponentFrame()
- Return the component frame.
-
getGUIHandler()
- Return the GUIHandler.
-
getModel()
- Return the model.
-
getModelSelection()
- Return the model selection.
-
getResourceBundle()
- Return the resource bundle.
-
getView()
- Return the view.
-
isApplet()
- Is the program running as an applet?
-
isAppletFrame()
- Is the program running as an applet in a frame?
-
isApplication()
- Is the program running as an application?
-
lookupComponentController(Component)
- Look up for the component controller bound to the view.
-
lostOwnership(Clipboard, Transferable)
- Invoked when the ComponentController is no longer the owner of the
contents of the clipboard.
-
openDocument(String)
- Open the named document.
-
removeModelSelectionChangeListener(ModelSelectionChangeListener)
- Remove listener from the list of listeners for model selection change.
-
setAppletFrame(boolean)
- Indicate to the framework whether the applet should be displayed in
a frame.
-
setApplicationMain(boolean)
- Tell the framework whether the program is running as an application
or not.
-
setCommandProcessor(ICommandProcessor)
- Set the command processor.
-
setGUIHandler(GUIHandler)
- Set the GUIHandler.
-
setModel(IModel)
- Set the model.
-
setModelSelection(ModelSelection)
- Set the model selection to a different selection and notify
listeners.
-
setResourceBundle(ResourceBundle)
- Set the resource bundle.
-
setView(IView)
- Change the application view by removing the existing view in the
application frame and adding a new one.
-
setView(IView, boolean)
- Change the application view by removing the existing view in the
application frame and adding a new one.
-
showExpirationDialog(Calendar, String, String, boolean)
- Display a dialog if the current date is after the expiration date, or
if the expirationDate parameter is null.
-
showSplashScreen(Class, String, int)
- Display a splash screen.
-
start()
- Invoked when the applet is started.
-
stop()
- Invoked when the applet is stopped.
ComponentController
public ComponentController()
- Default constructor.
showExpirationDialog
public static void showExpirationDialog(Calendar expirationDate,
String title,
String message,
boolean exit)
- Display a dialog if the current date is after the expiration date, or
if the expirationDate parameter is null.
- Parameters:
- expirationDate - the expiration date
- title - dialog title
- message - dialog message
- exit - program exits if true
showSplashScreen
public static void showSplashScreen(Class imageClass,
String imageFile,
int duration)
- Display a splash screen.
- Parameters:
- imageClass - the class to find the image resource file
- imageFile - the name of the image file
- duration - duration of time to show the image (in seconds)
lookupComponentController
public static ComponentController lookupComponentController(Component c)
- Look up for the component controller bound to the view.
getModel
public IModel getModel()
- Return the model.
setModel
public void setModel(IModel model)
- Set the model.
getView
public IView getView()
- Return the view.
setView
public void setView(IView view)
- Change the application view by removing the existing view in the
application frame and adding a new one.
When invoked during program initialization, this method will create
the application frame, add the view to the frame, and show the
frame. This method should be called after any model, GUI handler,
resource bundle, or model selection has been created.
- Parameters:
- view - the view to set to
setView
public void setView(IView view,
boolean showFrame)
- Change the application view by removing the existing view in the
application frame and adding a new one.
When invoked during program initialization, this method will create
the application frame, add the view to the frame, and show the frame
if showFrame is true. This method should be called after any model,
GUI handler, resource bundle, or model selection has been created.
- Parameters:
- view - the view to set to
- showFrame - true if tha application frame should be shown
getGUIHandler
public GUIHandler getGUIHandler()
- Return the GUIHandler.
setGUIHandler
public void setGUIHandler(GUIHandler guiHandler)
- Set the GUIHandler.
getCommandProcessor
public ICommandProcessor getCommandProcessor()
- Return the command processor.
setCommandProcessor
public void setCommandProcessor(ICommandProcessor commandProcessor)
- Set the command processor.
- Parameters:
- commandProcessor - command processor to set to
addAndDo
public void addAndDo(Command command)
- Invoke the command processor to perform the command and update the
UI of the undo/redo commands.
getModelSelection
public ModelSelection getModelSelection()
- Return the model selection.
setModelSelection
public void setModelSelection(ModelSelection selection)
- Set the model selection to a different selection and notify
listeners.
- Parameters:
- selection - model selection to set to
addModelSelectionChangeListener
public synchronized void addModelSelectionChangeListener(ModelSelectionChangeListener listener)
- Add listener to the list of listeners for model selection change.
- Parameters:
- listener - listener interested in model selection changes
removeModelSelectionChangeListener
public synchronized void removeModelSelectionChangeListener(ModelSelectionChangeListener listener)
- Remove listener from the list of listeners for model selection change.
- Parameters:
- listener - listener interested in model selection changes
fireModelSelectionChange
public void fireModelSelectionChange()
- Notify listeners of model selection change. Call the
handleModelSelectionChange method for each registered listener.
lostOwnership
public void lostOwnership(Clipboard clipboard,
Transferable contents)
- Invoked when the ComponentController is no longer the owner of the
contents of the clipboard.
getResourceBundle
public ResourceBundle getResourceBundle()
- Return the resource bundle.
setResourceBundle
public void setResourceBundle(ResourceBundle resources)
- Set the resource bundle. This allows the framework to query
resource strings like Application, Version, and Copyright.
getApplicationName
public String getApplicationName()
- Return the name of the application. Default implementation reads
the application name from the resource file. If you do not have a
resource file, override this method to return an application name.
getComponentFrame
public ComponentFrame getComponentFrame()
- Return the component frame.
start
public void start()
- Invoked when the applet is started. Default implementation shows
the applet frame if the applet has one.
- Overrides:
- start in class Applet
stop
public void stop()
- Invoked when the applet is stopped. Default implementation hides
the applet frame if the applet has one.
- Overrides:
- stop in class Applet
setApplicationMain
public static void setApplicationMain(boolean flag)
- Tell the framework whether the program is running as an application
or not. setApplicationMain(true) must be called in the program's
main() before the component controller is created.
setAppletFrame
public void setAppletFrame(boolean flag)
- Indicate to the framework whether the applet should be displayed in
a frame.
isApplication
public boolean isApplication()
- Is the program running as an application?
isAppletFrame
public boolean isAppletFrame()
- Is the program running as an applet in a frame?
isApplet
public boolean isApplet()
- Is the program running as an applet?
openDocument
public void openDocument(String documentName)
- Open the named document. The document contains model data that has
previously been saved.
- Parameters:
- documentName - name of document to open
fileOut
protected void fileOut(String filename) throws IOException
- Write model out to file.
- Parameters:
- filename - name of the file to write model out to
- Throws: IOException
- I/O exceptions that may occur
fileIn
protected void fileIn(String filename) throws ClassNotFoundException, IOException
- Read model in from file.
- Parameters:
- filename - name of the file to read model in from
- Throws: ClassNotFoundException
- Class of a serialized object cannot be found
- Throws: IOException
- I/O exceptions that may occur
All Packages Class Hierarchy This Package Previous Next Index