|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.event.EventManager
public class EventManager
Manages events and forwards them to appropriate listeners
Copyright Enough Software 2007 - 2010
history
Sep 15, 2007 - rob creation
| Field Summary | |
|---|---|
static String |
EVENT_DEFOCUS
name of the unfocussed state event |
static String |
EVENT_FOCUS
name of the focussed state event |
static String |
EVENT_HIDE
name of the hide notify event |
static String |
EVENT_KEY_HANDLED
event when a key press or release event was handled |
static String |
EVENT_MENU_CLOSE
event when a commands menu is clpsed |
static String |
EVENT_MENU_OPEN
event when a commands menu is opened |
static String |
EVENT_POINTER_HANDLED
event when a pointer press or release event was handled |
static String |
EVENT_PRESS
name of the pressed state event |
static String |
EVENT_SHOW
name of the show notify event |
static String |
EVENT_SHOW_FIRST_TIME
name of the show notify event when a UI element is shown for the first time |
static String |
EVENT_UNPRESS
name of the pressed state event |
static String |
EVENT_UNVISIT
event when the visited stated of an item is rolled back |
static String |
EVENT_VALUE_CHANGE
name of the event when a value of an item is changed |
static String |
EVENT_VISIT
event when an item has been visited |
| Method Summary | |
|---|---|
void |
addEventListener(String eventName,
EventListener listener)
Adds a event listener. |
static EventManager |
createNewInstance()
Allows users to create a new EventManager instance. |
static void |
fireEvent(String name,
Object source,
Object data)
Forwards the specified event to any listeners. |
static EventManager |
getInstance()
Retrieves the instance of the event manager (singleton pattern). |
void |
remapEvent(String eventName,
Object alternativeSource)
Remaps the named event to the specified alternative source. |
void |
removeAllRemappings()
Removes all remappings |
void |
removeRemapEvent(String eventName)
Removes all remappings for the specified event |
void |
removeRemapEvent(String eventName,
Object alternativeSource)
Removes a single remapping for the specified event |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String EVENT_PRESS
public static final String EVENT_UNPRESS
public static final String EVENT_FOCUS
public static final String EVENT_DEFOCUS
public static final String EVENT_SHOW
public static final String EVENT_SHOW_FIRST_TIME
public static final String EVENT_HIDE
public static final String EVENT_VALUE_CHANGE
public static final String EVENT_MENU_CLOSE
public static final String EVENT_MENU_OPEN
public static final String EVENT_VISIT
public static final String EVENT_UNVISIT
public static final String EVENT_POINTER_HANDLED
public static final String EVENT_KEY_HANDLED
| Method Detail |
|---|
public static EventManager getInstance()
public static EventManager createNewInstance()
public static void fireEvent(String name,
Object source,
Object data)
name - the name of the event, e.g. EVENT_PRESSsource - the source of the event, for example an itemdata - additional optional data, depends on the event - might be null!
public void addEventListener(String eventName,
EventListener listener)
eventName - the name of events that the listener is interested in, or null when all events should be passed to the listenerlistener - the listener
NullPointerException - when the listener is null
public void remapEvent(String eventName,
Object alternativeSource)
eventName - the name of the event, usually this is a custom event namealternativeSource - the source that should also seem to fire this eventremoveAllRemappings(),
removeRemapEvent(String)public void removeRemapEvent(String eventName)
eventName - the name of the event that was remappedremapEvent(String, Object)
public void removeRemapEvent(String eventName,
Object alternativeSource)
eventName - the name of the event that was remappedalternativeSource - the source that should also seem to fire this eventremapEvent(String, Object)public void removeAllRemappings()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||