Package com.sun.javafx.event
Class EventHandlerManager
java.lang.Object
com.sun.javafx.event.BasicEventDispatcher
com.sun.javafx.event.EventHandlerManager
- All Implemented Interfaces:
EventDispatcher
An
EventDispatcher
which allows user event handler / filter
registration and when used in an event dispatch chain it forwards received
events to the appropriate registered handlers / filters.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends Event>
voidaddEventFilter
(EventType<T> eventType, EventHandler<? super T> eventFilter) Registers an event filter inEventHandlerManager
.final <T extends Event>
voidaddEventHandler
(EventType<T> eventType, EventHandler<? super T> eventHandler) Registers an event handler inEventHandlerManager
.final Event
dispatchBubblingEvent
(Event event) final Event
dispatchCapturingEvent
(Event event) final <T extends Event>
EventHandler<? super T>getEventHandler
(EventType<T> eventType) protected Object
final <T extends Event>
voidremoveEventFilter
(EventType<T> eventType, EventHandler<? super T> eventFilter) Unregisters a previously registered event filter.final <T extends Event>
voidremoveEventHandler
(EventType<T> eventType, EventHandler<? super T> eventHandler) Unregisters a previously registered event handler.final <T extends Event>
voidsetEventHandler
(EventType<T> eventType, EventHandler<? super T> eventHandler) Sets the specified singleton handler.static void
setEventSourcesListener
(EventHandlerManager.EventSourcesListener eventSourcesListener) Methods inherited from class com.sun.javafx.event.BasicEventDispatcher
dispatchEvent, getNextDispatcher, getPreviousDispatcher, insertNextDispatcher
-
Constructor Details
-
EventHandlerManager
-
-
Method Details
-
addEventHandler
public final <T extends Event> void addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Registers an event handler inEventHandlerManager
.- Type Parameters:
T
- the specific event class of the handler- Parameters:
eventType
- the type of the events to receive by the handlereventHandler
- the handler to register- Throws:
NullPointerException
- if the event type or handler is null
-
removeEventHandler
public final <T extends Event> void removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Unregisters a previously registered event handler.- Type Parameters:
T
- the specific event class of the handler- Parameters:
eventType
- the event type from which to unregistereventHandler
- the handler to unregister- Throws:
NullPointerException
- if the event type or handler is null
-
addEventFilter
public final <T extends Event> void addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Registers an event filter inEventHandlerManager
.- Type Parameters:
T
- the specific event class of the filter- Parameters:
eventType
- the type of the events to receive by the filtereventFilter
- the filter to register- Throws:
NullPointerException
- if the event type or filter is null
-
removeEventFilter
public final <T extends Event> void removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Unregisters a previously registered event filter.- Type Parameters:
T
- the specific event class of the filter- Parameters:
eventType
- the event type from which to unregistereventFilter
- the filter to unregister- Throws:
NullPointerException
- if the event type or filter is null
-
setEventHandler
public final <T extends Event> void setEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Sets the specified singleton handler. There can only be one such handler specified at a time.- Type Parameters:
T
- the specific event class of the handler- Parameters:
eventType
- the event type to associate with the given eventHandlereventHandler
- the handler to register, or null to unregister- Throws:
NullPointerException
- if the event type is null
-
getEventHandler
-
dispatchCapturingEvent
- Overrides:
dispatchCapturingEvent
in classBasicEventDispatcher
-
dispatchBubblingEvent
- Overrides:
dispatchBubblingEvent
in classBasicEventDispatcher
-
getEventSource
-
setEventSourcesListener
public static void setEventSourcesListener(EventHandlerManager.EventSourcesListener eventSourcesListener)
-