public abstract class EventHandler extends Object
Modifier and Type | Field and Description |
---|---|
protected ArrayList |
globalListeners |
Constructor and Description |
---|
EventHandler() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
acceptsEvent(Event evt)
Tests a given event to determine if this handler can handle that event.
|
abstract boolean |
acceptsListener(EventListener listener) |
void |
addListener(EventListener listener) |
EventListener[] |
getListeners(Object eventTarget) |
abstract void |
handleEvent(Event evt,
EventListener listener,
int eventType) |
void |
handleEvent(Event evt,
Object[] targets)
This method handles all of the events.
|
void |
removeListener(EventListener listener) |
protected ArrayList globalListeners
public abstract boolean acceptsEvent(Event evt)
evt
- the event to test.true
if this handler handles the event, false
otherwise.public abstract boolean acceptsListener(EventListener listener)
public abstract void handleEvent(Event evt, EventListener listener, int eventType)
public void addListener(EventListener listener)
public void removeListener(EventListener listener)
public void handleEvent(Event evt, Object[] targets)
handleEvent(Event, EventListener, int)
for every registered
listener in the globalListeners
list. Then, it passes the event
to each of the target listeners passed in via targets
.evt
- the event to process.targets
- the local listeners to pass the event to.public EventListener[] getListeners(Object eventTarget)