|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eodisp.ui.common.base.EodispApplicationController
public abstract class EodispApplicationController
The EodispApplicationController is the main controller for this application. It handles the creation of of other controllers for the application as well as the creation and management of frames.
This class should be sub-classed by a specific application controller for each application to provide an implementation of the abstract methods. The sub-class should also handle the actions that belong to the main application. That is, all actions that should always be available.
In the MVC (Model-View-Controller) pattern, the controller is responsible for
handling events. This is done by using the delegation mechanism which is
provided by EodispDelegate
class. See the
documentation of this calls for more information.
Field Summary | |
---|---|
(package private) static org.apache.log4j.Logger |
logger
Log4J logger for this class |
protected net.infonode.docking.RootWindow |
rootWindow
Holds the root windows in which all views are embedded. |
protected net.infonode.docking.util.ViewMap |
viewMap
Holds a list of all static views in the application. |
Constructor Summary | |
---|---|
protected |
EodispApplicationController()
Default constructor. |
Method Summary | |
---|---|
protected void |
attachController(EodispController c)
Attaches the given controller to the list of controllers for this application. |
protected boolean |
canExit()
Checks in all currently active frames if there is a model which has been changed and therefore needs to save before exiting. |
protected abstract void |
createControllers()
This constructs all frames included in the application. |
protected void |
createInitialLayout()
This method can be used by sub-classes to create an initial layout. |
protected abstract EodispMainFrame |
createMainFrame()
Creates the main frame of the application. |
protected net.infonode.docking.RootWindow |
createRootWindow()
Adds all frames created by controllers to the main frame. |
protected void |
detachAllControllers()
Removes all controllers from the list of controllers registered for this application. |
protected void |
detachController(EodispController c)
Removes a controller from the list of controllers registered for this application. |
java.lang.String[] |
getChangedViewNames()
Checks in all views if its model(s) have changes. |
EodispMainFrame |
getMainFrame()
Returns the main frame of this application. |
net.infonode.docking.RootWindow |
getRootWindow()
Returns the root window. |
void |
handleExit()
|
boolean |
hasAppChanges()
|
void |
initialize()
Initialization of the application controller. |
protected abstract void |
registerActionHandler()
Register this class as a target handler for certain actions used within the EODiSP simulation manager application. |
void |
saveAllChanges()
Saves all changes in all models. |
protected void |
saveLayout()
Save the layout, if this method is supported by the application. |
protected void |
showDynamicView(int viewId)
Adds the dynamic view identified by the given ID. |
protected void |
updateAllActions()
Update the state of all actions. |
protected void |
updateAllModels()
|
protected void |
updateAllViewStates()
Updates the state on each view by calling the EodispView.updateViewState() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static org.apache.log4j.Logger logger
protected net.infonode.docking.RootWindow rootWindow
protected net.infonode.docking.util.ViewMap viewMap
Constructor Detail |
---|
protected EodispApplicationController()
Method Detail |
---|
protected abstract void registerActionHandler()
For the registration, the EODiSP delegation mechanism is used (see
EodispDelegate
. Such an instance can be registered in the action
itself, causing the method to be called whenever the action is performed.
protected abstract EodispMainFrame createMainFrame()
protected abstract void createControllers()
protected void createInitialLayout()
You do not need to call super()
.
protected void saveLayout()
The default implementation saves the layout of the root window in a file
specified by the UiConfiguration
of this application. It only
saves the layout, it does not save the views (and their states) itself.
Also, it does not save the state of the tool bar.
public EodispMainFrame getMainFrame() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- Thrown if this method is called before the application
controller has been initialized.public net.infonode.docking.RootWindow getRootWindow()
public void initialize()
public void handleExit()
public void saveAllChanges() throws java.io.IOException
java.io.IOException
- Rethrown if one of the models throws an exception during
save.public boolean hasAppChanges()
protected void updateAllModels()
protected void updateAllActions()
protected void updateAllViewStates()
EodispView.updateViewState()
method.
protected boolean canExit()
The method checks if the view and a model exists.
public java.lang.String[] getChangedViewNames()
protected net.infonode.docking.RootWindow createRootWindow()
protected void showDynamicView(int viewId)
viewId
- The Id of the view to be added.protected void attachController(EodispController c)
c
- protected void detachController(EodispController c)
c
- The controller to be removed from the list of registered
controllers.protected void detachAllControllers()
This should be called before exit the application. It ensures a proper sequence of the exit process.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |