java.lang.Objectcom.pdfjet.Box
public class Box
Used to create rectangular boxes on a page. Also used to for layout purposes. See the placeIn method in the Image and TextLine classes.
Constructor Summary | |
---|---|
Box()
The default constructor. |
|
Box(double x,
double y,
double w,
double h)
Creates a box object. |
|
Box(float x,
float y,
float w,
float h)
Creates a box object. |
Method Summary | |
---|---|
float[] |
drawOn(Page page)
Draws this box on the specified page. |
void |
placeIn(Box box,
double x_offset,
double y_offset)
Places this box in the another box. |
void |
placeIn(Box box,
float x_offset,
float y_offset)
Places this box in the another box. |
void |
scaleBy(double factor)
Scales this box by the spacified factor. |
void |
scaleBy(float factor)
Scales this box by the spacified factor. |
Box |
setActualText(java.lang.String actualText)
Sets the actual text for this box. |
Box |
setAltDescription(java.lang.String altDescription)
Sets the alternate description of this box. |
void |
setColor(int color)
Sets the color for this box. |
void |
setFillShape(boolean fill_shape)
Sets the private fill_shape variable. |
void |
setGoToAction(java.lang.String key)
Sets the destination key for the action. |
void |
setLineWidth(double width)
Sets the width of this line. |
void |
setLineWidth(float width)
Sets the width of this line. |
Box |
setLocation(float x,
float y)
Sets the location of this box on the page. |
void |
setPattern(java.lang.String pattern)
The line dash pattern controls the pattern of dashes and gaps used to stroke paths. |
Box |
setPosition(double x,
double y)
Sets the position of this box on the page. |
Box |
setPosition(float x,
float y)
Sets the position of this box on the page. |
void |
setSize(double w,
double h)
Sets the size of this box. |
void |
setSize(float w,
float h)
Sets the size of this box. |
void |
setURIAction(java.lang.String uri)
Sets the URI for the "click box" action. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Box()
public Box(double x, double y, double w, double h)
x
- the x coordinate of the top left corner of this box when drawn on the page.y
- the y coordinate of the top left corner of this box when drawn on the page.w
- the width of this box.h
- the height of this box.public Box(float x, float y, float w, float h)
x
- the x coordinate of the top left corner of this box when drawn on the page.y
- the y coordinate of the top left corner of this box when drawn on the page.w
- the width of this box.h
- the height of this box.Method Detail |
---|
public Box setPosition(double x, double y)
x
- the x coordinate of the top left corner of this box when drawn on the page.y
- the y coordinate of the top left corner of this box when drawn on the page.public Box setPosition(float x, float y)
x
- the x coordinate of the top left corner of this box when drawn on the page.y
- the y coordinate of the top left corner of this box when drawn on the page.public Box setLocation(float x, float y)
x
- the x coordinate of the top left corner of this box when drawn on the page.y
- the y coordinate of the top left corner of this box when drawn on the page.public void setSize(double w, double h)
w
- the width of this box.h
- the height of this box.public void setSize(float w, float h)
w
- the width of this box.h
- the height of this box.public void setColor(int color)
color
- the color specified as an integer.public void setLineWidth(double width)
width
- the width.public void setLineWidth(float width)
width
- the width.public void setURIAction(java.lang.String uri)
uri
- the URIpublic void setGoToAction(java.lang.String key)
key
- the destination name.public Box setAltDescription(java.lang.String altDescription)
altDescription
- the alternate description of the box.
public Box setActualText(java.lang.String actualText)
actualText
- the actual text for the box.
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 setFillShape(boolean fill_shape)
fill_shape
- the value used to set the private fill_shape variable.public void placeIn(Box box, double x_offset, double y_offset) throws java.lang.Exception
box
- the other 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 void placeIn(Box box, float x_offset, float y_offset) throws java.lang.Exception
box
- the other 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 void scaleBy(double factor) throws java.lang.Exception
factor
- the factor used to scale the box.
java.lang.Exception
public void scaleBy(float factor) throws java.lang.Exception
factor
- the factor used to scale the box.
java.lang.Exception
public float[] drawOn(Page page) throws java.lang.Exception
drawOn
in interface Drawable
page
- the page to draw this box on.
java.lang.Exception