public class SwtToFxEventConverter
extends java.lang.Object
SwtToFxEventConverter forwards SWT events to JavaFX. It is
necessary because the FXCanvas does not forward gesture events and
horizontal mouse wheel events.| Modifier and Type | Class and Description |
|---|---|
protected class |
SwtToFxEventConverter.GestureState
Represents the current
SwtToFxEventConverter.GestureState of touch gesture interaction. |
protected static interface |
SwtToFxEventConverter.ISceneRunnable
The
SwtToFxEventConverter.ISceneRunnable interface provides a callback method that is
invoked in a privileged runnable on the JavaFX application thread. |
| Constructor and Description |
|---|
SwtToFxEventConverter(javafx.embed.swt.FXCanvas canvas)
Registers event forwarding for the given
FXCanvas. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
changeState(org.eclipse.gef4.fx.swt.gestures.SwtToFxEventConverter.GestureStateType newStateType,
GestureEvent event,
com.sun.javafx.tk.TKSceneListener sceneListener)
Changes the internal
SwtToFxEventConverter.GestureState of the currently performed
touch gesture and sends the appropriate events to JavaFX. |
void |
dispose()
Unregisters event forwarding from the
FXCanvas for which this
SwtToFxEventConverter was created. |
protected void |
scheduleSceneRunnable(SwtToFxEventConverter.ISceneRunnable sr)
Schedules the given
SwtToFxEventConverter.ISceneRunnable for execution in a privileged
runnable on the JavaFX application thread. |
protected void |
sendGestureEventToFx(GestureEvent event)
Converts the given
GestureEvent to a corresponding JavaFX event
and sends it to the JavaFX scene graph of the FXCanvas which is
associated with this SwtToFxEventConverter. |
protected void |
sendMouseHorizontalWheelEventToFx(Event event)
Forwards a given
SWT.MouseHorizontalWheel event to JavaFX. |
public SwtToFxEventConverter(javafx.embed.swt.FXCanvas canvas)
FXCanvas.canvas - The FXCanvas for which event forwarding is registered.protected boolean changeState(org.eclipse.gef4.fx.swt.gestures.SwtToFxEventConverter.GestureStateType newStateType,
GestureEvent event,
com.sun.javafx.tk.TKSceneListener sceneListener)
SwtToFxEventConverter.GestureState of the currently performed
touch gesture and sends the appropriate events to JavaFX.newStateType - The new GestureStateType.event - The GestureEvent which was performed.sceneListener - The TKSceneListener to which the corresponding JavaFX
event is send.true when the GestureStateType is changed,
otherwise false.public void dispose()
FXCanvas for which this
SwtToFxEventConverter was created.protected void scheduleSceneRunnable(SwtToFxEventConverter.ISceneRunnable sr)
SwtToFxEventConverter.ISceneRunnable for execution in a privileged
runnable on the JavaFX application thread.sr - The SwtToFxEventConverter.ISceneRunnable that will be executed in a
privileged runnable on the JavaFX application thread.protected void sendGestureEventToFx(GestureEvent event)
GestureEvent to a corresponding JavaFX event
and sends it to the JavaFX scene graph of the FXCanvas which is
associated with this SwtToFxEventConverter.event - The GestureEvent to send to JavaFX.protected void sendMouseHorizontalWheelEventToFx(Event event)
SWT.MouseHorizontalWheel event to JavaFX.event - The SWT.MouseHorizontalWheel event that is forwarded
to JavaFX.Copyright (c) 2014 itemis AG and others. All rights reserved.