public class Path extends Shape
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);
Type | Property and Description |
---|---|
<any> |
fillRule
Defines the filling rule constant for determining the interior of the path.
|
fillProperty, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty
Modifier and Type | Field and Description |
---|---|
private <any> |
elements
Defines the array of path elements of this path.
|
private <any> |
fillRule
Defines the filling rule constant for determining the interior of the path.
|
private boolean |
isPathValid |
private Path2D |
path2d |
old_fill, old_stroke
Constructor and Description |
---|
Path()
Creates an empty instance of Path.
|
Path(java.util.Collection<? extends PathElement> elements)
Creates new instance of Path
|
Path(PathElement... elements)
Creates a new instance of Path
|
Modifier and Type | Method and Description |
---|---|
private Bounds |
doComputeLayoutBounds() |
private Path2D |
doConfigShape() |
private NGNode |
doCreatePeer() |
private Paint |
doCssGetFillInitialValue()
*
Stylesheet Handling *
*
|
private Paint |
doCssGetStrokeInitialValue() |
private void |
doUpdatePeer() |
<any> |
fillRuleProperty()
Defines the filling rule constant for determining the interior of the path.
|
<any> |
getElements()
Gets observable list of path elements of this path.
|
FillRule |
getFillRule()
Gets the value of the property fillRule.
|
private boolean |
isFirstPathElementValid() |
(package private) void |
markPathDirty() |
void |
setFillRule(FillRule value)
Sets the value of the property fillRule.
|
java.lang.String |
toString()
Returns a string representation of this
Path object. |
computeBounds, computeShapeBounds, computeShapeContains, convertLineJoin, fillProperty, getClassCssMetaData, getCssMetaData, getFill, getMode, getStroke, getStrokeDashArray, getStrokeDashOffset, getStrokeLineCap, getStrokeLineJoin, getStrokeMiterLimit, getStrokeType, getStrokeWidth, intersect, isSmooth, setFill, setMode, setShapeChangeListener, setSmooth, setStroke, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeType, setStrokeWidth, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract, union
public final <any> fillRuleProperty
FillRile.EVEN_ODD
or FillRule.NON_ZERO
.
The default value is FillRule.NON_ZERO
.getFillRule()
,
setFillRule(FillRule)
private Path2D path2d
private <any> fillRule
FillRile.EVEN_ODD
or FillRule.NON_ZERO
.
The default value is FillRule.NON_ZERO
.private boolean isPathValid
private final <any> elements
public Path()
public Path(PathElement... elements)
elements
- Elements of the Pathpublic Path(java.util.Collection<? extends PathElement> elements)
elements
- The collection of the elements of the Pathvoid markPathDirty()
public final void setFillRule(FillRule value)
public final FillRule getFillRule()
public final <any> fillRuleProperty()
FillRile.EVEN_ODD
or FillRule.NON_ZERO
.
The default value is FillRule.NON_ZERO
.getFillRule()
,
setFillRule(FillRule)
public final <any> getElements()
private NGNode doCreatePeer()
private Path2D doConfigShape()
private Bounds doComputeLayoutBounds()
private boolean isFirstPathElementValid()
private void doUpdatePeer()
private Paint doCssGetFillInitialValue()
private Paint doCssGetStrokeInitialValue()
public java.lang.String toString()
Path
object.Path
object.