- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx<Path2dfx>
-
- org.arakhne.afc.math.geometry.d2.dfx.Path2dfx
-
- All Implemented Interfaces:
Serializable,Cloneable,Path2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2dfx<Path2dfx>,Path2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>,Shape2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>,JsonableObject
public class Path2dfx extends AbstractShape2dfx<Path2dfx> implements Path2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>
Path with 2 double precision floating-point FX properties.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:49
- Author:
- Stéphane GALLAND, Hamza JAFFALI
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- mathfx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.afp.Path2afp
Path2afp.AbstractPathPathIterator<T extends PathElement2afp>, Path2afp.FlatteningPathIterator<T extends PathElement2afp>, Path2afp.PathPathIterator<T extends PathElement2afp>, Path2afp.TransformedPathPathIterator<T extends PathElement2afp>
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d2.Path2D
Path2D.ArcType
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
boundingBox
-
Fields inherited from interface org.arakhne.afc.math.geometry.d2.afp.Path2afp
DEFAULT_FLATTENING_LIMIT, DEFAULT_WINDING_RULE, GROW_SIZE
-
-
Constructor Summary
Constructors Constructor Description Path2dfx()Construct an empty path.Path2dfx(Iterator<PathElement2dfx> iterator)Construct a path by copying the given elements.Path2dfx(Path2afp<?,?,?,?,?,?> path)Constructor by copy.Path2dfx(PathWindingRule windingRule)Construct a path with the given path winding rule.Path2dfx(PathWindingRule windingRule, Iterator<PathElement2dfx> iterator)Construct a path by copying the given elements, and the given path winding rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ObjectProperty<Rectangle2dfx>boundingBoxProperty()Replies the property that contains the bounding box for this shape.voidclear()Reset this shape to be equivalent to an just-created instance of this shape type.Path2dfxclone()Clone this shape.voidclosePath()Closes the current subpath by drawing a straight line back to the coordinates of the lastmoveTo.booleancontainsControlPoint(Point2D<?,?> pt)Replies if the given points exists in the coordinates of this path.javafx.beans.property.ObjectProperty<Rectangle2dfx>controlPointBoundingBoxProperty()Replies the property that corresponds to the bounding box of the control points.javafx.beans.property.ReadOnlyListProperty<Point2dfx>coordinatesProperty()Replies the coordinates property.voidcurveTo(double x1, double y1, double x2, double y2, double x3, double y3)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points.voidcurveTo(Point2D<?,?> ctrl1, Point2D<?,?> ctrl2, Point2D<?,?> to)Adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points.doublegetCoordAt(int index)Replies the coordinate at the given index.Point2dfxgetCurrentPoint()Replies the last point in the path.doublegetCurrentX()Replies the x coordinate of the last point in the path.doublegetCurrentY()Replies the y coordinate of the last point in the path.doublegetLength()Replies the total length of the path.intgetPathElementCount()Replies the number of path elements in this path.PathElementTypegetPathElementTypeAt(int index)Replies the type of the path element at the given position in this path.Point2dfxgetPointAt(int index)Replies the point at the given index.PathWindingRulegetWindingRule()Replies the winding rule for the path.inthashCode()protected javafx.beans.property.ReadOnlyListWrapper<Point2dfx>innerCoordinatesProperty()Replies the private coordinates property.protected javafx.beans.property.ReadOnlyListWrapper<PathElementType>innerTypesProperty()Replies the private types property.booleanisCurved()Replies the path contains a curve..javafx.beans.property.BooleanPropertyisCurvedProperty()Replies the isCurved property.booleanisEmpty()Replies if this shape is empty.javafx.beans.property.BooleanPropertyisEmptyProperty()Replies the isEmpty property.booleanisMultiParts()Replies the path has multiple parts, i.e. multipleMOVE_TOare inside.javafx.beans.property.BooleanPropertyisMultiPartsProperty()Replies the isMultiParts property.booleanisPolygon()Replies the path is composed only by oneMOVE_TO, a sequence ofLINE_TOorQUAD_TOorCURVE_TO, orARC_TO, and a singleCLOSEprimitives.javafx.beans.property.BooleanPropertyisPolygonProperty()Replies the isPolygon property.booleanisPolyline()Replies the path is composed only by oneMOVE_TO, and a sequence ofLINE_TOprimitives.javafx.beans.property.BooleanPropertyisPolylineProperty()Replies the isPolyline property.javafx.beans.property.DoublePropertylengthProperty()Replies the path length property.voidlineTo(double x, double y)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.voidlineTo(Point2D<?,?> to)Adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.voidmoveTo(double x, double y)Adds a point to the path by moving to the specified coordinates specified in double precision.voidmoveTo(Point2D<?,?> position)Adds a point to the path by moving to the specified coordinates specified in double precision.voidquadTo(double x1, double y1, double x2, double y2)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point.voidquadTo(Point2D<?,?> ctrl, Point2D<?,?> to)Adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point.booleanremove(double x, double y)Remove the point with the given coordinates.booleanremove(Point2D<?,?> point)Remove the point from this path.voidremoveLast()Remove the last action.voidset(Path2dfx path)Set this shape with the attributes of the given shape.voidsetLastPoint(double x, double y)Change the coordinates of the last inserted point.voidsetLastPoint(Point2D<?,?> point)Change the coordinates of the last inserted point.voidsetWindingRule(PathWindingRule rule)Set the winding rule for the path.intsize()Replies the number of points in the path.Rectangle2dfxtoBoundingBox()Replies the bounding box of this shape.voidtoBoundingBox(Rectangle2dfx box)Replies the bounds of the shape.Rectangle2dfxtoBoundingBoxWithCtrlPoints()Replies the bounding box of all the points added in this path.voidtoBoundingBoxWithCtrlPoints(Rectangle2dfx box)Compute the bounding box of all the points added in this path.double[]toDoubleArray(Transform2D transform)Replies the coordinates of this path in an array of double precision floating-point numbers.float[]toFloatArray(Transform2D transform)Replies the coordinates of this path in an array of single precision floating-point numbers.int[]toIntArray(Transform2D transform)Replies the coordinates of this path in an array of integer numbers.Point2dfx[]toPointArray(Transform2D transform)Replies the points of this path in an array.voidtransform(Transform2D transform)Transform the current path.voidtranslate(double dx, double dy)Translate the shape.javafx.beans.property.ReadOnlyListProperty<PathElementType>typesProperty()Replies the types property.javafx.beans.property.ObjectProperty<PathWindingRule>windingRuleProperty()Replies the windingRule property.-
Methods inherited from class org.arakhne.afc.math.geometry.d2.dfx.AbstractShape2dfx
equals, getGeomFactory, toJson, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Path2afp
add, arcTo, arcTo, arcTo, arcTo, arcTo, contains, contains, equalsToShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getFlatteningPathIterator, getLengthSquared, getPathIterator, getPathIterator, getPathIterator, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, intersects, moveToIfFar, moveToIfFar, set, toCollection
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Path2D
arcTo, toDoubleArray, toFloatArray, toIntArray, toPointArray
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.afp.Shape2afp
contains, contains, createTransformedShape, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d2.Shape2D
equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
Path2dfx
public Path2dfx()
Construct an empty path.
-
Path2dfx
public Path2dfx(Iterator<PathElement2dfx> iterator)
Construct a path by copying the given elements.- Parameters:
iterator- the iterator that provides the elements to copy.
-
Path2dfx
public Path2dfx(PathWindingRule windingRule)
Construct a path with the given path winding rule.- Parameters:
windingRule- the path winding rule.
-
Path2dfx
public Path2dfx(PathWindingRule windingRule, Iterator<PathElement2dfx> iterator)
Construct a path by copying the given elements, and the given path winding rule.- Parameters:
windingRule- the path winding rule.iterator- the iterator that provides the elements to copy.
-
Path2dfx
public Path2dfx(Path2afp<?,?,?,?,?,?> path)
Constructor by copy.- Parameters:
path- the path to copy.
-
-
Method Detail
-
containsControlPoint
@Pure public boolean containsControlPoint(Point2D<?,?> pt)
Description copied from interface:Path2DReplies if the given points exists in the coordinates of this path.- Specified by:
containsControlPointin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
pt- the point.- Returns:
trueif the point is a control point of the path.
-
clear
public void clear()
Description copied from interface:Shape2DReset this shape to be equivalent to an just-created instance of this shape type.- Specified by:
clearin interfaceShape2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>
-
clone
@Pure public Path2dfx clone()
Description copied from interface:Shape2DClone this shape.- Specified by:
clonein interfaceShape2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Overrides:
clonein classAbstractShape2dfx<Path2dfx>- Returns:
- the clone.
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classAbstractShape2dfx<Path2dfx>
-
translate
public void translate(double dx, double dy)Description copied from interface:Shape2afpTranslate the shape.- Specified by:
translatein interfaceShape2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
dx- x translation.dy- y translation.
-
transform
public void transform(Transform2D transform)
Description copied from interface:Path2afpTransform the current path. This function changes the current path.- Specified by:
transformin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
transform- is the affine transformation to apply.- See Also:
Shape2afp.createTransformedShape(org.arakhne.afc.math.geometry.d2.Transform2D)
-
isEmptyProperty
public javafx.beans.property.BooleanProperty isEmptyProperty()
Replies the isEmpty property.- Returns:
- the isEmpty property.
-
isEmpty
public boolean isEmpty()
Description copied from interface:Shape2DReplies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.- Specified by:
isEmptyin interfaceShape2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
trueif the shape is empty;falseotherwise.
-
toBoundingBox
public Rectangle2dfx toBoundingBox()
Description copied from interface:Shape2DReplies the bounding box of this shape.- Specified by:
toBoundingBoxin interfaceShape2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
toBoundingBoxin interfaceShape2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the bounding box of this shape.
-
toBoundingBox
public void toBoundingBox(Rectangle2dfx box)
Description copied from interface:Shape2DReplies the bounds of the shape.- Specified by:
toBoundingBoxin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
toBoundingBoxin interfaceShape2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
box- is set with the bounds of the shape.
-
windingRuleProperty
public javafx.beans.property.ObjectProperty<PathWindingRule> windingRuleProperty()
Replies the windingRule property.- Returns:
- the windingRule property.
-
getWindingRule
public PathWindingRule getWindingRule()
Description copied from interface:Path2DReplies the winding rule for the path.- Specified by:
getWindingRulein interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the winding rule for the path.
-
setWindingRule
public void setWindingRule(PathWindingRule rule)
Description copied from interface:Path2DSet the winding rule for the path.- Specified by:
setWindingRulein interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
rule- is the winding rule for the path.
-
isPolylineProperty
public javafx.beans.property.BooleanProperty isPolylineProperty()
Replies the isPolyline property.- Returns:
- the isPolyline property.
-
isPolyline
public boolean isPolyline()
Description copied from interface:Path2DReplies the path is composed only by oneMOVE_TO, and a sequence ofLINE_TOprimitives.- Specified by:
isPolylinein interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
trueif the path does not contain curve primitives,falseotherwise.
-
isCurvedProperty
public javafx.beans.property.BooleanProperty isCurvedProperty()
Replies the isCurved property.- Returns:
- the isCurved property.
-
isCurved
public boolean isCurved()
Description copied from interface:Path2DReplies the path contains a curve..- Specified by:
isCurvedin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
trueif the path does not contain curve primitives,falseotherwise.
-
isMultiPartsProperty
public javafx.beans.property.BooleanProperty isMultiPartsProperty()
Replies the isMultiParts property.- Returns:
- the isMultiParts property.
-
isMultiParts
public boolean isMultiParts()
Description copied from interface:Path2DReplies the path has multiple parts, i.e. multipleMOVE_TOare inside. primitives.- Specified by:
isMultiPartsin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
trueif the path has multiple move-to primitive,falseotherwise.
-
isPolygonProperty
public javafx.beans.property.BooleanProperty isPolygonProperty()
Replies the isPolygon property.- Returns:
- the isPolygon property.
-
isPolygon
public boolean isPolygon()
Description copied from interface:Path2DReplies the path is composed only by oneMOVE_TO, a sequence ofLINE_TOorQUAD_TOorCURVE_TO, orARC_TO, and a singleCLOSEprimitives.- Specified by:
isPolygonin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
trueif the path does not contain curve primitives,falseotherwise.
-
closePath
public void closePath()
Description copied from interface:Path2DCloses the current subpath by drawing a straight line back to the coordinates of the lastmoveTo. If the path is already closed or if the previous coordinates are for amoveTothen this method has no effect.- Specified by:
closePathin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>
-
toBoundingBoxWithCtrlPoints
public Rectangle2dfx toBoundingBoxWithCtrlPoints()
Description copied from interface:Path2DReplies the bounding box of all the points added in this path.The replied bounding box includes the (invisible) control points.
- Specified by:
toBoundingBoxWithCtrlPointsin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the bounding box with the control points.
- See Also:
Shape2D.toBoundingBox()
-
toBoundingBoxWithCtrlPoints
public void toBoundingBoxWithCtrlPoints(Rectangle2dfx box)
Description copied from interface:Path2DCompute the bounding box of all the points added in this path.The replied bounding box includes the (invisible) control points.
- Specified by:
toBoundingBoxWithCtrlPointsin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
box- is the rectangle to set with the bounds.- See Also:
Shape2D.toBoundingBox()
-
toIntArray
public int[] toIntArray(Transform2D transform)
Description copied from interface:Path2DReplies the coordinates of this path in an array of integer numbers.- Specified by:
toIntArrayin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
transform- is the transformation to apply to all the coordinates.- Returns:
- the coordinates.
-
toFloatArray
public float[] toFloatArray(Transform2D transform)
Description copied from interface:Path2DReplies the coordinates of this path in an array of single precision floating-point numbers.- Specified by:
toFloatArrayin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
transform- is the transformation to apply to all the coordinates.- Returns:
- the coordinates.
-
toDoubleArray
public double[] toDoubleArray(Transform2D transform)
Description copied from interface:Path2DReplies the coordinates of this path in an array of double precision floating-point numbers.- Specified by:
toDoubleArrayin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
transform- is the transformation to apply to all the coordinates.- Returns:
- the coordinates.
-
toPointArray
public Point2dfx[] toPointArray(Transform2D transform)
Description copied from interface:Path2DReplies the points of this path in an array.- Specified by:
toPointArrayin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
transform- is the transformation to apply to all the points.- Returns:
- the points.
-
getPointAt
public Point2dfx getPointAt(int index)
Description copied from interface:Path2DReplies the point at the given index. The index is in [0;Path2D.size()).- Specified by:
getPointAtin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
index- the index.- Returns:
- the point at the given index.
-
getCurrentX
@Pure public double getCurrentX()
Description copied from interface:Path2afpReplies the x coordinate of the last point in the path.- Specified by:
getCurrentXin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the x coordinate of the last point in the path.
-
getCurrentY
@Pure public double getCurrentY()
Description copied from interface:Path2afpReplies the y coordinate of the last point in the path.- Specified by:
getCurrentYin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the y coordinate of the last point in the path.
-
getCurrentPoint
@Pure public Point2dfx getCurrentPoint()
Description copied from interface:Path2DReplies the last point in the path.- Specified by:
getCurrentPointin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
getCurrentPointin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the last point.
-
size
public int size()
Description copied from interface:Path2DReplies the number of points in the path.- Specified by:
sizein interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the number of points in the path.
-
removeLast
public void removeLast()
Description copied from interface:Path2DRemove the last action.- Specified by:
removeLastin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>
-
moveTo
public void moveTo(double x, double y)Description copied from interface:Path2afpAdds a point to the path by moving to the specified coordinates specified in double precision.- Specified by:
moveToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- the specified X coordinatey- the specified Y coordinate
-
moveTo
public void moveTo(Point2D<?,?> position)
Description copied from interface:Path2DAdds a point to the path by moving to the specified coordinates specified in double precision.- Specified by:
moveToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
moveToin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
position- the new position.
-
lineTo
public void lineTo(double x, double y)Description copied from interface:Path2afpAdds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.- Specified by:
lineToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- the specified X coordinatey- the specified Y coordinate
-
lineTo
public void lineTo(Point2D<?,?> to)
Description copied from interface:Path2DAdds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates specified in double precision.- Specified by:
lineToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
lineToin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
to- the end point
-
quadTo
public void quadTo(double x1, double y1, double x2, double y2)Description copied from interface:Path2afpAdds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point. All coordinates are specified in double precision.- Specified by:
quadToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x1- the X coordinate of the quadratic control pointy1- the Y coordinate of the quadratic control pointx2- the X coordinate of the final end pointy2- the Y coordinate of the final end point
-
quadTo
public void quadTo(Point2D<?,?> ctrl, Point2D<?,?> to)
Description copied from interface:Path2DAdds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates(x2, y2), using the specified point(x1, y1)as a quadratic parametric control point. All coordinates are specified in double precision.- Specified by:
quadToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
quadToin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
ctrl- the quadratic control pointto- the final end point
-
curveTo
public void curveTo(double x1, double y1, double x2, double y2, double x3, double y3)Description copied from interface:Path2afpAdds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points. All coordinates are specified in double precision.- Specified by:
curveToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x1- the X coordinate of the first Bézier control pointy1- the Y coordinate of the first Bézier control pointx2- the X coordinate of the second Bézier control pointy2- the Y coordinate of the second Bézier control pointx3- the X coordinate of the final end pointy3- the Y coordinate of the final end point
-
curveTo
public void curveTo(Point2D<?,?> ctrl1, Point2D<?,?> ctrl2, Point2D<?,?> to)
Description copied from interface:Path2DAdds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates(x3, y3), using the specified points(x1, y1)and(x2, y2)as Bézier control points. All coordinates are specified in double precision.- Specified by:
curveToin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
curveToin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
ctrl1- the first Bézier control pointctrl2- the second Bézier control pointto- the final end point
-
innerCoordinatesProperty
protected javafx.beans.property.ReadOnlyListWrapper<Point2dfx> innerCoordinatesProperty()
Replies the private coordinates property.- Returns:
- the private coordinates property.
-
coordinatesProperty
public javafx.beans.property.ReadOnlyListProperty<Point2dfx> coordinatesProperty()
Replies the coordinates property.- Returns:
- the coordinates property.
-
getCoordAt
public double getCoordAt(int index)
Description copied from interface:Path2afpReplies the coordinate at the given index. The index is in [0;Path2D.size()*2).- Specified by:
getCoordAtin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
index- the index.- Returns:
- the coordinate at the given index.
-
setLastPoint
public void setLastPoint(double x, double y)Description copied from interface:Path2afpChange the coordinates of the last inserted point.- Specified by:
setLastPointin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- the new x coordinate of the last point.y- the new y coordinate of the last point.
-
setLastPoint
public void setLastPoint(Point2D<?,?> point)
Description copied from interface:Path2DChange the coordinates of the last inserted point.- Specified by:
setLastPointin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
setLastPointin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
point- the point.
-
remove
public boolean remove(double x, double y)Description copied from interface:Path2afpRemove the point with the given coordinates.If the given coordinates do not match exactly a point in the path, nothing is removed.
- Specified by:
removein interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
x- the x coordinate of the ponit to remove.y- the y coordinate of the ponit to remove.- Returns:
trueif the point was removed;falseotherwise.
-
remove
public boolean remove(Point2D<?,?> point)
Remove the point from this path.If the given point do not match exactly a point in the path, nothing is removed.
- Parameters:
point- the point to remove.- Returns:
trueif the point was removed;falseotherwise.
-
set
public void set(Path2dfx path)
Description copied from interface:Shape2DSet this shape with the attributes of the given shape.- Specified by:
setin interfaceShape2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
path- the shape to copy.
-
innerTypesProperty
protected javafx.beans.property.ReadOnlyListWrapper<PathElementType> innerTypesProperty()
Replies the private types property.- Returns:
- the private types property.
-
typesProperty
public javafx.beans.property.ReadOnlyListProperty<PathElementType> typesProperty()
Replies the types property.- Returns:
- the types property.
-
getPathElementCount
public int getPathElementCount()
Description copied from interface:Path2DReplies the number of path elements in this path.- Specified by:
getPathElementCountin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the number of path elements.
- See Also:
Path2D.getPathElementTypeAt(int)
-
getPathElementTypeAt
public PathElementType getPathElementTypeAt(int index)
Description copied from interface:Path2DReplies the type of the path element at the given position in this path.- Specified by:
getPathElementTypeAtin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Parameters:
index- the index of the path element.- Returns:
- the type of the path element.
- See Also:
Path2D.getPathElementCount()
-
getLength
public double getLength()
Description copied from interface:Path2DReplies the total length of the path.- Specified by:
getLengthin interfacePath2afp<Shape2dfx<?>,Path2dfx,PathElement2dfx,Point2dfx,Vector2dfx,Rectangle2dfx>- Specified by:
getLengthin interfacePath2D<Shape2dfx<?>,Path2dfx,PathIterator2afp<PathElement2dfx>,Point2dfx,Vector2dfx,Rectangle2dfx>- Returns:
- the length of the path.
-
lengthProperty
public javafx.beans.property.DoubleProperty lengthProperty()
Replies the path length property.- Returns:
- the length property.
-
boundingBoxProperty
public javafx.beans.property.ObjectProperty<Rectangle2dfx> boundingBoxProperty()
Description copied from interface:Shape2dfxReplies the property that contains the bounding box for this shape.- Specified by:
boundingBoxPropertyin interfaceShape2dfx<Path2dfx>- Returns:
- the bounding box.
-
controlPointBoundingBoxProperty
public javafx.beans.property.ObjectProperty<Rectangle2dfx> controlPointBoundingBoxProperty()
Replies the property that corresponds to the bounding box of the control points.The replied box is not the one corresponding to the drawable elements, as replied by
boundingBoxProperty().- Returns:
- the bounding box of the control points.
-
-