|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.root.RootObject
com.neeve.event.EventObject
com.neeve.event.EventDispatcher
public abstract class EventDispatcher
Base class for all event dispatchers.
This class serves as the base class for all dispatchers. It implements dispatch by event type. When an event is received for dispatch, the class first delegates the dispatch to the derived class. If the derived class does not dispatch the event, then the event is dispatched to the handler registered for the event type. If no handler is registsred, then the event is dropped.
Method Summary | |
---|---|
void |
addEventHandler(Class<? extends Event> type,
IEventHandler handler)
Add an event type handler. |
void |
onEvent(Event event)
Implementation of IEventHandler.onEvent(com.neeve.event.Event) |
void |
removeEventHandler(Class<? extends Event> type,
IEventHandler handler)
Remove an event type handler. |
Methods inherited from class com.neeve.root.RootObject |
---|
getChecked, getThreaded, getTracer, setChecked, setTracer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public final void addEventHandler(Class<? extends Event> type, IEventHandler handler)
addEventHandler
in interface IEventDispatcher
type
- The event type for which the handler is being installed.handler
- The handler being added.public final void removeEventHandler(Class<? extends Event> type, IEventHandler handler)
removeEventHandler
in interface IEventDispatcher
type
- The event type for which the handler is being removed.handler
- The handler being removed.public void onEvent(Event event)
IEventHandler.onEvent(com.neeve.event.Event)
onEvent
in interface IEventHandler
event
- The event to be handled.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |