Package com.storedobject.pdf
Class PDFRectangle
java.lang.Object
com.storedobject.pdf.PDFRectangle
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intRepresents bottom side.static intRepresents all sides (as a box).static intRepresents left side.static intRepresents "no border".static intRepresents right side.static intRepresents top side.static intUses to represent an "undefined" value.Fields inherited from interface com.storedobject.pdf.PDFElement
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, TEXT_DIRECTION_DEFAULT, TEXT_DIRECTION_LTR, TEXT_DIRECTION_NO_BIDI, TEXT_DIRECTION_RTL -
Constructor Summary
ConstructorsConstructorDescriptionPDFRectangle(float x2, float y2) Constructor.PDFRectangle(float x1, float y1, float x2, float y2) Constructor.PDFRectangle(float x1, float y1, float x2, float y2, int rotation) Constructor.PDFRectangle(float x2, float y2, int rotation) Constructor.PDFRectangle(PDFRectangle another) Construct from another. -
Method Summary
Modifier and TypeMethodDescriptionGet the background color.intGet the border value.Get the border color.Get the color for the bottom border.Get the color for the left border.Get the color for the right border.Get the color for the top border.floatGet the border thickness.floatGet the thickness of the bottom border.floatGet the thickness of the left border.floatGet the thickness of the right border.floatGet the thickness of the top border.floatGet the bottom value.floatGet the gray fill value.floatGet the height.floatgetLeft()floatgetRight()Get the right value.intGet the rotation value.floatgetTop()Get the top value.floatgetWidth()Get the width.rotate()Create a rotated instance.voidsetBackgroundColor(PDFColor color) Set the background color.voidsetBorder(int borders) Set borders.voidsetBorderColor(PDFColor color) Set the border color.voidsetBorderColorBottom(PDFColor color) Set the color for the bottom border.voidsetBorderColorLeft(PDFColor color) Set the color for the left border.voidsetBorderColorRight(PDFColor color) Set the color for the right border.voidsetBorderColorTop(PDFColor color) Set the color for the top border.voidsetBorderWidth(float thickness) Set the border thickness.voidsetBorderWidthBottom(float thickness) Set the thickness of the bottom border.voidsetBorderWidthLeft(float thickness) Set the thickness of the left border.voidsetBorderWidthRight(float thickness) Set the thickness of the right border.voidsetBorderWidthTop(float thickness) Set the thickness of the top border.voidsetBottom(float value) Set the bottom value.voidsetGrayFill(float fillValue) Set the gray fill value (between 0.0 and 1.0).voidsetLeft(float value) Set the left value.voidsetRight(float value) Set the right value.voidsetRotation(int rotation) Set rotation in degrees.voidsetTop(float value) Set the top value.
-
Field Details
-
UNDEFINED
public static int UNDEFINEDUses to represent an "undefined" value. -
TOP
public static int TOPRepresents top side. -
BOTTOM
public static int BOTTOMRepresents bottom side. -
LEFT
public static int LEFTRepresents left side. -
RIGHT
public static int RIGHTRepresents right side. -
NO_BORDER
public static int NO_BORDERRepresents "no border". -
BOX
public static int BOXRepresents all sides (as a box).
-
-
Constructor Details
-
PDFRectangle
public PDFRectangle(float x1, float y1, float x2, float y2) Constructor.- Parameters:
x1- Coordinate x1 (Lower left).y1- Coordinate y1 (Lower left).x2- Coordinate x2 (Upper right).y2- Coordinate y2 (Upper right).
-
PDFRectangle
public PDFRectangle(float x1, float y1, float x2, float y2, int rotation) Constructor.- Parameters:
x1- Coordinate x1 (Lower left).y1- Coordinate y1 (Lower left).x2- Coordinate x2 (Upper right).y2- Coordinate y2 (Upper right).rotation- Rotation in degrees (multiples fo 90 only).
-
PDFRectangle
public PDFRectangle(float x2, float y2) Constructor. (x1, y1) will be (0, 0).- Parameters:
x2- Coordinate x2 (Upper right).y2- Coordinate y2 (Upper right).
-
PDFRectangle
public PDFRectangle(float x2, float y2, int rotation) Constructor. (x1, y1) will be (0, 0).- Parameters:
x2- Coordinate x2 (Upper right).y2- Coordinate y2 (Upper right).rotation- Rotation in degrees (multiples fo 90 only).
-
PDFRectangle
Construct from another.- Parameters:
another- Another instance.
-
-
Method Details
-
rotate
-
setBorderWidth
public void setBorderWidth(float thickness) Set the border thickness.- Parameters:
thickness- Border thickness.
-
setBorder
-
getWidth
public float getWidth()Get the width.- Returns:
- Width.
-
getHeight
public float getHeight()Get the height.- Returns:
- Height.
-
setGrayFill
public void setGrayFill(float fillValue) Set the gray fill value (between 0.0 and 1.0).- Parameters:
fillValue- Gray fill value.
-
setRotation
public void setRotation(int rotation) Set rotation in degrees.- Parameters:
rotation- Rotation (multiples of 90).
-
setLeft
public void setLeft(float value) Set the left value.- Parameters:
value- Left.
-
getLeft
public float getLeft() -
setRight
public void setRight(float value) Set the right value.- Parameters:
value- Right.
-
getRight
public float getRight()Get the right value.- Returns:
- Right.
-
setTop
public void setTop(float value) Set the top value.- Parameters:
value- Top.
-
getTop
public float getTop()Get the top value.- Returns:
- Top.
-
setBottom
public void setBottom(float value) Set the bottom value.- Parameters:
value- Bottom.
-
getBottom
public float getBottom()Get the bottom value.- Returns:
- Bottom.
-
getRotation
public int getRotation()Get the rotation value.- Returns:
- Rotation.
-
getBackgroundColor
-
setBackgroundColor
-
getGrayFill
public float getGrayFill()Get the gray fill value.- Returns:
- Gray fill.
-
getBorder
public int getBorder()Get the border value.- Returns:
- Border.
-
getBorderWidth
public float getBorderWidth()Get the border thickness.- Returns:
- Border thickness.
-
getBorderWidthLeft
public float getBorderWidthLeft()Get the thickness of the left border.- Returns:
- Border thickness.
-
setBorderWidthLeft
public void setBorderWidthLeft(float thickness) Set the thickness of the left border.- Parameters:
thickness- Thickness.
-
getBorderWidthRight
public float getBorderWidthRight()Get the thickness of the right border.- Returns:
- Border thickness.
-
setBorderWidthRight
public void setBorderWidthRight(float thickness) Set the thickness of the right border.- Parameters:
thickness- Thickness.
-
getBorderWidthTop
public float getBorderWidthTop()Get the thickness of the top border.- Returns:
- Border thickness.
-
setBorderWidthTop
public void setBorderWidthTop(float thickness) Set the thickness of the top border.- Parameters:
thickness- Thickness.
-
getBorderWidthBottom
public float getBorderWidthBottom()Get the thickness of the bottom border.- Returns:
- Border thickness.
-
setBorderWidthBottom
public void setBorderWidthBottom(float thickness) Set the thickness of the bottom border.- Parameters:
thickness- Thickness.
-
getBorderColor
-
setBorderColor
-
getBorderColorLeft
-
setBorderColorLeft
Set the color for the left border.- Parameters:
color- Color.
-
getBorderColorRight
-
setBorderColorRight
Set the color for the right border.- Parameters:
color- Color.
-
getBorderColorTop
-
setBorderColorTop
Set the color for the top border.- Parameters:
color- Color.
-
getBorderColorBottom
-
setBorderColorBottom
Set the color for the bottom border.- Parameters:
color- Color.
-