Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.awt
Class Controller  view Controller download Controller.java

java.lang.Object
  extended byjava.util.Observable
      extended bycom.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.


Field Summary
 
Fields inherited from class java.util.Observable
 
Constructor Summary
Controller()
           
 
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.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller()
Method Detail

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