Class BasicEventDispatcher

java.lang.Object
com.sun.javafx.event.BasicEventDispatcher
All Implemented Interfaces:
EventDispatcher
Direct Known Subclasses:
CompositeEventDispatcher, EnteredExitedHandler, EventHandlerManager, EventRedirector, KeyboardShortcutsHandler, WindowCloseRequestHandler

public abstract class BasicEventDispatcher extends Object implements EventDispatcher
Event dispatcher which introduces event dispatch phase specific methods - 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 Details

    • BasicEventDispatcher

      public BasicEventDispatcher()
  • Method Details

    • dispatchEvent

      public Event dispatchEvent(Event event, EventDispatchChain tail)
      Description copied from interface: EventDispatcher
      Dispatches the specified event by this 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);).
      Specified by:
      dispatchEvent in interface EventDispatcher
      Parameters:
      event - the event do dispatch
      tail - the rest of the chain to dispatch event to
      Returns:
      the return event or null if the event has been handled / consumed
    • dispatchCapturingEvent

      public Event dispatchCapturingEvent(Event event)
    • dispatchBubblingEvent

      public Event dispatchBubblingEvent(Event event)
    • getPreviousDispatcher

      public final BasicEventDispatcher getPreviousDispatcher()
    • getNextDispatcher

      public final BasicEventDispatcher getNextDispatcher()
    • insertNextDispatcher

      public final void insertNextDispatcher(BasicEventDispatcher newDispatcher)