org.eodisp.ui.common.base
Class EodispController

java.lang.Object
  extended by org.eodisp.ui.common.base.EodispController
Direct Known Subclasses:
MmFederatesController, ReposController, SMTreeController

public abstract class EodispController
extends java.lang.Object

The EodispController is the base class for all controllers (except the application controller) for this application. All generic (i.e. not application specific) behaviour of a controller should go here.

Every specific controller in the EODiSP framework should sub-class this class.

Version:
$Id: EodispController.java 3776 2006-10-02 18:51:47Z eglimi $
Author:
eglimi

Constructor Summary
EodispController()
          Default constructor.
 
Method Summary
 void attachView(EodispView view)
          Adds a newly created view to the list of views for this application.
abstract  EodispView createDynamicView(int id)
          The controllers that implements this method and is responsible for creating the View with the given ID should create and return it.
protected abstract  void createStaticViews()
          Creates all static views which this controller handles.
 void detachView(EodispView view)
          Detaches one specific view from the application.
 java.util.Collection<? extends EodispView> getViews()
          Returns all views which are handled by this controller.
protected  void initialize()
          Initializes the controller.
abstract  boolean isControllerForView(int id)
          Returns whether this controller is responsible for creating the view with the given ID.
protected abstract  void registerActionHandler()
          Register this controller as a target handler for certain actions used within the EODiSP simulation manager application.
protected  void updateOwnedModels()
           
protected  void updateOwnedViewStates()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EodispController

public EodispController()
Default constructor.

Method Detail

registerActionHandler

protected abstract void registerActionHandler()
Register this controller as a target handler for certain actions used within the EODiSP simulation manager application.

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.


createStaticViews

protected abstract void createStaticViews()
Creates all static views which this controller handles. Static views are those that are created at application startup and destroyed at sthutdown.


isControllerForView

public abstract boolean isControllerForView(int id)
Returns whether this controller is responsible for creating the view with the given ID.

Parameters:
id - The static ID of the view in question.
Returns:
True, if the controller is responsible for this view, otherwise false.

createDynamicView

public abstract EodispView createDynamicView(int id)
The controllers that implements this method and is responsible for creating the View with the given ID should create and return it.

The view will be managed automatically after that.

Parameters:
id - The static Id of the view which should be created.
Returns:
The new view or null, if the view could not be created.

getViews

public java.util.Collection<? extends EodispView> getViews()
Returns all views which are handled by this controller.

Returns:
A collection with elements of type EodispView's. It returns an empty collection if no views are currently handled by this controller.

An empty collection does not indicate that this controller does not handle any views, since it might handle dynamically created views.


attachView

public void attachView(EodispView view)
Adds a newly created view to the list of views for this application.

Parameters:
frame - The frame that has been created for this application.

detachView

public void detachView(EodispView view)
Detaches one specific view from the application.

Parameters:
frame - The frame to remove from the list of attached frames.

initialize

protected void initialize()
Initializes the controller. This should created the model connected to this controller as well as all frames and views.


updateOwnedViewStates

protected void updateOwnedViewStates()

updateOwnedModels

protected void updateOwnedModels()