java.lang.Objectcom.pdfjet.Line
public class Line
Used to create line objects. Please see Example_01.
Constructor Summary | |
---|---|
Line()
The default constructor. |
|
Line(double x1,
double y1,
double x2,
double y2)
Create a line object. |
|
Line(float x1,
float y1,
float x2,
float y2)
Create a line object. |
Method Summary | |
---|---|
float[] |
drawOn(Page page)
Draws this line on the specified page. |
int |
getCapStyle()
Returns the line cap style. |
Point |
getEndPoint()
Returns the end point of this line. |
Point |
getStartPoint()
Returns the start point of this line. |
Line |
placeIn(Box box)
Places this line in the specified box at position (0.0f, 0.0f). |
Line |
placeIn(Box box,
double x_offset,
double y_offset)
Places this line in the specified box. |
Line |
placeIn(Box box,
float x_offset,
float y_offset)
Places this line in the specified box. |
Line |
scaleBy(double factor)
Scales this line by the spacified factor. |
Line |
scaleBy(float factor)
Scales this line by the spacified factor. |
Line |
setActualText(java.lang.String actualText)
Sets the actual text for this line. |
Line |
setAltDescription(java.lang.String altDescription)
Sets the alternate description of this line. |
Line |
setCapStyle(int style)
Sets the line cap style. |
Line |
setColor(int color)
Sets the color for this line. |
Line |
setEndPoint(double x,
double y)
Sets the x and y coordinates of the end point. |
Line |
setEndPoint(float x,
float y)
Sets the x and y coordinates of the end point. |
Line |
setPattern(java.lang.String pattern)
The line dash pattern controls the pattern of dashes and gaps used to stroke paths. |
Line |
setPointA(float x,
float y)
Sets the x and y coordinates of the start point. |
Line |
setPointB(float x,
float y)
Sets the x and y coordinates of the end point. |
Line |
setStartPoint(double x,
double y)
Sets the x and y coordinates of the start point. |
Line |
setStartPoint(float x,
float y)
Sets the x and y coordinates of the start point. |
Line |
setWidth(double width)
Sets the width of this line. |
Line |
setWidth(float width)
Sets the width of this line. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Line()
public Line(double x1, double y1, double x2, double y2)
x1
- the x coordinate of the start point.y1
- the y coordinate of the start point.x2
- the x coordinate of the end point.y2
- the y coordinate of the end point.public Line(float x1, float y1, float x2, float y2)
x1
- the x coordinate of the start point.y1
- the y coordinate of the start point.x2
- the x coordinate of the end point.y2
- the y coordinate of the end point.Method Detail |
---|
public Line 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 Line setStartPoint(double x, double y)
x
- the x coordinate of the start point.y
- the y coordinate of the start point.
public Line setStartPoint(float x, float y)
x
- the x coordinate of the start point.y
- the y coordinate of the start point.
public Line setPointA(float x, float y)
x
- the x coordinate of the start point.y
- the y coordinate of the start point.
public Point getStartPoint()
public Line setEndPoint(double x, double y)
x
- the x coordinate of the end point.y
- the y coordinate of the end point.
public Line setEndPoint(float x, float y)
x
- the x coordinate of the end point.y
- the t coordinate of the end point.
public Line setPointB(float x, float y)
x
- the x coordinate of the end point.y
- the t coordinate of the end point.
public Point getEndPoint()
public Line setWidth(double width)
width
- the width.
public Line setWidth(float width)
width
- the width.
public Line setColor(int color)
color
- the color specified as an integer.
public Line setCapStyle(int style)
style
- the cap style of the current line. Supported values: Cap.BUTT, Cap.ROUND and Cap.PROJECTING_SQUARE
public int getCapStyle()
public Line setAltDescription(java.lang.String altDescription)
altDescription
- the alternate description of the line.
public Line setActualText(java.lang.String actualText)
actualText
- the actual text for the line.
public Line placeIn(Box box) throws java.lang.Exception
box
- the specified box.
java.lang.Exception
public Line placeIn(Box box, double x_offset, double y_offset) throws java.lang.Exception
box
- the specified box.x_offset
- the x offset from the top left corner of the box.y_offset
- the y offset from the top left corner of the box.
java.lang.Exception
public Line placeIn(Box box, float x_offset, float y_offset) throws java.lang.Exception
box
- the specified box.x_offset
- the x offset from the top left corner of the box.y_offset
- the y offset from the top left corner of the box.
java.lang.Exception
public Line scaleBy(double factor) throws java.lang.Exception
factor
- the factor used to scale the line.
java.lang.Exception
public Line scaleBy(float factor) throws java.lang.Exception
factor
- the factor used to scale the line.
java.lang.Exception
public float[] drawOn(Page page) throws java.lang.Exception
drawOn
in interface Drawable
page
- the page to draw this line on.
java.lang.Exception