com.lowagie.text

Class RectangleReadOnly

public class RectangleReadOnly extends Rectangle

A RectangleReadOnly is the representation of a geometric figure. It's the same as a Rectangle but immutable. Rectangles support constant width borders using RectangleReadOnlyand RectangleReadOnly. They also support borders that vary in width/color on each side using methods like RectangleReadOnlyor setBorderColorLeft.

Since: 2.1.2

See Also: Element Table Cell HeaderFooter

Constructor Summary
RectangleReadOnly(float llx, float lly, float urx, float ury)
Constructs a RectangleReadOnly -object.
RectangleReadOnly(float urx, float ury)
Constructs a RectangleReadOnly -object starting from the origin (0, 0).
RectangleReadOnly(Rectangle rect)
Constructs a RectangleReadOnly -object.
Method Summary
voidcloneNonPositionParameters(Rectangle rect)
Copies each of the parameters, except the position, from a Rectangle object
voiddisableBorderSide(int side)
Disables the border on the specified side.
voidenableBorderSide(int side)
Enables the border on the specified side.
voidnormalize()
Normalizes the rectangle.
voidsetBackgroundColor(Color value)
Sets the backgroundcolor of the rectangle.
voidsetBorder(int border)
Enables/Disables the border on the specified sides.
voidsetBorderColor(Color borderColor)
Sets the color of the border.
voidsetBorderColorBottom(Color borderColorBottom)
Sets the color of the bottom border.
voidsetBorderColorLeft(Color borderColorLeft)
Sets the color of the left border.
voidsetBorderColorRight(Color borderColorRight)
Sets the color of the right border
voidsetBorderColorTop(Color borderColorTop)
Sets the color of the top border.
voidsetBorderWidth(float borderWidth)
Sets the borderwidth of the table.
voidsetBorderWidthBottom(float borderWidthBottom)
Sets the width of the bottom border
voidsetBorderWidthLeft(float borderWidthLeft)
Sets the width of the left border
voidsetBorderWidthRight(float borderWidthRight)
Sets the width of the right border
voidsetBorderWidthTop(float borderWidthTop)
Sets the width of the top border
voidsetBottom(float lly)
Sets the lower left y-coordinate.
voidsetGrayFill(float value)
Sets the grayscale of the rectangle.
voidsetLeft(float llx)
Sets the lower left x-coordinate.
voidsetRight(float urx)
Sets the upper right x-coordinate.
voidsetTop(float ury)
Sets the upper right y-coordinate.
voidsetUseVariableBorders(boolean useVariableBorders)
Sets a parameter indicating if the rectangle has variable borders
voidsoftCloneNonPositionParameters(Rectangle rect)
Copies each of the parameters, except the position, from a Rectangle object if the value is set there.
voidthrowReadOnlyError()
Throws an error because of the read only nature of this object.
StringtoString()

Constructor Detail

RectangleReadOnly

public RectangleReadOnly(float llx, float lly, float urx, float ury)
Constructs a RectangleReadOnly -object.

Parameters: llx lower left x lly lower left y urx upper right x ury upper right y

RectangleReadOnly

public RectangleReadOnly(float urx, float ury)
Constructs a RectangleReadOnly -object starting from the origin (0, 0).

Parameters: urx upper right x ury upper right y

RectangleReadOnly

public RectangleReadOnly(Rectangle rect)
Constructs a RectangleReadOnly -object.

Parameters: rect another Rectangle

Method Detail

cloneNonPositionParameters

public void cloneNonPositionParameters(Rectangle rect)
Copies each of the parameters, except the position, from a Rectangle object

Parameters: rect Rectangle to copy from

disableBorderSide

public void disableBorderSide(int side)
Disables the border on the specified side.

Parameters: side the side to disable. One of LEFT, RIGHT, TOP, BOTTOM

enableBorderSide

public void enableBorderSide(int side)
Enables the border on the specified side.

Parameters: side the side to enable. One of LEFT, RIGHT, TOP, BOTTOM

normalize

public void normalize()
Normalizes the rectangle. Switches lower left with upper right if necessary.

setBackgroundColor

public void setBackgroundColor(Color value)
Sets the backgroundcolor of the rectangle.

Parameters: value the new value

setBorder

public void setBorder(int border)
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: border the new value

See Also: RectangleReadOnly RectangleReadOnly

setBorderColor

public void setBorderColor(Color borderColor)
Sets the color of the border.

Parameters: borderColor a Color

setBorderColorBottom

public void setBorderColorBottom(Color borderColorBottom)
Sets the color of the bottom border.

Parameters: borderColorBottom a Color

setBorderColorLeft

public void setBorderColorLeft(Color borderColorLeft)
Sets the color of the left border.

Parameters: borderColorLeft a Color

setBorderColorRight

public void setBorderColorRight(Color borderColorRight)
Sets the color of the right border

Parameters: borderColorRight a Color

setBorderColorTop

public void setBorderColorTop(Color borderColorTop)
Sets the color of the top border.

Parameters: borderColorTop a Color

setBorderWidth

public void setBorderWidth(float borderWidth)
Sets the borderwidth of the table.

Parameters: borderWidth the new value

setBorderWidthBottom

public void setBorderWidthBottom(float borderWidthBottom)
Sets the width of the bottom border

Parameters: borderWidthBottom a width

setBorderWidthLeft

public void setBorderWidthLeft(float borderWidthLeft)
Sets the width of the left border

Parameters: borderWidthLeft a width

setBorderWidthRight

public void setBorderWidthRight(float borderWidthRight)
Sets the width of the right border

Parameters: borderWidthRight a width

setBorderWidthTop

public void setBorderWidthTop(float borderWidthTop)
Sets the width of the top border

Parameters: borderWidthTop a width

setBottom

public void setBottom(float lly)
Sets the lower left y-coordinate.

Parameters: lly the new value

setGrayFill

public void setGrayFill(float value)
Sets the grayscale of the rectangle.

Parameters: value the new value

setLeft

public void setLeft(float llx)
Sets the lower left x-coordinate.

Parameters: llx the new value

setRight

public void setRight(float urx)
Sets the upper right x-coordinate.

Parameters: urx the new value

setTop

public void setTop(float ury)
Sets the upper right y-coordinate.

Parameters: ury the new value

setUseVariableBorders

public void setUseVariableBorders(boolean useVariableBorders)
Sets a parameter indicating if the rectangle has variable borders

Parameters: useVariableBorders indication if the rectangle has variable borders

softCloneNonPositionParameters

public void softCloneNonPositionParameters(Rectangle rect)
Copies each of the parameters, except the position, from a Rectangle object if the value is set there.

Parameters: rect Rectangle to copy from

throwReadOnlyError

private void throwReadOnlyError()
Throws an error because of the read only nature of this object.

toString

public String toString()

Returns: String version of the most important rectangle properties

See Also: java.lang.Object#toString()