public class Polyline extends PointList implements Path2d
Path2d
implicitly made up of Line2d
segments
based on the assumption of ordered points held in a PointList
.Constructor and Description |
---|
Polyline(Iterator<Line2d> lineIterator)
Construct a
Polyline from line segments |
Polyline(List<? extends Point2d> points)
Construct a
Polyline from points |
Polyline(List<? extends Point2d> points,
boolean copy)
Construct a
Polyline from the points, possibly copying the points
first |
Polyline(Point2d... points)
Construct a
Polyline from points |
Modifier and Type | Method and Description |
---|---|
Polyline |
asPolyline()
Convert the path to a polyline representation
|
Point2d |
begin()
Get the beginning of the path
|
double |
calculateLength()
Calculate the length of the path
|
Point2d |
end()
Get the end of the path
|
Iterator<Line2d> |
lineIterator()
Convert the path to a iterated polyline representation
|
calculateCentroid, calculateConvexHull, calculateRegularBoundingBox, clone, computeIntrinsicScale, computeMean, get, getHeight, getLines, getLines, getWidth, iterator, maxX, maxY, minX, minY, rotate, rotate, scale, scale, scaleCentroid, scaleX, scaleXY, scaleY, size, toString, transform, translate
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
calculateCentroid, calculateRegularBoundingBox, getHeight, getWidth, maxX, maxY, minX, minY, scale, scale, scaleCentroid, transform, translate
forEach, spliterator
public Polyline(Point2d... points)
Polyline
from pointspoints
- the pointspublic Polyline(List<? extends Point2d> points)
Polyline
from pointspoints
- the pointspublic Polyline(List<? extends Point2d> points, boolean copy)
Polyline
from the points, possibly copying the points
firstpoints
- the pointscopy
- should the points be copiedpublic Point2d begin()
Path2d
public Polyline asPolyline()
Path2d
asPolyline
in interface Path2d
public Iterator<Line2d> lineIterator()
Path2d
lineIterator
in interface Path2d
public double calculateLength()
Path2d
calculateLength
in interface Path2d