public class EventsWatcher
extends java.lang.Object
Constructor and Description |
---|
EventsWatcher(EventGenerator eventGenerator)
Creates an events watcher.
|
Modifier and Type | Method and Description |
---|---|
void |
add(EventHandler eventHandler,
boolean watch)
Add an event handler.
|
boolean |
handleEvent(int event) |
void |
remove(EventHandler eventHandler,
boolean watch)
Removes an event handler.
|
public EventsWatcher(EventGenerator eventGenerator)
eventGenerator
- the eventGenerator to manage.public void add(EventHandler eventHandler, boolean watch) throws java.lang.SecurityException, java.lang.NullPointerException
eventHandler
- the event handler to add.watch
- true
if the given event handler watches the events, false
if it captures the
events.java.lang.NullPointerException
- if eventHandler is null
.java.lang.SecurityException
- if the EventsWatcher
can not be set as the EventHandler of the event generator.public void remove(EventHandler eventHandler, boolean watch)
eventHandler
- the event handler to remove.watch
- true
if the given event handler watches the events, false
if it captures the
events.public boolean handleEvent(int event)