Package org.eclipse.gef.fx.nodes
Class GeometryNode<T extends IGeometry>
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
org.eclipse.gef.fx.nodes.GeometryNode<T>
- Type Parameters:
T
- AnIGeometry
used to define the geometric shape of thisGeometryNode
- All Implemented Interfaces:
javafx.css.Styleable
,EventTarget
A
GeometryNode
is a Node
which can be constructed using an
underlying IGeometry
. It is comparable to a Shape
, while a
GeometryNode
in contrast can be resized. Furthermore, the geometric
bounds of a GeometryNode
can be virtually extended for the purpose of
mouse hit-testing to realize a 'clickable area'.
Technically, a GeometryNode
is a Region
that internally holds
a geometric shape
, which is updated to reflect the given
IGeometry
, and to which all visual properties are delegated. The
'clickable' area is realized by a transparent, non-mouse transparent overlay
that uses the same IGeometry
, extended by the
clickable area width
.
Please note that because IGeometry
does not support change
notifications itself, changes to the underlying IGeometry
will not be
recognized by the GeometryNode
unless the geometry property
is changed.
-
Property Summary
TypePropertyDescriptionReturns a (writable) property that controls the width of the clickable area.final ObjectProperty<Paint>
Provides aProperty
holding the fill that is applied to thePath
internally used by thisGeometryNode
.final ObjectProperty<FillRule>
Provides aProperty
holding the fill rule to apply for thisGeometryNode
.Provides aProperty
holding the geometry of thisGeometryNode
.final BooleanProperty
Provides aProperty
holding the smooth value to apply for thisGeometryNode
.final DoubleProperty
Provides aProperty
holding the stroke dash offset to apply for thisGeometryNode
.final ObjectProperty<StrokeLineCap>
Provides aProperty
holding the stroke line cap to apply for thisGeometryNode
.final ObjectProperty<StrokeLineJoin>
Provides aProperty
holding the stroke line join to apply for thisGeometryNode
.final DoubleProperty
Provides aProperty
holding the stroke miter limit to apply for thisGeometryNode
.final ObjectProperty<Paint>
Defines parameters of a stroke that is drawn around the outline of a Shape using the settings of the specified Paint.final ObjectProperty<StrokeType>
Provides aProperty
holding the stroke type to apply for thisGeometryNode
.final DoubleProperty
Provides aProperty
holding the stroke width to apply for thisGeometryNode
.Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, 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, viewOrder, visible
-
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
ConstructorDescriptionConstructs a newGeometryNode
without anIGeometry
.GeometryNode
(T geom) Constructs a newGeometryNode
which displays the givenIGeometry
. -
Method Summary
Modifier and TypeMethodDescriptionReturns a (writable) property that controls the width of the clickable area.protected double
computeMinHeight
(double width) protected double
computeMinWidth
(double height) protected double
computePrefHeight
(double width) protected double
computePrefWidth
(double height) final ObjectProperty<Paint>
Provides aProperty
holding the fill that is applied to thePath
internally used by thisGeometryNode
.final ObjectProperty<FillRule>
Provides aProperty
holding the fill rule to apply for thisGeometryNode
.Provides aProperty
holding the geometry of thisGeometryNode
.double
Retrieves the value of the clickable area width property (clickableAreaWidthProperty()
).final Paint
getFill()
Retrieves the value of the fill property.final FillRule
Retrieves the value of the fill rule property.protected Path
Returns theShape
that is used as a delegate to render the geometry of thisGeometryNode
.Retrieves the value of the geometry property.getPath()
final Paint
Retrieves the value of the stroke property.final ObservableList<Double>
Retrieves the value of the stroke dash array property.final double
Retrieves the value of the stroke dash offset property.final StrokeLineCap
Retrieves the value of the stroke line cap property.final StrokeLineJoin
Retrieves the value of the stroke line join property.final double
Retrieves the value of the stroke miter limit property.final StrokeType
Retrieves the value of the stroke type property.final double
Retrieves the value of the stroke width property.boolean
final boolean
isSmooth()
Retrieves the value of the smooth property.void
relocate
(double x, double y) void
relocateGeometry
(double x, double y) Relocates thegeometry
.void
resize
(double width, double height) void
resizeGeometry
(double width, double height) Resizes thegeometryProperty()
to the given width and height.void
setClickableAreaWidth
(double clickableAreaWidth) Sets the value of the propertyclickable area width
property.final void
Sets the value of the fill property.final void
setFillRule
(FillRule value) Sets the value of the fill rule property.protected void
setGeometricShape
(Path geometricShape) Sets the geometric shape used by thisGeometryNode
.void
setGeometry
(T geometry) Sets theIGeometry
of thisGeometryNode
to the given value.final void
setSmooth
(boolean value) Sets the value of the smooth property.final void
* Sets the value of the stroke property.final void
setStrokeDashOffset
(double value) Sets the value of the stroke dash offset property.final void
setStrokeLineCap
(StrokeLineCap value) Sets the value of the stroke line cap property.final void
setStrokeLineJoin
(StrokeLineJoin value) Sets the value of the stroke line join property.final void
setStrokeMiterLimit
(double value) Sets the value of the stroke miter limit property.final void
setStrokeType
(StrokeType value) Sets the value of the stroke type property.final void
setStrokeWidth
(double value) Sets the value of the stroke width property.final BooleanProperty
Provides aProperty
holding the smooth value to apply for thisGeometryNode
.final DoubleProperty
Provides aProperty
holding the stroke dash offset to apply for thisGeometryNode
.final ObjectProperty<StrokeLineCap>
Provides aProperty
holding the stroke line cap to apply for thisGeometryNode
.final ObjectProperty<StrokeLineJoin>
Provides aProperty
holding the stroke line join to apply for thisGeometryNode
.final DoubleProperty
Provides aProperty
holding the stroke miter limit to apply for thisGeometryNode
.final ObjectProperty<Paint>
Defines parameters of a stroke that is drawn around the outline of a Shape using the settings of the specified Paint.final ObjectProperty<StrokeType>
Provides aProperty
holding the stroke type to apply for thisGeometryNode
.final DoubleProperty
Provides aProperty
holding the stroke width to apply for thisGeometryNode
.Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, 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, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, 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, getInitialCursor, getInitialFocusTraversable, 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, getViewOrder, hasProperties, hoverProperty, idProperty, 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, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
clickableAreaWidth
Returns a (writable) property that controls the width of the clickable area. The clickable area is a transparent 'fat' curve overlaying the actual curve and serving as mouse target. It is only used if the value of the property is greater than the stroke width of the underlying curve. -
fill
Provides aProperty
holding the fill that is applied to thePath
internally used by thisGeometryNode
.- See Also:
-
fillRule
Provides aProperty
holding the fill rule to apply for thisGeometryNode
.- See Also:
-
geometry
Provides aProperty
holding the geometry of thisGeometryNode
.- See Also:
-
smooth
Provides aProperty
holding the smooth value to apply for thisGeometryNode
.- See Also:
-
strokeDashOffset
Provides aProperty
holding the stroke dash offset to apply for thisGeometryNode
. -
strokeLineCap
Provides aProperty
holding the stroke line cap to apply for thisGeometryNode
. -
strokeLineJoin
Provides aProperty
holding the stroke line join to apply for thisGeometryNode
. -
strokeMiterLimit
Provides aProperty
holding the stroke miter limit to apply for thisGeometryNode
. -
stroke
Defines parameters of a stroke that is drawn around the outline of a Shape using the settings of the specified Paint. The default value is Color.BLACK.- See Also:
-
strokeType
Provides aProperty
holding the stroke type to apply for thisGeometryNode
.- See Also:
-
strokeWidth
Provides aProperty
holding the stroke width to apply for thisGeometryNode
.- See Also:
-
-
Constructor Details
-
GeometryNode
public GeometryNode()Constructs a newGeometryNode
without anIGeometry
. -
GeometryNode
Constructs a newGeometryNode
which displays the givenIGeometry
.- Parameters:
geom
- TheIGeometry
to display.
-
-
Method Details
-
clickableAreaWidthProperty
Returns a (writable) property that controls the width of the clickable area. The clickable area is a transparent 'fat' curve overlaying the actual curve and serving as mouse target. It is only used if the value of the property is greater than the stroke width of the underlying curve. -
computeMinHeight
protected double computeMinHeight(double width) - Overrides:
computeMinHeight
in classRegion
-
computeMinWidth
protected double computeMinWidth(double height) - Overrides:
computeMinWidth
in classRegion
-
computePrefHeight
protected double computePrefHeight(double width) - Overrides:
computePrefHeight
in classRegion
-
computePrefWidth
protected double computePrefWidth(double height) - Overrides:
computePrefWidth
in classRegion
-
fillProperty
Provides aProperty
holding the fill that is applied to thePath
internally used by thisGeometryNode
.- See Also:
-
fillRuleProperty
Provides aProperty
holding the fill rule to apply for thisGeometryNode
.- See Also:
-
geometryProperty
Provides aProperty
holding the geometry of thisGeometryNode
.- See Also:
-
getClickableAreaWidth
public double getClickableAreaWidth()Retrieves the value of the clickable area width property (clickableAreaWidthProperty()
).- Returns:
- The current value of the
clickableAreaWidthProperty()
.
-
getFill
Retrieves the value of the fill property.- Returns:
- The value of the fill property.
- See Also:
-
getFillRule
Retrieves the value of the fill rule property.- Returns:
- The value of the fill rule property.
- See Also:
-
getGeometricShape
Returns theShape
that is used as a delegate to render the geometry of thisGeometryNode
.- Returns:
- The geometric shape used by this
GeometryNode
.
-
getGeometry
Retrieves the value of the geometry property.- Returns:
- The value of the geometry property.
-
getPath
-
getStroke
Retrieves the value of the stroke property.- Returns:
- The value of the stroke property.
- See Also:
-
getStrokeDashArray
Retrieves the value of the stroke dash array property.- Returns:
- The value of the stroke dash array property.
- See Also:
-
getStrokeDashOffset
public final double getStrokeDashOffset()Retrieves the value of the stroke dash offset property.- Returns:
- The value of the stroke dash offset property.
- See Also:
-
getStrokeLineCap
Retrieves the value of the stroke line cap property.- Returns:
- The value of the stroke line cap property.
- See Also:
-
getStrokeLineJoin
Retrieves the value of the stroke line join property.- Returns:
- The value of the stroke line join property.
- See Also:
-
getStrokeMiterLimit
public final double getStrokeMiterLimit()Retrieves the value of the stroke miter limit property.- Returns:
- The value of the stroke miter limit property.
- See Also:
-
getStrokeType
Retrieves the value of the stroke type property.- Returns:
- The value of the stroke type property.
- See Also:
-
getStrokeWidth
public final double getStrokeWidth()Retrieves the value of the stroke width property.- Returns:
- The value of the stroke width property.
- See Also:
-
isResizable
public boolean isResizable()- Overrides:
isResizable
in classRegion
-
isSmooth
public final boolean isSmooth()Retrieves the value of the smooth property.- Returns:
- The value of the smooth property.
- See Also:
-
relocate
public void relocate(double x, double y) -
relocateGeometry
public void relocateGeometry(double x, double y) Relocates thegeometry
.- Parameters:
x
- The new x coordinatey
- The new y coordinate
-
resize
public void resize(double width, double height) -
resizeGeometry
public void resizeGeometry(double width, double height) Resizes thegeometryProperty()
to the given width and height.- Parameters:
width
- The new width.height
- The new height.
-
setClickableAreaWidth
public void setClickableAreaWidth(double clickableAreaWidth) Sets the value of the propertyclickable area width
property.- Parameters:
clickableAreaWidth
- The new value of theclickable area width
property.
-
setFill
Sets the value of the fill property.- Parameters:
value
- The new value of the fill property.- See Also:
-
setFillRule
Sets the value of the fill rule property.- Parameters:
value
- The new value of the fill rule property.- See Also:
-
setGeometricShape
Sets the geometric shape used by thisGeometryNode
.- Parameters:
geometricShape
- The geometric shape.
-
setGeometry
Sets theIGeometry
of thisGeometryNode
to the given value.- Parameters:
geometry
- The newIGeometry
for thisGeometryNode
.
-
setSmooth
public final void setSmooth(boolean value) Sets the value of the smooth property.- Parameters:
value
- The new value of the smooth property.- See Also:
-
setStroke
* Sets the value of the stroke property.- Parameters:
value
- The new value of the stroke property.- See Also:
-
setStrokeDashOffset
public final void setStrokeDashOffset(double value) Sets the value of the stroke dash offset property.- Parameters:
value
- The new value of the stroke dash offset property.- See Also:
-
setStrokeLineCap
Sets the value of the stroke line cap property.- Parameters:
value
- The new value of the stroke line cap property.- See Also:
-
setStrokeLineJoin
Sets the value of the stroke line join property.- Parameters:
value
- The new value of the stroke line join property.- See Also:
-
setStrokeMiterLimit
public final void setStrokeMiterLimit(double value) Sets the value of the stroke miter limit property.- Parameters:
value
- The new value of the stroke miter limit property.- See Also:
-
setStrokeType
Sets the value of the stroke type property.- Parameters:
value
- The new value of the stroke type property.- See Also:
-
setStrokeWidth
public final void setStrokeWidth(double value) Sets the value of the stroke width property.- Parameters:
value
- The new value of the stroke width property.- See Also:
-
smoothProperty
Provides aProperty
holding the smooth value to apply for thisGeometryNode
.- See Also:
-
strokeDashOffsetProperty
Provides aProperty
holding the stroke dash offset to apply for thisGeometryNode
. -
strokeLineCapProperty
Provides aProperty
holding the stroke line cap to apply for thisGeometryNode
. -
strokeLineJoinProperty
Provides aProperty
holding the stroke line join to apply for thisGeometryNode
. -
strokeMiterLimitProperty
Provides aProperty
holding the stroke miter limit to apply for thisGeometryNode
. -
strokeProperty
Defines parameters of a stroke that is drawn around the outline of a Shape using the settings of the specified Paint. The default value is Color.BLACK.- See Also:
-
strokeTypeProperty
Provides aProperty
holding the stroke type to apply for thisGeometryNode
.- See Also:
-
strokeWidthProperty
Provides aProperty
holding the stroke width to apply for thisGeometryNode
.- See Also:
-