java.lang.Object
java.util.Observable
com.flexstor.common.awt.Controller
- All Implemented Interfaces:
- ActionCheckerI, java.util.Observer
- public abstract class Controller
- extends java.util.Observable
- implements java.util.Observer, ActionCheckerI
This class handles state changes from the model and passes
them on to registered UI controllers, i.e. menus and toolbars.
by using an Observable/Observer pattern.
|
Method Summary |
abstract boolean |
canPerform(int nActionId)
This method has to return the value of the corresponding
state member variable, indicating if the action is allowed. |
void |
update(java.util.Observable model,
java.lang.Object notifyCommand)
Reacts to a NOTIFY_STATE_CHANGED and NOTIFY_BUSY from an observable. |
abstract void |
updateStates(java.lang.Object model)
This method has to query the model for the states of interest
and store them appropriately in member variables. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Controller
public Controller()
canPerform
public abstract boolean canPerform(int nActionId)
- This method has to return the value of the corresponding
state member variable, indicating if the action is allowed.
This requires mapping of each member variable to an action id.
- Specified by:
canPerform in interface ActionCheckerI
updateStates
public abstract void updateStates(java.lang.Object model)
- This method has to query the model for the states of interest
and store them appropriately in member variables.
update
public void update(java.util.Observable model,
java.lang.Object notifyCommand)
- Reacts to a NOTIFY_STATE_CHANGED and NOTIFY_BUSY from an observable.
- Specified by:
update in interface java.util.Observer