T
- The SWT Control class which is wrapped by this
FXControlAdapter
.public class FXControlAdapter<T extends Control>
extends javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, impl_showMnemonics, impl_treeVisible, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visible
Modifier and Type | Class and Description |
---|---|
static interface |
FXControlAdapter.IControlFactory<T extends Control>
The
FXControlAdapter.IControlFactory can be used in conjunction
with FXControlAdapter to create the wrapped SWT Control
when the surrounding FXCanvas changes. |
Constructor and Description |
---|
FXControlAdapter(FXControlAdapter.IControlFactory<T> controlFactory)
Creates a new
FXControlAdapter which uses the given
FXControlAdapter.IControlFactory for the creation of the SWT Control . |
FXControlAdapter(T control)
Creates a new
FXControlAdapter which wraps the given SWT
Control . |
Modifier and Type | Method and Description |
---|---|
protected double |
computeMaxHeight(double width) |
protected double |
computeMaxWidth(double height) |
protected double |
computeMinHeight(double width) |
protected double |
computeMinWidth(double height) |
protected double |
computePrefHeight(double width) |
protected double |
computePrefWidth(double height) |
void |
dispose()
Deactivates this
FXControlAdapter , so that the SWT
Control will not be re-created when the FXCanvas changes. |
protected javafx.collections.ObservableList<javafx.scene.Node> |
getChildren()
We do not manage children.
|
T |
getControl()
Returns the SWT
Control that is wrapped by this
FXControlAdapter . |
protected javafx.embed.swt.FXCanvas |
getFXCanvas(Control control)
Returns the first
FXCanvas which is found by walking up the
widget hierarchy of the given Control . |
protected javafx.embed.swt.FXCanvas |
getFXCanvas(javafx.scene.Node node)
Returns the
FXCanvas which embeds the Scene which
contains the given Node . |
protected void |
hookControl(T control)
Hooks the given
Control into the JavaFX scene graph, for example,
registering event forwarding from SWT to JavaFX. |
protected void |
init()
Initializes this
FXControlAdapter . |
protected void |
registerListeners()
Registers JavaFX listeners for forwarding JavaFX state to SWT.
|
protected void |
registerSwtToFXEventForwarders(javafx.embed.swt.FXCanvas newCanvas)
Registers SWT to JavaFX event forwarders for the given
FXCanvas . |
void |
relocate(double paramDouble1,
double paramDouble2) |
void |
resize(double width,
double height) |
protected void |
setCanvas(javafx.embed.swt.FXCanvas newCanvas)
Changes the
FXCanvas in which the Control is hooked. |
protected void |
setControl(T control)
Sets the
Control of this FXControlAdapter to the given
value and hooks or
unhooks the Control ,
respectively. |
protected void |
unhookControl(T control)
Unhooks the given
Control from the JavaFX scene graph, for
example, unregistering event forwarding from SWT to JavaFX. |
protected void |
unregisterListeners()
Unregisters the listeners which have previously been registered during
registerListeners() . |
protected void |
unregisterSwtToFXEventForwarders()
Unregisters the event forwarders which have previously been registered
during
registerSwtToFXEventForwarders(FXCanvas) . |
void |
updateSwtBounds()
|
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthProperty
getBaselineOffset, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, layoutChildren, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public FXControlAdapter(FXControlAdapter.IControlFactory<T> controlFactory)
FXControlAdapter
which uses the given
FXControlAdapter.IControlFactory
for the creation of the SWT Control
.controlFactory
- The FXControlAdapter.IControlFactory
to use to create the SWT
Control
.public FXControlAdapter(T control)
FXControlAdapter
which wraps the given SWT
Control
.control
- The SWT Control
to wrap in this
FXControlAdapter
.protected double computeMaxHeight(double width)
computeMaxHeight
in class javafx.scene.layout.Region
protected double computeMaxWidth(double height)
computeMaxWidth
in class javafx.scene.layout.Region
protected double computeMinHeight(double width)
computeMinHeight
in class javafx.scene.layout.Region
protected double computeMinWidth(double height)
computeMinWidth
in class javafx.scene.layout.Region
protected double computePrefHeight(double width)
computePrefHeight
in class javafx.scene.layout.Region
protected double computePrefWidth(double height)
computePrefWidth
in class javafx.scene.layout.Region
public void dispose()
FXControlAdapter
, so that the SWT
Control
will not be re-created when the FXCanvas
changes.protected javafx.collections.ObservableList<javafx.scene.Node> getChildren()
getChildren
in class javafx.scene.Parent
public T getControl()
Control
that is wrapped by this
FXControlAdapter
.Control
that is wrapped by this
FXControlAdapter
.protected javafx.embed.swt.FXCanvas getFXCanvas(Control control)
FXCanvas
which is found by walking up the
widget hierarchy of the given Control
. If no FXCanvas
can
be found, null
is returned.protected javafx.embed.swt.FXCanvas getFXCanvas(javafx.scene.Node node)
FXCanvas
which embeds the Scene
which
contains the given Node
.node
- The Node
for which the embedding FXCanvas
is
determined.FXCanvas
which embeds the Scene
which
contains the given Node
.protected void hookControl(T control)
Control
into the JavaFX scene graph, for example,
registering event forwarding from SWT to JavaFX.control
- The Control
which is wrapped by this
FXControlAdapter
.registerSwtToFXEventForwarders(FXCanvas)
protected void init()
FXControlAdapter
. Per default, this
FXControlAdapter
is added to the focus traversal cycle and JavaFX
listeners are registered for forwarding JavaFX state to SWT.registerListeners()
protected void registerListeners()
Scene
changes which
will then hook the SWT Control
to the FXCanvas
of the new
Scene
.unregisterListeners()
,
setCanvas(FXCanvas)
protected void registerSwtToFXEventForwarders(javafx.embed.swt.FXCanvas newCanvas)
FXCanvas
.newCanvas
- The FXCanvas
for which event forwarding is registered.unregisterSwtToFXEventForwarders()
public void relocate(double paramDouble1, double paramDouble2)
relocate
in class javafx.scene.Node
public void resize(double width, double height)
resize
in class javafx.scene.layout.Region
protected void setCanvas(javafx.embed.swt.FXCanvas newCanvas)
FXCanvas
in which the Control
is hooked. An
FXControlAdapter.IControlFactory
has to be available for re-creating the
Control
within the new FXCanvas
, otherwise an exception
is thrown.newCanvas
- The new FXCanvas
for the Control
.java.lang.IllegalArgumentException
- when the FXCanvas
is changed, but no
FXControlAdapter.IControlFactory
is available.setControl(Control)
protected void setControl(T control)
Control
of this FXControlAdapter
to the given
value and hooks
or
unhooks
the Control
,
respectively.control
- The new Control
for this FXControlAdapter
.hookControl(Control)
,
unhookControl(Control)
protected void unhookControl(T control)
Control
from the JavaFX scene graph, for
example, unregistering event forwarding from SWT to JavaFX.control
- The Control
which is wrapped by this
FXControlAdapter
.hookControl(Control)
,
unregisterSwtToFXEventForwarders()
protected void unregisterListeners()
registerListeners()
.protected void unregisterSwtToFXEventForwarders()
registerSwtToFXEventForwarders(FXCanvas)
.public void updateSwtBounds()
bounds
of the
Control
which is wrapped by this FXControlAdapter
. This
method is automatically called when this FXControlAdapter
is
relocated
or
resized
.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.