public abstract class BasicEventDispatcher extends Object implements EventDispatcher
dispatchCapturingEvent
and dispatchBubblingEvent
. These
are used in the BasicEventDispatcher.dispatchEvent
implementation,
but because they are public they can be called directly as well. Their
default implementation does nothing and is expected to be overridden in
subclasses. The BasicEventDispatcher
also adds possibility to chain
event dispatchers. This is used together with the direct access to the phase
specific dispatch methods to implement CompositeEventDispatcher
.
An event dispatcher derived from BasicEventDispatcher
can act as
a standalone event dispatcher or can be used to form a dispatch chain in
CompositeEventDispatcher
.
Constructor and Description |
---|
BasicEventDispatcher() |
Modifier and Type | Method and Description |
---|---|
Event |
dispatchBubblingEvent(Event event) |
Event |
dispatchCapturingEvent(Event event) |
Event |
dispatchEvent(Event event,
EventDispatchChain tail)
Dispatches the specified event by this
EventDispatcher . |
BasicEventDispatcher |
getNextDispatcher() |
BasicEventDispatcher |
getPreviousDispatcher() |
void |
insertNextDispatcher(BasicEventDispatcher newDispatcher) |
public Event dispatchEvent(Event event, EventDispatchChain tail)
EventDispatcher
EventDispatcher
. Does
any required event processing. Both the event and its further path can
be modified in this method. If the event is not handled / consumed during
the capturing phase, it should be dispatched to the rest of the chain
(event = tail.dispatch(event);
).dispatchEvent
in interface EventDispatcher
event
- the event do dispatchtail
- the rest of the chain to dispatch event tonull
if the event has been handled /
consumedpublic final BasicEventDispatcher getPreviousDispatcher()
public final BasicEventDispatcher getNextDispatcher()
public final void insertNextDispatcher(BasicEventDispatcher newDispatcher)
Copyright © 2020. All rights reserved.