|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.Rectangle
public class Rectangle
A 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 | |
---|---|
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. |
static int |
BOTTOM
This represents one side of the border of the Rectangle . |
static int |
BOX
This represents a type of border. |
protected Color |
color
The color of the border of this rectangle. |
static int |
LEFT
This represents one side of the border of the Rectangle . |
protected float |
llx
the lower left x-coordinate. |
protected float |
lly
the lower left y-coordinate. |
protected Properties |
markupAttributes
Contains extra markupAttributes |
static int |
NO_BORDER
This represents a rectangle without borders. |
static int |
RIGHT
This represents one side of the border of the Rectangle . |
protected int |
rotation
|
static int |
TOP
This represents one side of the border of the Rectangle . |
static int |
UNDEFINED
This is the value that will be used as undefined . |
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. |
Constructor Summary | |
---|---|
Rectangle(float urx,
float ury)
Constructs a Rectangle -object starting from the origin
(0, 0). |
|
Rectangle(float llx,
float lly,
float urx,
float ury)
Constructs a Rectangle -object. |
|
Rectangle(Rectangle rect)
Constructs a Rectangle -object. |
Method Summary | |
---|---|
Color |
backgroundColor()
Gets the backgroundcolor. |
int |
border()
Returns the exact type of the border. |
Color |
borderColor()
Gets the color of the border. |
float |
borderWidth()
Gets the borderwidth. |
float |
bottom()
Returns the lower left y-coordinate. |
float |
bottom(float margin)
Returns the lower left y-coordinate, considering a given margin. |
void |
cloneNonPositionParameters(Rectangle rect)
Copies all of the parameters from a Rectangle object
except the position. |
void |
disableBorderSide(int side)
Disables the border on the specified side. |
void |
enableBorderSide(int side)
Enables the border on the specified side. |
Color |
getBorderColorBottom()
Gets the color of a border. |
Color |
getBorderColorLeft()
Gets the color of a border. |
Color |
getBorderColorRight()
Gets the color of a border. |
Color |
getBorderColorTop()
Gets the color of a border. |
float |
getBorderWidthBottom()
Gets the width of a border. |
float |
getBorderWidthLeft()
Gets the width of a border. |
float |
getBorderWidthRight()
Gets the width of a border. |
float |
getBorderWidthTop()
Gets the width of a border. |
ArrayList |
getChunks()
Gets all the chunks in this element. |
String |
getMarkupAttribute(String name)
Returns the value of the specified attribute. |
Set |
getMarkupAttributeNames()
Returns a Set of String attribute names for the
MarkupAttributes implementor. |
Properties |
getMarkupAttributes()
Return a Properties -object containing all the markupAttributes. |
int |
getRotation()
Gets the rotation of the rectangle |
float |
grayFill()
Gets the grayscale. |
boolean |
hasBorder(int type)
Indicates if the table has a some type of border. |
boolean |
hasBorders()
Indicates if the table has borders. |
float |
height()
Returns the height of the rectangle. |
boolean |
isUseVariableBorders()
Indicates whether variable width borders are being used. |
float |
left()
Returns the lower left x-coordinate. |
float |
left(float margin)
Returns the lower left x-coordinate, considering a given margin. |
void |
normalize()
Switches lowerleft with upperright |
boolean |
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an
ElementListener . |
Rectangle |
rectangle(float top,
float bottom)
Gets a Rectangle that is altered to fit on the page. |
float |
right()
Returns the upper right x-coordinate. |
float |
right(float margin)
Returns the upper right x-coordinate, considering a given margin. |
Rectangle |
rotate()
Swaps the values of urx and ury and of lly and llx in order to rotate the rectangle. |
void |
setBackgroundColor(Color value)
Sets the backgroundcolor of the rectangle. |
void |
setBorder(int value)
Enables/Disables the border on the specified sides. |
void |
setBorderColor(Color value)
Sets the color of the border. |
void |
setBorderColorBottom(Color value)
Sets the value of the border color |
void |
setBorderColorLeft(Color value)
Sets the value of the border color |
void |
setBorderColorRight(Color value)
Sets the value of the border color |
void |
setBorderColorTop(Color value)
Sets the value of the border color |
void |
setBorderWidth(float value)
Sets the borderwidth of the table. |
void |
setBorderWidthBottom(float borderWidthBottom)
Sets the width of a border |
void |
setBorderWidthLeft(float borderWidthLeft)
Sets the width of a border |
void |
setBorderWidthRight(float borderWidthRight)
Sets the width of a border |
void |
setBorderWidthTop(float borderWidthTop)
Sets the width of a border |
void |
setBottom(float value)
Sets the lower left y-coordinate. |
void |
setGrayFill(float value)
Sets the grayscale of the rectangle. |
void |
setLeft(float value)
Sets the lower left x-coordinate. |
void |
setMarkupAttribute(String name,
String value)
Sets the specified attribute. |
void |
setMarkupAttributes(Properties markupAttributes)
Sets the markupAttributes. |
void |
setRight(float value)
Sets the upper right x-coordinate. |
void |
setTop(float value)
Sets the upper right y-coordinate. |
void |
setUseVariableBorders(boolean useVariableBorders)
Sets a parameter indicating if the rectangle has variable borders |
void |
softCloneNonPositionParameters(Rectangle rect)
Copies all of the parameters from a Rectangle object
except the position. |
float |
top()
Returns the upper right y-coordinate. |
float |
top(float margin)
Returns the upper right y-coordinate, considering a given margin. |
String |
toString()
Gets the content of the text element. |
int |
type()
Gets the type of the text element. |
float |
width()
Returns the width of the rectangle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNDEFINED
public static final int TOP
Rectangle
.
public static final int BOTTOM
Rectangle
.
public static final int LEFT
Rectangle
.
public static final int RIGHT
Rectangle
.
public static final int NO_BORDER
public static final int BOX
protected float llx
protected float lly
protected float urx
protected float ury
protected int border
protected float borderWidth
protected Color color
protected Color borderColorLeft
protected Color borderColorRight
protected Color borderColorTop
protected Color borderColorBottom
protected float borderWidthLeft
protected float borderWidthRight
protected float borderWidthTop
protected float borderWidthBottom
protected boolean useVariableBorders
protected Color background
protected int rotation
protected Properties markupAttributes
Constructor Detail |
---|
public Rectangle(float llx, float lly, float urx, float ury)
Rectangle
-object.
llx
- lower left xlly
- lower left yurx
- upper right xury
- upper right ypublic Rectangle(float urx, float ury)
Rectangle
-object starting from the origin
(0, 0).
urx
- upper right xury
- upper right ypublic Rectangle(Rectangle rect)
Rectangle
-object.
rect
- another Rectangle
Method Detail |
---|
public void cloneNonPositionParameters(Rectangle rect)
Rectangle
object
except the position.
rect
- Rectangle
to copy frompublic void softCloneNonPositionParameters(Rectangle rect)
Rectangle
object
except the position.
rect
- Rectangle
to copy frompublic boolean process(ElementListener listener)
ElementListener
.
process
in interface Element
listener
- an ElementListener
true
if the element was processed successfullypublic int type()
type
in interface Element
public ArrayList getChunks()
getChunks
in interface Element
ArrayList
public void normalize()
public Rectangle rectangle(float top, float bottom)
top
- the top positionbottom
- the bottom position
Rectangle
public Rectangle rotate()
Rectangle
public void setLeft(float value)
value
- the new valuepublic void setRight(float value)
value
- the new valuepublic void setTop(float value)
value
- the new valuepublic void setBottom(float value)
value
- the new valuepublic void setBorder(int value)
LEFT, RIGHT, TOP, BOTTOM
.
value
- the new valueenableBorderSide(int)
,
disableBorderSide(int)
public void enableBorderSide(int side)
side
- the side to enable. One of LEFT, RIGHT, TOP, BOTTOM
public void disableBorderSide(int side)
side
- the side to disable. One of LEFT, RIGHT, TOP, BOTTOM
public void setBorderWidth(float value)
value
- the new valuepublic void setBorderColor(Color value)
value
- the new valuepublic void setBorderColorRight(Color value)
value
- a color valuepublic void setBorderColorLeft(Color value)
value
- a color valuepublic void setBorderColorTop(Color value)
value
- a color valuepublic void setBorderColorBottom(Color value)
value
- a color valuepublic void setBackgroundColor(Color value)
value
- the new valuepublic void setGrayFill(float value)
value
- the new valuepublic float left()
public float right()
public float top()
public float bottom()
public float left(float margin)
margin
- a margin
public float right(float margin)
margin
- a margin
public float top(float margin)
margin
- a margin
public float bottom(float margin)
margin
- a margin
public float width()
public float height()
public boolean hasBorders()
public boolean hasBorder(int type)
type
- the type of border
public int border()
public float borderWidth()
public Color borderColor()
public Color backgroundColor()
public float grayFill()
public int getRotation()
public void setMarkupAttribute(String name, String value)
MarkupAttributes
setMarkupAttribute
in interface MarkupAttributes
name
- String
attribute name.value
- String
attribute value.MarkupAttributes.setMarkupAttribute(java.lang.String,
java.lang.String)
public void setMarkupAttributes(Properties markupAttributes)
MarkupAttributes
setMarkupAttributes
in interface MarkupAttributes
markupAttributes
- a Properties
-object containing markupattributesMarkupAttributes.setMarkupAttributes(java.util.Properties)
public String getMarkupAttribute(String name)
MarkupAttributes
getMarkupAttribute
in interface MarkupAttributes
name
- String
attribute name.
String
.MarkupAttributes.getMarkupAttribute(java.lang.String)
public Set getMarkupAttributeNames()
MarkupAttributes
Set
of String
attribute names for the
MarkupAttributes
implementor.
getMarkupAttributeNames
in interface MarkupAttributes
Set
.MarkupAttributes.getMarkupAttributeNames()
public Properties getMarkupAttributes()
MarkupAttributes
Properties
-object containing all the markupAttributes.
getMarkupAttributes
in interface MarkupAttributes
Properties
MarkupAttributes.getMarkupAttributes()
public Color getBorderColorLeft()
public Color getBorderColorRight()
public Color getBorderColorTop()
public Color getBorderColorBottom()
public float getBorderWidthLeft()
public void setBorderWidthLeft(float borderWidthLeft)
borderWidthLeft
- a widthpublic float getBorderWidthRight()
public void setBorderWidthRight(float borderWidthRight)
borderWidthRight
- a widthpublic float getBorderWidthTop()
public void setBorderWidthTop(float borderWidthTop)
borderWidthTop
- a widthpublic float getBorderWidthBottom()
public void setBorderWidthBottom(float borderWidthBottom)
borderWidthBottom
- a widthpublic boolean isUseVariableBorders()
setBorderWidthLeft, setBorderWidthRight, setBorderWidthTop, or
setBorderWidthBottom
has been called.
public void setUseVariableBorders(boolean useVariableBorders)
useVariableBorders
- indication if the rectangle has variable borderspublic String toString()
Element
toString
in interface Element
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |