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 all of the parameters from a Rectangle object except the position.
voiddisableBorderSide(int side)
Disables the border on the specified side.
voidenableBorderSide(int side)
Enables the border on the specified side.
voidnormalize()
Switches lowerleft with upperright
voidsetBackgroundColor(Color value)
Sets the backgroundcolor of the rectangle.
voidsetBorder(int value)
Enables/Disables the border on the specified sides.
voidsetBorderColor(Color value)
Sets the color of the border.
voidsetBorderColorBottom(Color value)
Sets the value of the border color
voidsetBorderColorLeft(Color value)
Sets the value of the border color
voidsetBorderColorRight(Color value)
Sets the value of the border color
voidsetBorderColorTop(Color value)
Sets the value of the border color
voidsetBorderWidth(float value)
Sets the borderwidth of the table.
voidsetBorderWidthBottom(float borderWidthBottom)
Sets the width of a border
voidsetBorderWidthLeft(float borderWidthLeft)
Sets the width of a border
voidsetBorderWidthRight(float borderWidthRight)
Sets the width of a border
voidsetBorderWidthTop(float borderWidthTop)
Sets the width of a border
voidsetBottom(float value)
Sets the lower left y-coordinate.
voidsetGrayFill(float value)
Sets the grayscale of the rectangle.
voidsetLeft(float value)
Sets the lower left x-coordinate.
voidsetRight(float value)
Sets the upper right x-coordinate.
voidsetTop(float value)
Sets the upper right y-coordinate.
voidsetUseVariableBorders(boolean useVariableBorders)
Sets a parameter indicating if the rectangle has variable borders
voidsoftCloneNonPositionParameters(Rectangle rect)
Copies all of the parameters from a Rectangle object except the position.
voidthrowReadOnlyError()
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 all of the parameters from a Rectangle object except the position.

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()
Switches lowerleft with upperright

setBackgroundColor

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

Parameters: value the new value

setBorder

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: RectangleReadOnly RectangleReadOnly

setBorderColor

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

Parameters: value the new value

setBorderColorBottom

public void setBorderColorBottom(Color value)
Sets the value of the border color

Parameters: value a color value

setBorderColorLeft

public void setBorderColorLeft(Color value)
Sets the value of the border color

Parameters: value a color value

setBorderColorRight

public void setBorderColorRight(Color value)
Sets the value of the border color

Parameters: value a color value

setBorderColorTop

public void setBorderColorTop(Color value)
Sets the value of the border color

Parameters: value a color value

setBorderWidth

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

Parameters: value the new value

setBorderWidthBottom

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

Parameters: borderWidthBottom a width

setBorderWidthLeft

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

Parameters: borderWidthLeft a width

setBorderWidthRight

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

Parameters: borderWidthRight a width

setBorderWidthTop

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

Parameters: borderWidthTop a width

setBottom

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

Parameters: value 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 value)
Sets the lower left x-coordinate.

Parameters: value the new value

setRight

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

Parameters: value the new value

setTop

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

Parameters: value 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 all of the parameters from a Rectangle object except the position.

Parameters: rect Rectangle to copy from

throwReadOnlyError

private void throwReadOnlyError()

toString

public String toString()

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