diff --git a/webfx-kit/webfx-kit-javafxgraphics-emul/src/main/java/javafx/scene/Scene.java b/webfx-kit/webfx-kit-javafxgraphics-emul/src/main/java/javafx/scene/Scene.java index 91ccadc09..f8c069cc0 100644 --- a/webfx-kit/webfx-kit-javafxgraphics-emul/src/main/java/javafx/scene/Scene.java +++ b/webfx-kit/webfx-kit-javafxgraphics-emul/src/main/java/javafx/scene/Scene.java @@ -2935,39 +2935,97 @@ public String getName() { return onKeyTyped; } + // PENDING_DOC_REVIEW /** - * Sets the handler to use for this event type. There can only be one such - * handler specified at a time. This handler is guaranteed to be called - * first. This is used for registering the user-defined onFoo event - * handlers. + * Registers an event handler to this scene. The handler is called when the + * scene receives an {@code Event} of the specified type during the bubbling + * phase of event delivery. * * @param the specific event class of the handler - * @param eventType the event type to associate with the given eventHandler - * @param eventHandler the handler to register, or null to unregister - * @throws NullPointerException if the event type is null + * @param eventType the type of the events to receive by the handler + * @param eventHandler the handler to register + * @throws NullPointerException if the event type or handler is null */ - protected final void setEventHandler( + public final void addEventHandler( final EventType eventType, final EventHandler eventHandler) { getInternalEventDispatcher().getEventHandlerManager() - .setEventHandler(eventType, eventHandler); + .addEventHandler(eventType, eventHandler); } + // PENDING_DOC_REVIEW /** - * Registers an event handler to this scene. The handler is called when the - * scene receives an {@code Event} of the specified type during the bubbling - * phase of event delivery. + * Unregisters a previously registered event handler from this scene. One + * handler might have been registered for different event types, so the + * caller needs to specify the particular event type from which to + * unregister the handler. * * @param the specific event class of the handler - * @param eventType the type of the events to receive by the handler - * @param eventHandler the handler to register + * @param eventType the event type from which to unregister + * @param eventHandler the handler to unregister * @throws NullPointerException if the event type or handler is null */ - public final void addEventHandler( + public final void removeEventHandler( final EventType eventType, final EventHandler eventHandler) { getInternalEventDispatcher().getEventHandlerManager() - .addEventHandler(eventType, eventHandler); + .removeEventHandler(eventType, + eventHandler); + } + + // PENDING_DOC_REVIEW + /** + * Registers an event filter to this scene. The filter is called when the + * scene receives an {@code Event} of the specified type during the + * capturing phase of event delivery. + * + * @param the specific event class of the filter + * @param eventType the type of the events to receive by the filter + * @param eventFilter the filter to register + * @throws NullPointerException if the event type or filter is null + */ + public final void addEventFilter( + final EventType eventType, + final EventHandler eventFilter) { + getInternalEventDispatcher().getEventHandlerManager() + .addEventFilter(eventType, eventFilter); + } + + // PENDING_DOC_REVIEW + /** + * Unregisters a previously registered event filter from this scene. One + * filter might have been registered for different event types, so the + * caller needs to specify the particular event type from which to + * unregister the filter. + * + * @param the specific event class of the filter + * @param eventType the event type from which to unregister + * @param eventFilter the filter to unregister + * @throws NullPointerException if the event type or filter is null + */ + public final void removeEventFilter( + final EventType eventType, + final EventHandler eventFilter) { + getInternalEventDispatcher().getEventHandlerManager() + .removeEventFilter(eventType, eventFilter); + } + + /** + * Sets the handler to use for this event type. There can only be one such + * handler specified at a time. This handler is guaranteed to be called + * first. This is used for registering the user-defined onFoo event + * handlers. + * + * @param the specific event class of the handler + * @param eventType the event type to associate with the given eventHandler + * @param eventHandler the handler to register, or null to unregister + * @throws NullPointerException if the event type is null + */ + protected final void setEventHandler( + final EventType eventType, + final EventHandler eventHandler) { + getInternalEventDispatcher().getEventHandlerManager() + .setEventHandler(eventType, eventHandler); } /**