public class Path extends Object
| Constructor and Description |
|---|
Path() |
Path(List<? extends Subpath> subpaths) |
Path(Path path) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSubpath(Subpath subpath)
Adds the subpath to this path.
|
void |
addSubpaths(List<? extends Subpath> subpaths)
Adds the subpaths to this path.
|
void |
closeAllSubpaths()
Closes all subpathes contained in this path.
|
void |
closeSubpath()
Closes the current subpath.
|
void |
curveFromTo(float x1,
float y1,
float x3,
float y3)
Appends a cubic Bezier curve to the current path.
|
void |
curveTo(float x2,
float y2,
float x3,
float y3)
Appends a cubic Bezier curve to the current path.
|
void |
curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Appends a cubic Bezier curve to the current path.
|
Point |
getCurrentPoint()
The current point is the trailing endpoint of the segment most recently added to the current path.
|
List<Subpath> |
getSubpaths() |
boolean |
isEmpty()
Path is empty if it contains no subpaths.
|
void |
lineTo(float x,
float y)
Appends a straight line segment from the current point to the point
(x, y). |
void |
moveTo(float x,
float y)
Begins a new subpath by moving the current point to coordinates
(x, y). |
void |
rectangle(float x,
float y,
float w,
float h)
Appends a rectangle to the current path as a complete subpath.
|
void |
rectangle(Rectangle rect)
Appends a rectangle to the current path as a complete subpath.
|
List<Integer> |
replaceCloseWithLine()
Adds additional line to each closed subpath and makes the subpath unclosed.
|
public Path()
public Path(Path path)
public void addSubpath(Subpath subpath)
subpath - The subpath to be added to this path.public void addSubpaths(List<? extends Subpath> subpaths)
subpaths - List of subpaths to be added to this path.public Point getCurrentPoint()
public void moveTo(float x,
float y)
(x, y).x - x-coordinate of the new pointy - y-coordinate of the new pointpublic void lineTo(float x,
float y)
(x, y).x - x-coordinate of the new pointy - y-coordinate of the new pointpublic void curveTo(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
(x3, y3).x1 - x-coordinate of the first control pointy1 - y-coordinate of the first control pointx2 - x-coordinate of the second control pointy2 - y-coordinate of the second control pointx3 - x-coordinate of the third control pointy3 - y-coordinate of the third control pointpublic void curveTo(float x2,
float y2,
float x3,
float y3)
(x3, y3) using the current point and
(x2, y2) as intermediate control points. Note that current point is both
used as the starting point and a control pointx2 - x-coordinate of the second intermediate control pointy2 - y-coordinate of the second intermediate control pointx3 - x-coordinate of the ending pointy3 - y-coordinate of the ending pointpublic void curveFromTo(float x1,
float y1,
float x3,
float y3)
(x3, y3) using (x1, y1) and
(x3, y3) as control points. Note that (x3, y3) is used both
as both a control point and an ending pointx1 - x-coordinate of the first intermediate control pointy1 - y-coordinate of the first intermediate control pointx3 - x-coordinate of the second intermediate control point (and ending point)y3 - y-coordinate of the second intermediate control point (and ending point)public void rectangle(Rectangle rect)
rect - the rectangle to append to the current pathpublic void rectangle(float x,
float y,
float w,
float h)
x - lower left x-coordinate of the rectangley - lower left y-coordinate of the rectanglew - width of the rectangleh - height of the rectanglepublic void closeSubpath()
public void closeAllSubpaths()
public List<Integer> replaceCloseWithLine()
public boolean isEmpty()
true in case the path is empty and false otherwiseCopyright © 1998–2021 iText Group NV. All rights reserved.