public class PDFPath
extends java.lang.Object
PDFPath
represents a path object used in Foxit SDK.
It can be constructed by the following ways.
Example:
PDFPath path = PDFPath.create(); PDFPath path = Ink.getInkList();
Ink
Modifier and Type | Class and Description |
---|---|
static class |
PDFPath.PDFPoint
PDFPoint is an inner class defined for a PDF point object. |
Modifier and Type | Method and Description |
---|---|
void |
addPointsCount(int count)
Add a number of points to the given
PDFPath object. |
void |
appendEllipse(RectF rect)
Add an ellipse figure to path data.
|
void |
appendRect(RectF rect)
Add a rectangle figure to path data.
|
void |
clear()
Clear all points of the given
PDFPath object. |
boolean |
closeFigure()
Close the last figure of path data.
|
int |
countPoints()
Get number of points of the given
PDFPath object. |
static PDFPath |
create()
Create a new
PDFPath object. |
void |
cubicBezierTo(java.awt.geom.Point2D.Float point1,
java.awt.geom.Point2D.Float point2,
java.awt.geom.Point2D.Float point3)
Add Bezier points to a given path data.
|
long |
getHandle()
Get the handle of
PDFPath object. |
PDFPath.PDFPoint |
getPoint(int index)
Get a specific point of the given path data.
|
void |
lineTo(java.awt.geom.Point2D.Float point)
Add a point to a given figure, and a line is to be drawn from the current
position to this point, which then becomes a new current position.
|
void |
moveTo(java.awt.geom.Point2D.Float point)
Add a point to start a figure.
|
void |
release()
Release all related resources of the given
PDFPath object. |
boolean |
removePoint(int index)
Remove the specific point of the given path data.
|
boolean |
setPoint(int index,
PDFPath.PDFPoint point)
Set the specific point of the path data.
|
void |
transform(Matrix matrix)
Transform all path points into path data with a given matrix.
|
public long getHandle()
PDFPath
object.PDFPath
object.public static PDFPath create() throws PDFException
PDFPath
object.PDFPath
object that receives an object of path data.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void clear() throws PDFException
PDFPath
object.
This function will free all memory allocated for the given path data.
Applications can call the function
to increase memory.addPointsCount(int)
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void release() throws PDFException
PDFPath
object.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int countPoints() throws PDFException
PDFPath
object.PDFPath
object.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void addPointsCount(int count) throws PDFException
PDFPath
object.
This function will reallocate more memory for the given number of points.
Call the function
to free memory of all points.
clear()
After call this function, you shall call the function
to set the points you add.setPoint(int, PDFPoint)
count
- Count of new points added to the given path data. It should
not be negative.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public PDFPath.PDFPoint getPoint(int index) throws PDFException
index
- The index of the point.PDFPoint
object that receives the value of the path point. index
is out of range,
it will return null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFPath.PDFPoint
public boolean setPoint(int index, PDFPath.PDFPoint point) throws PDFException
index
- The index of the point.point
- A PDFPoint
object that contains the value and
type of the path point.true
if set successfully, else return
false
for the parameter index
is out of range.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
PDFPath.PDFPoint
public boolean removePoint(int index) throws PDFException
index
- The index of the given point.true
if removed successfully, else return
false
for not found the specified point.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void moveTo(java.awt.geom.Point2D.Float point) throws PDFException
point
- The value of the point.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Point2D
public void lineTo(java.awt.geom.Point2D.Float point) throws PDFException
point
- The value of the point.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void cubicBezierTo(java.awt.geom.Point2D.Float point1, java.awt.geom.Point2D.Float point2, java.awt.geom.Point2D.Float point3) throws PDFException
point1
- The value of the first control point.point2
- The value of the second control point.point3
- The value of the end point.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void appendRect(RectF rect) throws PDFException
rect
- A RectF
object for a rectangle.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void appendEllipse(RectF rect) throws PDFException
rect
- A RectF
object for a enclosing rectangle of an ellipse.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean closeFigure() throws PDFException
true
if closed the figure successfully, else return
false
for there is no points in the path.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void transform(Matrix matrix) throws PDFException
matrix
- A Matrix
object for a coordinate matrix.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException