public class Subpath extends Object
Constructor and Description |
---|
Subpath() |
Subpath(float startPointX, float startPointY)
Constructs a new subpath starting at the given point.
|
Subpath(Point2D startPoint)
Constructs a new subpath starting at the given point.
|
Subpath(Subpath subpath)
Copy constuctor.
|
Modifier and Type | Method and Description |
---|---|
void |
addSegment(Shape segment)
Adds a segment to the subpath.
|
Point2D |
getLastPoint() |
List<Point2D> |
getPiecewiseLinearApproximation() |
List<Shape> |
getSegments() |
Point2D |
getStartPoint() |
boolean |
isClosed()
Returns a boolean value indicating whether the subpath must be closed or not.
|
boolean |
isDegenerate()
Returns a boolean indicating whether the subpath is degenerate or not.
|
boolean |
isEmpty()
Checks whether subpath is empty or not.
|
boolean |
isSinglePointClosed() |
boolean |
isSinglePointOpen() |
void |
setClosed(boolean closed)
See isClosed()
|
void |
setStartPoint(float x, float y)
Sets the start point of the subpath.
|
void |
setStartPoint(Point2D startPoint)
Sets the start point of the subpath.
|
public Subpath()
public Subpath(Subpath subpath)
subpath
-
public Subpath(Point2D startPoint)
public Subpath(float startPointX, float startPointY)
public void setStartPoint(Point2D startPoint)
startPoint
-
public void setStartPoint(float x, float y)
x
-
y
-
public Point2D getStartPoint()
public Point2D getLastPoint()
public void addSegment(Shape segment)
segment
- new segment.
public List<Shape> getSegments()
List
comprising all the segments the subpath made on.
public boolean isEmpty()
public boolean isSinglePointOpen()
true
if this subpath contains only one point and it is not closed, false
otherwise
public boolean isSinglePointClosed()
public boolean isClosed()
boolean
value indicating whether the subpath must be closed or not. Ignore this value if the subpath is a rectangle because in this case it is already closed (of course if you paint the path using re
operator)
boolean
value indicating whether the path must be closed or not.
public void setClosed(boolean closed)
isClosed()
public boolean isDegenerate()
boolean
indicating whether the subpath is degenerate or not. A degenerate subpath is the subpath consisting of a single-point closed path or of two or more points at the same coordinates.
boolean
value indicating whether the path is degenerate or not.
Copyright © 1998–2024. All rights reserved.