|
OGS Java API Spec | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ogs.support.Object
An object with a notifier, handler, and listeners of events. This class follows the Observer design pattern. It encapsulates both roles of Subject and Observer in one class by reusing the existing Java event handling classes. Subclasses should extend this class if event handling may potentially be needed.
Field Summary | |
protected EventListenerList |
listeners
List of event listeners. |
Constructor Summary | |
Object()
|
Method Summary | |
void |
addListener(EventListener listener)
Add an event listener. |
protected void |
handleEvent(EventObject event)
Handle an event. |
protected void |
notifyListeners(EventObject event)
Notify all listeners of an event. |
void |
removeListener(EventListener listener)
Remove an event listener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EventListenerList listeners
Constructor Detail |
public Object()
Method Detail |
public void addListener(EventListener listener)
listener
- An event listener.public void removeListener(EventListener listener)
listener
- An event listener.protected void notifyListeners(EventObject event)
event
- Event that occurred.protected void handleEvent(EventObject event)
event
- Event that occured.
|
OGS Java API Spec | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |