|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.eventsystem.SimpleEventSystem
| Constructor Summary | |
SimpleEventSystem()
|
|
| Method Summary | |
java.lang.Object |
addEventListener(java.lang.Object eventType,
EventListener listener)
Add an EventListener to be notified whenever user defined events of eventType are posted to the EventSystem with notifyEvent(java.lang.Object, java.lang.Object). |
java.lang.Object |
addTimer(long timeoutMillis,
EventListener listener,
java.lang.Object data)
Add an event to the system to be sent after the specified delay |
void |
notifyEvent(java.lang.Object eventType,
java.lang.Object data)
Notify all listeners registered through addEventListener(Object, EventListener)
for eventType that the event has occured |
void |
notifyTransientEvent(EventListener listener,
java.lang.Object data)
Notify a single event listener with the given data. |
void |
removeEventListener(java.lang.Object token)
Remove an EventListener that was registered with addEventListener. |
void |
removeTimer(java.lang.Object token)
Remove an event from the EventSystem so that the callback to the EventListener for the event won't be called. |
void |
run()
Starts the EventSystem running in the current thread. |
void |
stop()
Stops the EventSystem. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleEventSystem()
| Method Detail |
public void run()
EventSystem
run in interface EventSystempublic void stop()
EventSystem
stop in interface EventSystem
public java.lang.Object addTimer(long timeoutMillis,
EventListener listener,
java.lang.Object data)
EventSystem
addTimer in interface EventSystemtimeoutMillis - amount of time to wait before invoking the callback on the EventListenerlistener - the EventListener to be called backdata - data to pass to the callback of the listener
EventSystem.removeTimer(Object)public void removeTimer(java.lang.Object token)
EventSystem
removeTimer in interface EventSystemtoken - a token returned from EventSystem.addTimer(long, EventListener, Object)
public java.lang.Object addEventListener(java.lang.Object eventType,
EventListener listener)
EventSystemeventType are posted to the EventSystem with EventSystem.notifyEvent(java.lang.Object, java.lang.Object).
Note that eventTypes are distinguished from one another by their hashCode() methods.
addEventListener in interface EventSystemeventType - the type of event to register to listen forlistener - an EventListener to be called back whenever events of
eventType are posted to the EventSystem
EventSystem.removeEventListener(Object)public void removeEventListener(java.lang.Object token)
EventSystem
removeEventListener in interface EventSystemtoken - a token returned from EventSystem.addEventListener(Object, EventListener)
public void notifyEvent(java.lang.Object eventType,
java.lang.Object data)
EventSystemEventSystem.addEventListener(Object, EventListener)
for eventType that the event has occured
notifyEvent in interface EventSystemeventType - the user defined event that has occureddata - the data to give to the listener's callback
public void notifyTransientEvent(EventListener listener,
java.lang.Object data)
EventSystem
notifyTransientEvent in interface EventSystem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||