com.lowagie.text
public class Rectangle extends Object implements Element
Rectangle
is the representation of a geometric figure.
Rectangles support constant width borders using
Rectangleand Rectangle.
They also support borders that vary in width/color on each side using
methods like Rectangleor
setBorderColorLeft.
See Also: Element Table Cell HeaderFooter
Field Summary | |
---|---|
protected Color | backgroundColor 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 | borderColor The color of the border of this 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 float | llx the lower left x-coordinate. |
protected float | lly the lower left y-coordinate. |
static int | LEFT This represents one side of the border of the Rectangle . |
static int | NO_BORDER This represents a rectangle without borders. |
protected int | rotation The rotation of the Rectangle |
static int | RIGHT This represents one side of the border of the Rectangle . |
static int | TOP This represents one side of the border of the Rectangle . |
protected float | urx the upper right x-coordinate. |
protected float | ury the upper right y-coordinate. |
protected boolean | useVariableBorders Whether variable width/color borders are used. |
static int | UNDEFINED This is the value that will be used as undefined . |
Constructor Summary | |
---|---|
Rectangle(float llx, float lly, float urx, float ury)
Constructs a Rectangle -object.
| |
Rectangle(float urx, float ury)
Constructs a Rectangle -object starting from the origin
(0, 0).
| |
Rectangle(Rectangle rect)
Constructs a Rectangle -object.
|
Method Summary | |
---|---|
void | cloneNonPositionParameters(Rectangle rect)
Copies each of the parameters, except the position, from a
Rectangle object
|
void | disableBorderSide(int side)
Disables the border on the specified side.
|
void | enableBorderSide(int side)
Enables the border on the specified side.
|
Color | getBackgroundColor()
Gets the backgroundcolor.
|
int | getBorder()
Returns the exact type of the border.
|
Color | getBorderColor()
Gets the color of the border.
|
Color | getBorderColorBottom()
Gets the color of the bottom border.
|
Color | getBorderColorLeft()
Gets the color of the left border.
|
Color | getBorderColorRight()
Gets the color of the right border.
|
Color | getBorderColorTop()
Gets the color of the top border.
|
float | getBorderWidth()
Gets the borderwidth.
|
float | getBorderWidthBottom()
Gets the width of the bottom border.
|
float | getBorderWidthLeft()
Gets the width of the left border.
|
float | getBorderWidthRight()
Gets the width of the right border.
|
float | getBorderWidthTop()
Gets the width of the top border.
|
float | getBottom()
Returns the lower left y-coordinate.
|
float | getBottom(float margin)
Returns the lower left y-coordinate, considering a given margin.
|
ArrayList | getChunks()
Gets all the chunks in this element.
|
float | getGrayFill()
Gets the grayscale.
|
float | getHeight()
Returns the height of the rectangle.
|
float | getLeft()
Returns the lower left x-coordinate.
|
float | getLeft(float margin)
Returns the lower left x-coordinate, considering a given margin.
|
float | getRight()
Returns the upper right x-coordinate.
|
float | getRight(float margin)
Returns the upper right x-coordinate, considering a given margin.
|
int | getRotation()
Gets the rotation of the rectangle
|
float | getTop()
Returns the upper right y-coordinate.
|
float | getTop(float margin)
Returns the upper right y-coordinate, considering a given margin.
|
float | getVariableBorderWidth(float variableWidthValue, int side)
Helper function returning the border width of a specific side.
|
float | getWidth()
Returns the width of the rectangle.
|
boolean | hasBorder(int type)
Indicates whether the specified type of border is set.
|
boolean | hasBorders()
Indicates whether some type of border is set.
|
boolean | isContent() |
boolean | isNestable() |
boolean | isUseVariableBorders()
Indicates whether variable width borders are being used.
|
void | normalize()
Normalizes the rectangle.
|
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.
|
Rectangle | rotate()
Rotates the rectangle.
|
void | setBackgroundColor(Color backgroundColor)
Sets the backgroundcolor of the rectangle.
|
void | setBorder(int border)
Enables/Disables the border on the specified sides.
|
void | setBorderColor(Color borderColor)
Sets the color of the border.
|
void | setBorderColorBottom(Color borderColorBottom)
Sets the color of the bottom border.
|
void | setBorderColorLeft(Color borderColorLeft)
Sets the color of the left border.
|
void | setBorderColorRight(Color borderColorRight)
Sets the color of the right border.
|
void | setBorderColorTop(Color borderColorTop)
Sets the color of the top border.
|
void | setBorderWidth(float borderWidth)
Sets the borderwidth of the table.
|
void | setBorderWidthBottom(float borderWidthBottom)
Sets the width of the bottom border.
|
void | setBorderWidthLeft(float borderWidthLeft)
Sets the width of the left border.
|
void | setBorderWidthRight(float borderWidthRight)
Sets the width of the right border.
|
void | setBorderWidthTop(float borderWidthTop)
Sets the width of the top border.
|
void | setBottom(float lly)
Sets the lower left y-coordinate.
|
void | setGrayFill(float value)
Sets the the background color to a grayscale value.
|
void | setLeft(float llx)
Sets the lower left x-coordinate.
|
void | setRight(float urx)
Sets the upper right x-coordinate.
|
void | setTop(float ury)
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 each of the parameters, except the position, from a
Rectangle object if the value is set there
|
String | toString() |
int | type()
Gets the type of the text element.
|
void | updateBorderBasedOnWidth(float width, int side)
Helper function updating the border flag for a side
based on the specified width.
|
Rectangle
.Rectangle
.Rectangle
.Rectangle
.Rectangle
-object.
Parameters: llx lower left x lly lower left y urx upper right x ury upper right y
Rectangle
-object starting from the origin
(0, 0).
Parameters: urx upper right x ury upper right y
Rectangle
-object.
Parameters: rect another Rectangle
Rectangle
object
Parameters: rect Rectangle
to copy from
Parameters: side the side to disable.
One of LEFT, RIGHT, TOP, BOTTOM
Parameters: side the side to enable.
One of LEFT, RIGHT, TOP, BOTTOM
Returns: a Color
Returns: a value
Returns: a Color
Returns: a Color
Returns: a Color
Returns: a Color
Returns: a Color
Returns: a value
Returns: a width
Returns: a width
Returns: a width
Returns: a width
Returns: the lower left y-coordinate
Parameters: margin a margin
Returns: the lower left y-coordinate
Returns: an ArrayList
Returns: the grayscale color of the background or 0 if the background has no grayscale color.
Returns: the height
Returns: the lower left x-coordinate
Parameters: margin a margin
Returns: the lower left x-coordinate
Returns: the upper right x-coordinate
Parameters: margin a margin
Returns: the upper right x-coordinate
Returns: a rotation value
Returns: the upper right y-coordinate
Parameters: margin a margin
Returns: the upper right y-coordinate
Parameters: variableWidthValue a variable width (could be undefined) side the border you want to check
Returns: the variableWidthValue if not undefined, otherwise the borderWidth
Returns: the width
Parameters: type the type of border
Returns: a boolean
Returns: a boolean
Since: iText 2.0.8
See Also: isContent
Since: iText 2.0.8
See Also: isNestable
setBorderWidthLeft, setBorderWidthRight,
setBorderWidthTop, or setBorderWidthBottom
has been called.
Returns: true if variable width borders are in use
ElementListener
.
Parameters: listener an ElementListener
Returns: true
if the element was processed successfully
Parameters: top the top position bottom the bottom position
Returns: a Rectangle
Returns: the rotated Rectangle
Parameters: backgroundColor a Color
LEFT, RIGHT, TOP, BOTTOM
.
Parameters: border the new value
Parameters: borderColor a Color
Parameters: borderColorBottom a Color
Parameters: borderColorLeft a Color
Parameters: borderColorRight a Color
Parameters: borderColorTop a Color
Parameters: borderWidth the new value
Parameters: borderWidthBottom a width
Parameters: borderWidthLeft a width
Parameters: borderWidthRight a width
Parameters: borderWidthTop a width
Parameters: lly the new value
Parameters: value the new grayscale value
Parameters: llx the new value
Parameters: urx the new value
Parameters: ury the new value
Parameters: useVariableBorders indication if the rectangle has variable borders
Rectangle
object if the value is set there
Parameters: rect Rectangle
to copy from
Returns: a String representation of the rectangle
See Also: java.lang.Object#toString()
Returns: a type
Parameters: width width of border side border side constant