java.lang.Objectcom.pdfjet.Path
public class Path
Used to create path objects. The path objects may consist of lines, splines or both. Please see Example_02.
Constructor Summary | |
---|---|
Path()
The default constructor. |
Method Summary | |
---|---|
void |
add(Point point)
Adds a point to this path. |
float[] |
drawOn(Page page)
Draws this path on the page using the current selected color, pen width, line pattern and line join style. |
static java.util.List<Point> |
getCurvePoints(float x,
float y,
float r1,
float r2,
int segment)
Returns a list containing the start point, first control point, second control point and the end point of elliptical curve segment. |
int |
getLineCapStyle()
Returns the line cap style for this path. |
int |
getLineJoinStyle()
Returns the line join style. |
void |
placeIn(Box box)
Places this path in the specified box at position (0.0, 0.0). |
void |
placeIn(Box box,
double x_offset,
double y_offset)
Places the path inside the spacified box at coordinates (x_offset, y_offset) of the top left corner. |
void |
placeIn(Box box,
float x_offset,
float y_offset)
Places the path inside the spacified box at coordinates (x_offset, y_offset) of the top left corner. |
void |
scaleBy(double factor)
Scales the path using the specified factor. |
void |
scaleBy(float factor)
Scales the path using the specified factor. |
void |
setClosePath(boolean close_path)
Sets the close_path variable. |
void |
setColor(int color)
Sets the pen color that will be used to draw this path. |
void |
setFillShape(boolean fill_shape)
Sets the fill_shape private variable. |
void |
setLineCapStyle(int style)
Sets the line cap style. |
void |
setLineJoinStyle(int style)
Sets the line join style. |
void |
setPattern(java.lang.String pattern)
Sets the line dash pattern for this path. |
void |
setWidth(double width)
Sets the pen width that will be used to draw the lines and splines that are part of this path. |
void |
setWidth(float width)
Sets the pen width that will be used to draw the lines and splines that are part of this path. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Path()
Method Detail |
---|
public void add(Point point)
point
- the point to add.public void setPattern(java.lang.String pattern)
Examples of line dash patterns: "[Array] Phase" Appearance Description _______________ _________________ ____________________________________ "[] 0" ----------------- Solid line "[3] 0" --- --- --- 3 units on, 3 units off, ... "[2] 1" - -- -- -- -- 1 on, 2 off, 2 on, 2 off, ... "[2 1] 0" -- -- -- -- -- -- 2 on, 1 off, 2 on, 1 off, ... "[3 5] 6" --- --- 2 off, 3 on, 5 off, 3 on, 5 off, ... "[2 3] 11" - -- -- -- 1 on, 3 off, 2 on, 3 off, 2 on, ...
pattern
- the line dash pattern.public void setWidth(double width)
width
- the pen width.public void setWidth(float width)
width
- the pen width.public void setColor(int color)
color
- the color is specified as an integer.public void setClosePath(boolean close_path)
close_path
- if close_path is true a line will be draw between the first and last point of this path.public void setFillShape(boolean fill_shape)
fill_shape
- the fill_shape flag.public void setLineCapStyle(int style)
style
- the cap style of this path. Supported values: Cap.BUTT, Cap.ROUND and Cap.PROJECTING_SQUAREpublic int getLineCapStyle()
public void setLineJoinStyle(int style)
style
- the line join style code. Supported values: Join.MITER, Join.ROUND and Join.BEVELpublic int getLineJoinStyle()
public void placeIn(Box box) throws java.lang.Exception
box
- the specified box.
java.lang.Exception
public void placeIn(Box box, double x_offset, double y_offset) throws java.lang.Exception
box
- the specified box.x_offset
- the x_offset.y_offset
- the y_offset.
java.lang.Exception
public void placeIn(Box box, float x_offset, float y_offset) throws java.lang.Exception
box
- the specified box.x_offset
- the x_offset.y_offset
- the y_offset.
java.lang.Exception
public void scaleBy(double factor) throws java.lang.Exception
factor
- the specified factor.
java.lang.Exception
public void scaleBy(float factor) throws java.lang.Exception
factor
- the specified factor.
java.lang.Exception
public static java.util.List<Point> getCurvePoints(float x, float y, float r1, float r2, int segment) throws java.lang.Exception
x
- the x coordinate of the center of the ellipse.y
- the y coordinate of the center of the ellipse.r1
- the horizontal radius of the ellipse.r2
- the vertical radius of the ellipse.segment
- the segment to draw - please see the Segment class.
java.lang.Exception
public float[] drawOn(Page page) throws java.lang.Exception
drawOn
in interface Drawable
page
- the page to draw this path on.
java.lang.Exception