com.lowagie.text
Class RectangleReadOnly

java.lang.Object
  extended by com.lowagie.text.Rectangle
      extended by com.lowagie.text.RectangleReadOnly
All Implemented Interfaces:
Element

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 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).

Since:
2.1.2
See Also:
Element, Table, Cell, HeaderFooter

Field Summary
 
Fields inherited from class com.lowagie.text.Rectangle
backgroundColor, border, borderColor, borderColorBottom, borderColorLeft, borderColorRight, borderColorTop, borderWidth, borderWidthBottom, borderWidthLeft, borderWidthRight, borderWidthTop, BOTTOM, BOX, LEFT, llx, lly, NO_BORDER, RIGHT, rotation, TOP, UNDEFINED, urx, ury, useVariableBorders
 
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, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, HEADER, IMGRAW, IMGTEMPLATE, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
 
Constructor Summary
RectangleReadOnly(float urx, float ury)
          Constructs a RectangleReadOnly -object starting from the origin (0, 0).
RectangleReadOnly(float llx, float lly, float urx, float ury)
          Constructs a RectangleReadOnly -object.
RectangleReadOnly(Rectangle rect)
          Constructs a RectangleReadOnly -object.
 
Method Summary
 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.
 void normalize()
          Switches lowerleft with upperright
 void setBackgroundColor(java.awt.Color value)
          Sets the backgroundcolor of the rectangle.
 void setBorder(int value)
          Enables/Disables the border on the specified sides.
 void setBorderColor(java.awt.Color value)
          Sets the color of the border.
 void setBorderColorBottom(java.awt.Color value)
          Sets the value of the border color
 void setBorderColorLeft(java.awt.Color value)
          Sets the value of the border color
 void setBorderColorRight(java.awt.Color value)
          Sets the value of the border color
 void setBorderColorTop(java.awt.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 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.
private  void throwReadOnlyError()
           
 java.lang.String toString()
          Gets the content of the text element.
 
Methods inherited from class com.lowagie.text.Rectangle
getBackgroundColor, getBorder, getBorderColor, getBorderColorBottom, getBorderColorLeft, getBorderColorRight, getBorderColorTop, getBorderWidth, getBorderWidthBottom, getBorderWidthLeft, getBorderWidthRight, getBorderWidthTop, getBottom, getBottom, getChunks, getGrayFill, getHeight, getLeft, getLeft, getRight, getRight, getRotation, getTop, getTop, getWidth, hasBorder, hasBorders, isContent, isNestable, isUseVariableBorders, process, rectangle, rotate, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

throwReadOnlyError

private void throwReadOnlyError()

setLeft

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

Overrides:
setLeft in class Rectangle
Parameters:
value - the new value

setRight

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

Overrides:
setRight in class Rectangle
Parameters:
value - the new value

setTop

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

Overrides:
setTop in class Rectangle
Parameters:
value - the new value

setBottom

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

Overrides:
setBottom in class Rectangle
Parameters:
value - the new value

normalize

public void normalize()
Switches lowerleft with upperright

Overrides:
normalize in class Rectangle

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.

Overrides:
setBorder in class Rectangle
Parameters:
value - the new value
See Also:
enableBorderSide(int), disableBorderSide(int)

enableBorderSide

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

Overrides:
enableBorderSide in class Rectangle
Parameters:
side - the side to enable. One of LEFT, RIGHT, TOP, BOTTOM

disableBorderSide

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

Overrides:
disableBorderSide in class Rectangle
Parameters:
side - the side to disable. One of LEFT, RIGHT, TOP, BOTTOM

setBorderWidth

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

Overrides:
setBorderWidth in class Rectangle
Parameters:
value - the new value

setBorderColor

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

Overrides:
setBorderColor in class Rectangle
Parameters:
value - the new value

setBackgroundColor

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

Overrides:
setBackgroundColor in class Rectangle
Parameters:
value - the new value

setGrayFill

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

Overrides:
setGrayFill in class Rectangle
Parameters:
value - the new value

setUseVariableBorders

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

Overrides:
setUseVariableBorders in class Rectangle
Parameters:
useVariableBorders - indication if the rectangle has variable borders

setBorderWidthLeft

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

Overrides:
setBorderWidthLeft in class Rectangle
Parameters:
borderWidthLeft - a width

setBorderWidthRight

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

Overrides:
setBorderWidthRight in class Rectangle
Parameters:
borderWidthRight - a width

setBorderWidthTop

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

Overrides:
setBorderWidthTop in class Rectangle
Parameters:
borderWidthTop - a width

setBorderWidthBottom

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

Overrides:
setBorderWidthBottom in class Rectangle
Parameters:
borderWidthBottom - a width

setBorderColorLeft

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

Overrides:
setBorderColorLeft in class Rectangle
Parameters:
value - a color value

setBorderColorRight

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

Overrides:
setBorderColorRight in class Rectangle
Parameters:
value - a color value

setBorderColorTop

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

Overrides:
setBorderColorTop in class Rectangle
Parameters:
value - a color value

setBorderColorBottom

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

Overrides:
setBorderColorBottom in class Rectangle
Parameters:
value - a color value

cloneNonPositionParameters

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

Overrides:
cloneNonPositionParameters in class Rectangle
Parameters:
rect - Rectangle to copy from

softCloneNonPositionParameters

public void softCloneNonPositionParameters(Rectangle rect)
Copies all of the parameters from a Rectangle object except the position.

Overrides:
softCloneNonPositionParameters in class Rectangle
Parameters:
rect - Rectangle to copy from

toString

public java.lang.String toString()
Description copied from interface: Element
Gets the content of the text element.

Specified by:
toString in interface Element
Overrides:
toString in class Rectangle
Returns:
a type
See Also:
Object.toString()

Hosted by Hostbasket