public abstract class MrEventsListener
extends java.lang.Object
Constructor and Description |
---|
MrEventsListener()
Creates a new Event Listener
|
Modifier and Type | Method and Description |
---|---|
MrObject |
getAttachedObject()
Gets the object which this event listener is attached to
|
MrObjectController |
getObjectController()
Gets the object controller which this event listener is attached to
|
java.util.Set<java.lang.String> |
getRegisteredEvents()
Gets all registered events
|
boolean |
isEventRegistered(java.lang.String evName)
Checks if the given event is registered to be processed
|
protected void |
processEvent(java.lang.String eventName,
MrBundle eventBundle)
Process a certain event
|
void |
queueEvent(java.lang.String eventName,
MrBundle eventBundle)
Queues a new event to be processed on the OpenGL Thread
This method should be always called from a
MrEventDispatcher instance |
void |
registerEvent(java.lang.String eventName)
Registers a certain event
|
protected void |
registerEvents(java.util.Set<java.lang.String> events)
Register multiple events at once
|
void |
setObjectController(MrObjectController controller)
Sets the object controller
|
java.lang.String |
toString() |
void |
unregisterEvent(java.lang.String eventName)
Unregisters a certain event
|
void |
updateEvents()
Request to process all queued events
This method should not be called by user
|
public MrObjectController getObjectController()
public void setObjectController(MrObjectController controller)
controller
- public MrObject getAttachedObject()
public boolean isEventRegistered(java.lang.String evName)
evName
- public java.util.Set<java.lang.String> getRegisteredEvents()
protected void registerEvents(java.util.Set<java.lang.String> events)
events
- public void registerEvent(java.lang.String eventName)
eventName
- public void unregisterEvent(java.lang.String eventName)
eventName
- public final void queueEvent(java.lang.String eventName, MrBundle eventBundle)
MrEventDispatcher
instanceeventName
- eventBundle
- protected void processEvent(java.lang.String eventName, MrBundle eventBundle)
eventName
- event name receivedeventBundle
- bundle containing event datapublic final void updateEvents()
public java.lang.String toString()
toString
in class java.lang.Object