flightclub.framework3d
Class EventManager
java.lang.Object
|
+--flightclub.framework3d.EventManager
- public class EventManager
- extends java.lang.Object
This class implements an event manager. Events (eg. from AWT
components) are held in a queue. They only get dispatched when the
Clock ticks. This will make the framework more thread safe. I hope.
***TODO***Filter out extra keyRelease/keyPress events generated
when holding down a key for a few seconds. This AutoKeyRepeat bug
happens on Linux (and Windows ?).
|
Field Summary |
protected static int |
MAX_Q
|
protected java.util.Vector |
objs
|
|
Method Summary |
void |
addNotification(java.lang.Object o)
Adds an object to the list of objects to be notified when an
event happens |
boolean |
handleEvent(java.awt.event.KeyEvent e)
Adds an event to the queue for handling later |
void |
removeNotification(java.lang.Object o)
|
void |
tick()
Dispatch the event at the head of the queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
objs
protected java.util.Vector objs
MAX_Q
protected static final int MAX_Q
- See Also:
- Constant Field Values
EventManager
public EventManager()
addNotification
public void addNotification(java.lang.Object o)
- Adds an object to the list of objects to be notified when an
event happens
removeNotification
public void removeNotification(java.lang.Object o)
handleEvent
public boolean handleEvent(java.awt.event.KeyEvent e)
- Adds an event to the queue for handling later
tick
public void tick()
- Dispatch the event at the head of the queue.