![]() | |
Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.lowagie.text.Rectangle
Rectangle
is the representation of a geometric figure.
Rectangles support constant width borders using
setBorderWidth(float)
and setBorder(int)
. They also
support borders that vary in width/color on each side using methods like
setBorderWidthLeft(float)
or
setBorderColorLeft(java.awt.Color)
.
Element
, Table
, Cell
, HeaderFooter
Field Summary | |
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
protected Color |
|
protected int |
|
protected Color |
|
protected Color |
|
protected Color |
|
protected Color |
|
protected float |
|
protected float |
|
protected float |
|
protected float |
|
protected float |
|
protected Color |
|
protected float |
|
protected float |
|
protected Properties |
|
protected int | |
protected float |
|
protected float |
|
protected boolean |
|
Fields inherited from interface com.lowagie.text.Element | |
ALIGN_BASELINE , ALIGN_BOTTOM , ALIGN_CENTER , ALIGN_JUSTIFIED , ALIGN_JUSTIFIED_ALL , ALIGN_LEFT , ALIGN_MIDDLE , ALIGN_RIGHT , ALIGN_TOP , ALIGN_UNDEFINED , ANCHOR , ANNOTATION , AUTHOR , CCITTG3_1D , CCITTG3_2D , CCITTG4 , CCITT_BLACKIS1 , CCITT_ENCODEDBYTEALIGN , CCITT_ENDOFBLOCK , CCITT_ENDOFLINE , CELL , CHAPTER , CHUNK , CREATIONDATE , CREATOR , HEADER , IMGRAW , IMGTEMPLATE , JPEG , KEYWORDS , LIST , LISTITEM , MARKED , MULTI_COLUMN_TEXT , PARAGRAPH , PHRASE , PRODUCER , PTABLE , RECTANGLE , ROW , SECTION , SUBJECT , TABLE , TITLE |
Constructor Summary | |
| |
|
Method Summary | |
Color |
|
int |
|
Color |
|
float |
|
float |
|
float |
|
void |
|
void |
|
void |
|
Color |
|
Color |
|
Color |
|
Color |
|
float |
|
float |
|
float |
|
float |
|
ArrayList |
|
int |
|
private float |
|
float |
|
boolean |
|
boolean |
|
float |
|
boolean |
|
float |
|
float |
|
void |
|
boolean |
|
Rectangle |
|
float |
|
float |
|
Rectangle |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
float |
|
float |
|
int |
|
private void |
|
float |
|
public static final int BOTTOM
This represents one side of the border of theRectangle
.
- Field Value:
- 2
public static final int BOX
This represents a type of border.
- Field Value:
- 15
public static final int LEFT
This represents one side of the border of theRectangle
.
- Field Value:
- 4
public static final int NO_BORDER
This represents a rectangle without borders.
- Field Value:
- 0
public static final int RIGHT
This represents one side of the border of theRectangle
.
- Field Value:
- 8
public static final int TOP
This represents one side of the border of theRectangle
.
- Field Value:
- 1
public static final int UNDEFINED
This is the value that will be used as undefined .
- Field Value:
- -1
protected Color background
This is the color of the background of this rectangle.
protected int border
This represents the status of the 4 sides of the rectangle.
protected Color borderColorBottom
The color of the bottom border of this rectangle.
protected Color borderColorLeft
The color of the left border of this rectangle.
protected Color borderColorRight
The color of the right border of this rectangle.
protected Color borderColorTop
The color of the top border of this rectangle.
protected float borderWidth
This is the width of the border around this rectangle.
protected float borderWidthBottom
The width of the bottom border of this rectangle.
protected float borderWidthLeft
The width of the left border of this rectangle.
protected float borderWidthRight
The width of the right border of this rectangle.
protected float borderWidthTop
The width of the top border of this rectangle.
protected Color color
The color of the border of this rectangle.
protected float llx
the lower left x-coordinate.
protected float lly
the lower left y-coordinate.
protected Properties markupAttributes
Contains extra markupAttributes
protected int rotation
protected float urx
the upper right x-coordinate.
protected float ury
the upper right y-coordinate.
protected boolean useVariableBorders
Whether variable width borders are used.
public Rectangle(Rectangle rect)
Constructs aRectangle
-object.
- Parameters:
rect
- anotherRectangle
public Rectangle(float urx, float ury)
Constructs aRectangle
-object starting from the origin (0, 0).
- Parameters:
urx
- upper right xury
- upper right y
public Rectangle(float llx, float lly, float urx, float ury)
Constructs aRectangle
-object.
- Parameters:
llx
- lower left xlly
- lower left yurx
- upper right xury
- upper right y
public Color backgroundColor()
Gets the backgroundcolor.
- Returns:
- a value
public int border()
Returns the exact type of the border.
- Returns:
- a value
public Color borderColor()
Gets the color of the border.
- Returns:
- a value
public float borderWidth()
Gets the borderwidth.
- Returns:
- a value
public float bottom()
Returns the lower left y-coordinate.
- Returns:
- the lower left y-coordinate
public float bottom(float margin)
Returns the lower left y-coordinate, considering a given margin.
- Parameters:
margin
- a margin
- Returns:
- the lower left y-coordinate
public void cloneNonPositionParameters(Rectangle rect)
Copies all of the parameters from aRectangle
object except the position.
- Parameters:
rect
-Rectangle
to copy from
public void disableBorderSide(int side)
Disables the border on the specified side.
- Parameters:
side
- the side to disable. One ofLEFT, RIGHT, TOP, BOTTOM
public void enableBorderSide(int side)
Enables the border on the specified side.
- Parameters:
side
- the side to enable. One ofLEFT, RIGHT, TOP, BOTTOM
public Color getBorderColorBottom()
Gets the color of a border.
- Returns:
- a color value
public Color getBorderColorLeft()
Gets the color of a border.
- Returns:
- a color value
public Color getBorderColorRight()
Gets the color of a border.
- Returns:
- a color value
public Color getBorderColorTop()
Gets the color of a border.
- Returns:
- a color value
public float getBorderWidthBottom()
Gets the width of a border.
- Returns:
- a width
public float getBorderWidthLeft()
Gets the width of a border.
- Returns:
- a width
public float getBorderWidthRight()
Gets the width of a border.
- Returns:
- a width
public float getBorderWidthTop()
Gets the width of a border.
- Returns:
- a width
public ArrayList getChunks()
Gets all the chunks in this element.
- Returns:
- an
ArrayList
public int getRotation()
Gets the rotation of the rectangle
- Returns:
- a rotation value
private float getVariableBorderWidth(float variableWidthValue, int side)
public float grayFill()
Gets the grayscale.
- Returns:
- a value
public boolean hasBorder(int type)
Indicates if the table has a some type of border.
- Parameters:
type
- the type of border
- Returns:
- a boolean
public boolean hasBorders()
Indicates if the table has borders.
- Returns:
- a boolean
public float height()
Returns the height of the rectangle.
- Returns:
- a height
public boolean isUseVariableBorders()
Indicates whether variable width borders are being used. Returns true ifsetBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, or setBorderWidthBottom
has been called.
- Returns:
- true if variable width borders are in use
public float left()
Returns the lower left x-coordinate.
- Returns:
- the lower left x-coordinate
public float left(float margin)
Returns the lower left x-coordinate, considering a given margin.
- Parameters:
margin
- a margin
- Returns:
- the lower left x-coordinate
public void normalize()
Switches lowerleft with upperright
public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener
.
- Parameters:
listener
- anElementListener
- Returns:
true
if the element was processed successfully
public Rectangle rectangle(float top, float bottom)
Gets a Rectangle that is altered to fit on the page.
- Parameters:
top
- the top positionbottom
- the bottom position
- Returns:
- a
Rectangle
public float right()
Returns the upper right x-coordinate.
- Returns:
- the upper right x-coordinate
public float right(float margin)
Returns the upper right x-coordinate, considering a given margin.
- Parameters:
margin
- a margin
- Returns:
- the upper right x-coordinate
public Rectangle rotate()
Swaps the values of urx and ury and of lly and llx in order to rotate the rectangle.
- Returns:
- a
Rectangle
public void setBackgroundColor(Color value)
Sets the backgroundcolor of the rectangle.
- Parameters:
value
- the new value
public void setBorder(int value)
Enables/Disables the border on the specified sides. The border is specified as an integer bitwise combination of the constants:LEFT, RIGHT, TOP, BOTTOM
.
- Parameters:
value
- the new value
- See Also:
enableBorderSide(int)
,disableBorderSide(int)
public void setBorderColor(Color value)
Sets the color of the border.
- Parameters:
value
- the new value
public void setBorderColorBottom(Color value)
Sets the value of the border color
- Parameters:
value
- a color value
public void setBorderColorLeft(Color value)
Sets the value of the border color
- Parameters:
value
- a color value
public void setBorderColorRight(Color value)
Sets the value of the border color
- Parameters:
value
- a color value
public void setBorderColorTop(Color value)
Sets the value of the border color
- Parameters:
value
- a color value
public void setBorderWidth(float value)
Sets the borderwidth of the table.
- Parameters:
value
- the new value
public void setBorderWidthBottom(float borderWidthBottom)
Sets the width of a border
- Parameters:
borderWidthBottom
- a width
public void setBorderWidthLeft(float borderWidthLeft)
Sets the width of a border
- Parameters:
borderWidthLeft
- a width
public void setBorderWidthRight(float borderWidthRight)
Sets the width of a border
- Parameters:
borderWidthRight
- a width
public void setBorderWidthTop(float borderWidthTop)
Sets the width of a border
- Parameters:
borderWidthTop
- a width
public void setBottom(float value)
Sets the lower left y-coordinate.
- Parameters:
value
- the new value
public void setGrayFill(float value)
Sets the grayscale of the rectangle.
- Parameters:
value
- the new value
public void setLeft(float value)
Sets the lower left x-coordinate.
- Parameters:
value
- the new value
public void setRight(float value)
Sets the upper right x-coordinate.
- Parameters:
value
- the new value
public void setTop(float value)
Sets the upper right y-coordinate.
- Parameters:
value
- the new value
public void setUseVariableBorders(boolean useVariableBorders)
Sets a parameter indicating if the rectangle has variable borders
- Parameters:
useVariableBorders
- indication if the rectangle has variable borders
public void softCloneNonPositionParameters(Rectangle rect)
Copies all of the parameters from aRectangle
object except the position.
- Parameters:
rect
-Rectangle
to copy from
public String toString()
- See Also:
java.lang.Object.toString()
public float top()
Returns the upper right y-coordinate.
- Returns:
- the upper right y-coordinate
public float top(float margin)
Returns the upper right y-coordinate, considering a given margin.
- Parameters:
margin
- a margin
- Returns:
- the upper right y-coordinate
public int type()
Gets the type of the text element.
- Returns:
- a type
private void updateBorderBasedOnWidth(float width, int side)
Updates the border flag for a side based on the specified width. A width of 0 will disable the border on that side. Any other width enables it.
- Parameters:
width
- width of borderside
- border side constant
public float width()
Returns the width of the rectangle.
- Returns:
- a width