SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
EventDispatcher implements the observer pattern.
Constructor Summary | |
EventDispatcher()
Base class for classes that dispatch event. |
Method Summary | |
void
|
addEventListener(type, listener)
Adds an event listener for the specified type. |
void
|
dispatchEvent()
Dispatches an event. |
Boolean
|
hasEventListener(type)
Returns true if the event type has at least one listener associated with it. |
void
|
removeEventListener(type, listener)
Removes the specified event listener. |
Constructor Detail |
EventDispatcher()
Method Detail |
void addEventListener(type, listener)
String type
- the event type
Function listener
- the listener
void
void dispatchEvent()
void
Boolean hasEventListener(type)
String type
- the event type
Boolean
void removeEventListener(type, listener)
String type
- the event type
Function listener
- the listener
void