|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucsb.nceas.morpho.util.StateChangeMonitor
Maintain a registry of objects that are interested in changes in application state. When the application state changes (through posting a notification to this class), distribute the StateChangeEvent to all of the registered listeners. This class follows the singleton pattern because we never need or want more than a single instance to manage all of the change events.
Method Summary | |
void |
addStateChangeListener(java.lang.String stateChange,
StateChangeListener listener)
This method is called by objects to register a listener for changes in the application state. |
static StateChangeMonitor |
getInstance()
Get the single instance of the StateChangeMonitor, creating it if needed. |
void |
notifyStateChange(StateChangeEvent event)
Notify the monitor of an application state change so that it in turn can notify all of the registered listeners of that state change. |
void |
removeStateChangeListener(java.lang.String stateChange,
StateChangeListener listener)
This method is called by objects to remove a listener for changes in the application state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static StateChangeMonitor getInstance()
public void addStateChangeListener(java.lang.String stateChange, StateChangeListener listener)
stateChange
- the name of the state change for which notifications
should be sentlistener
- a reference to the object to be notified of changespublic void removeStateChangeListener(java.lang.String stateChange, StateChangeListener listener)
stateChange
- the name of the state change for which the listener
should be removedlistener
- a reference to the object to be removedpublic void notifyStateChange(StateChangeEvent event)
event
- the StateChangeEvent that has occurred
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |