Package javafx.scene.shape
Class Path
java.lang.Object
javafx.scene.Node
javafx.scene.shape.Shape
javafx.scene.shape.Path
- All Implemented Interfaces:
LayoutMeasurable
,LayoutMeasurableMixin
,HasBlendModeProperty
,HasClipProperty
,HasEffectProperty
,HasFillProperty
,HasLayoutXProperty
,HasLayoutYProperty
,HasManagedProperty
,HasMouseTransparentProperty
,HasOnMouseClickedProperty
,HasOpacityProperty
,HasParentProperty
,HasSmoothProperty
,HasStrokeDashOffsetProperty
,HasStrokeLineCapProperty
,HasStrokeLineJoinProperty
,HasStrokeMiterLimitProperty
,HasStrokeProperty
,HasStrokeTypeProperty
,HasStrokeWidthProperty
,HasVisibleProperty
,Styleable
,EventTarget
,INode
The
Path
class represents a simple shape
and provides facilities required for basic construction
and management of a geometric path. Example:
import javafx.scene.shape.*; Path path = new Path(); MoveTo moveTo = new MoveTo(); moveTo.setX(0.0f); moveTo.setY(0.0f); HLineTo hLineTo = new HLineTo(); hLineTo.setX(70.0f); QuadCurveTo quadCurveTo = new QuadCurveTo(); quadCurveTo.setX(120.0f); quadCurveTo.setY(60.0f); quadCurveTo.setControlX(100.0f); quadCurveTo.setControlY(0.0f); LineTo lineTo = new LineTo(); lineTo.setX(175.0f); lineTo.setY(55.0f); ArcTo arcTo = new ArcTo(); arcTo.setX(50.0f); arcTo.setY(50.0f); arcTo.setRadiusX(50.0f); arcTo.setRadiusY(50.0f); path.getElements().add(moveTo); path.getElements().add(hLineTo); path.getElements().add(quadCurveTo); path.getElements().add(lineTo); path.getElements().add(arcTo);
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionfinal ObjectProperty<FillRule>
Defines the filling rule constant for determining the interior of the path.Properties inherited from class javafx.scene.shape.Shape
fill, smooth, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, stroke, strokeType, strokeWidth
Properties inherited from class javafx.scene.Node
blendMode, cacheHint, cache, clip, cursor, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, layoutBounds, layoutX, layoutY, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onScroll, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, opacity, parent, pressed, rotate, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, visible
-
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
ConstructorDescriptionPath()
Creates an empty instance of Path.Path
(Collection<? extends PathElement> elements) Creates new instance of PathPath
(PathElement... elements) Creates a new instance of Path -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectProperty<FillRule>
Defines the filling rule constant for determining the interior of the path.final ObservableList<PathElement>
Gets observable list of path elements of this path.final FillRule
Gets the value of thefillRule
property.impl_computeGeomBounds
(BaseBounds bounds, BaseTransform tx) Computes the geometric bounds for this Node.final void
setFillRule
(FillRule value) Sets the value of thefillRule
property.toString()
Returns a string representation of thisPath
object.Methods inherited from class javafx.scene.shape.Shape
fillProperty, getStrokeDashArray, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract
Methods inherited from class javafx.scene.Node
addEventFilter, addEventHandler, autosize, blendModeProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, createLayoutMeasurable, cursorProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAllNodeTransforms, getBoundsInLocal, getCacheHint, getCursor, getEventDispatcher, getId, getLayoutMeasurable, getNodePeer, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOrCreateAndBindNodePeer, getProperties, getRotate, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getUserData, hasProperties, hoverProperty, idProperty, impl_computeLayoutBounds, impl_getLayoutBounds, impl_isTreeVisible, impl_maxHeight, impl_maxWidth, impl_minHeight, impl_minWidth, impl_prefHeight, impl_prefWidth, impl_traverse, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isPressed, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScreen, localToScreen, localToScreen, localToScreen, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onNodePeerReady, onPeerSizeChanged, onScrollProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, opacityProperty, parentProperty, parentToLocal, pressedProperty, removeEventFilter, removeEventHandler, requestFocus, requestPeerFocus, rotateProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setCache, setCacheHint, setCursor, setDisable, setDisabled, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setNodePeer, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setPressed, setRotate, setScaleX, setScaleY, setScaleZ, setScene, setStyle, setTranslateX, setTranslateY, setUserData, shouldUseLayoutMeasurable, snapshot, startDragAndDrop, styleProperty, toBack, toFront, translateXProperty, translateYProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFillProperty
getFill, setFill
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSmoothProperty
isSmooth, setSmooth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeDashOffsetProperty
getStrokeDashOffset, setStrokeDashOffset
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineCapProperty
getStrokeLineCap, setStrokeLineCap
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineJoinProperty
getStrokeLineJoin, setStrokeLineJoin
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeMiterLimitProperty
getStrokeMiterLimit, setStrokeMiterLimit
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeProperty
getStroke, setStroke
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeTypeProperty
getStrokeType, setStrokeType
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeWidthProperty
getStrokeWidth, setStrokeWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible
Methods inherited from interface javafx.scene.INode
getBaselineOffset, getContentBias, isResizable, relocate, resize, resizeRelocate
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
-
Property Details
-
fillRule
Defines the filling rule constant for determining the interior of the path. The value must be one of the following constants:FillRile.EVEN_ODD
orFillRule.NON_ZERO
. The default value isFillRule.NON_ZERO
.- Default value:
- FillRule.NON_ZERO
- See Also:
-
-
Constructor Details
-
Path
public Path()Creates an empty instance of Path. -
Path
Creates a new instance of Path- Parameters:
elements
- Elements of the Path- Since:
- JavaFX 2.1
-
Path
Creates new instance of Path- Parameters:
elements
- The collection of the elements of the Path- Since:
- JavaFX 2.2
-
-
Method Details
-
setFillRule
Sets the value of thefillRule
property.- Property description:
- Defines the filling rule constant for determining the interior of the path.
The value must be one of the following constants:
FillRile.EVEN_ODD
orFillRule.NON_ZERO
. The default value isFillRule.NON_ZERO
. - Default value:
- FillRule.NON_ZERO
- Parameters:
value
- the value for thefillRule
property- See Also:
-
getFillRule
Gets the value of thefillRule
property.- Property description:
- Defines the filling rule constant for determining the interior of the path.
The value must be one of the following constants:
FillRile.EVEN_ODD
orFillRule.NON_ZERO
. The default value isFillRule.NON_ZERO
. - Default value:
- FillRule.NON_ZERO
- Returns:
- the value of the
fillRule
property - See Also:
-
fillRuleProperty
Defines the filling rule constant for determining the interior of the path. The value must be one of the following constants:FillRile.EVEN_ODD
orFillRule.NON_ZERO
. The default value isFillRule.NON_ZERO
.- Default value:
- FillRule.NON_ZERO
- Returns:
- the
fillRule
property - See Also:
-
getElements
Gets observable list of path elements of this path.- Returns:
- Elements of this path
-
impl_computeGeomBounds
Description copied from class:Node
Computes the geometric bounds for this Node. This method is abstract and must be implemented by each Node subclass.- Specified by:
impl_computeGeomBounds
in classNode
-
toString
Returns a string representation of thisPath
object.
-