APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.shape

public non-sealed Class Path

extends Shape
Class Inheritance
Imports
com.sun.javafx.collections.TrackableObservableList, com.sun.javafx.geom.Path2D, com.sun.javafx.scene.DirtyBits, .NodeHelper, com.sun.javafx.scene.shape.PathElementHelper, .PathHelper, .PathUtils, .ShapeHelper, com.sun.javafx.sg.prism.NGNode, .NGPath, javafx.beans.property.ObjectProperty, .ObjectPropertyBase, javafx.collections.ListChangeListener.Change, .ObservableList, javafx.css.StyleableProperty, javafx.geometry.BoundingBox, .Bounds, javafx.scene.paint.Color, .Paint, java.util.Collection, .List, javafx.scene.Node

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

Field Summary

Modifier and TypeField and Description
private final ObservableList<PathElement>
elements

Defines the array of path elements of this path.

private ObjectProperty<FillRule>
fillRule

Defines the filling rule constant for determining the interior of the path.

private boolean
private Path2D
Inherited from javafx.scene.shape.Shape:
old_fillold_stroke

Constructor Summary

AccessConstructor and Description
public
Path()

Creates an empty instance of Path.

public
Path(PathElement...
Elements of the Path
elements
)

Creates a new instance of Path

public
Path(Collection<? extends PathElement>
The collection of the elements of the Path
elements
)

Creates new instance of Path

Method Summary

Modifier and TypeMethod and Description
private Bounds
private Path2D
private NGNode
private Paint
private Paint
private void
public final ObjectProperty<FillRule>
public final ObservableList<PathElement>

Returns:

Elements of this path
getElements
()

Gets observable list of path elements of this path.

public final FillRule
private boolean
pack-priv void
public final void
public String

Returns:

a string representation of this Path object.
toString
()

Overrides javafx.scene.Node.toString.

Returns a string representation of this Path object.

Inherited from javafx.scene.shape.Shape:
computeBoundscomputeShapeBoundscomputeShapeContainsconvertLineJoinfillPropertygetClassCssMetaDatagetCssMetaDatagetFillgetModegetStrokegetStrokeDashArraygetStrokeDashOffsetgetStrokeLineCapgetStrokeLineJoingetStrokeMiterLimitgetStrokeTypegetStrokeWidthintersectisSmoothsetFillsetShapeChangeListenersetSmoothsetStrokesetStrokeDashOffsetsetStrokeLineCapsetStrokeLineJoinsetStrokeMiterLimitsetStrokeTypesetStrokeWidthsmoothPropertystrokeDashOffsetPropertystrokeLineCapPropertystrokeLineJoinPropertystrokeMiterLimitPropertystrokePropertystrokeTypePropertystrokeWidthPropertysubtractunion

Field Detail

elementsback to summary
private final ObservableList<PathElement> elements

Defines the array of path elements of this path.

Default Value
empty
fillRuleback to summary
private ObjectProperty<FillRule> 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 or FillRule.NON_ZERO. The default value is FillRule.NON_ZERO.

Default Value
FillRule.NON_ZERO
isPathValidback to summary
private boolean isPathValid
path2dback to summary
private Path2D path2d

Constructor Detail

Pathback to summary
public Path()

Creates an empty instance of Path.

Pathback to summary
public Path(PathElement... elements)

Creates a new instance of Path

Parameters
elements:PathElement[]

Elements of the Path

Since
JavaFX 2.1
Pathback to summary
public Path(Collection<? extends PathElement> elements)

Creates new instance of Path

Parameters
elements:Collection<? extends PathElement>

The collection of the elements of the Path

Since
JavaFX 2.2

Method Detail

doComputeLayoutBoundsback to summary
private Bounds doComputeLayoutBounds()

Hides javafx.scene.Node.doComputeLayoutBounds.

doConfigShapeback to summary
private Path2D doConfigShape()
doCreatePeerback to summary
private NGNode doCreatePeer()
doCssGetFillInitialValueback to summary
private Paint doCssGetFillInitialValue()

Hides javafx.scene.shape.Shape.doCssGetFillInitialValue.

doCssGetStrokeInitialValueback to summary
private Paint doCssGetStrokeInitialValue()

Hides javafx.scene.shape.Shape.doCssGetStrokeInitialValue.

doUpdatePeerback to summary
private void doUpdatePeer()

Hides javafx.scene.shape.Shape.doUpdatePeer.

fillRulePropertyback to summary
public final ObjectProperty<FillRule> fillRuleProperty()
getElementsback to summary
public final ObservableList<PathElement> getElements()

Gets observable list of path elements of this path.

Returns:ObservableList<PathElement>

Elements of this path

getFillRuleback to summary
public final FillRule getFillRule()
isFirstPathElementValidback to summary
private boolean isFirstPathElementValid()
markPathDirtyback to summary
pack-priv void markPathDirty()
setFillRuleback to summary
public final void setFillRule(FillRule value)
toStringback to summary
public String toString()

Overrides javafx.scene.Node.toString.

Returns a string representation of this Path object.

Returns:String

a string representation of this Path object.

Annotations
@Override