Package com.dynamicpdf.api.elements
Class RectangleElement
java.lang.Object
com.dynamicpdf.api.elements.Element
com.dynamicpdf.api.elements.RectangleElement
Represents a rectangle page element.
This class can be used to place rectangles of any size or color on a page.
-
Constructor Summary
ConstructorDescriptionRectangleElement(ElementPlacement placement, float width, float height)
Initializes a new instance of theRectangleElement
class. -
Method Summary
Modifier and TypeMethodDescriptionGets theColor
object to use for the border of the rectangle.Gets theLineStyle
object used to specify the border style of the rectangle.float
Gets the border width of the rectangle.float
Gets the corner radius of the rectangle.Gets theColor
object to use for the fill of the rectangle.float
Gets the height of the rectangle.float
getWidth()
Gets the width of the rectangle.void
setBorderColor(Color value)
Sets theColor
object to use for the border of the rectangle.void
setBorderStyle(LineStyle value)
Sets theLineStyle
object used to specify the border style of the rectangle.void
setBorderWidth(float value)
Sets the border width of the rectangle.void
setCornerRadius(float value)
Sets the corner radius of the rectangle.void
setFillColor(Color value)
Sets theColor
object to use for the fill of the rectangle.void
setHeight(float value)
Sets the height of the rectangle.void
setWidth(float value)
Sets the width of the rectangle.Methods inherited from class com.dynamicpdf.api.elements.Element
getEvenPages, getOddPages, getPlacement, getResource, getTextFont, getXOffset, getYOffset, setEvenPages, setOddPages, setPlacement, setXOffset, setYOffset
-
Constructor Details
-
RectangleElement
Initializes a new instance of theRectangleElement
class.- Parameters:
placement
- The placement of the rectangle on the page.width
- Width of the rectangle.height
- Height of the rectangle.
-
-
Method Details
-
getWidth
public float getWidth()Gets the width of the rectangle.- Returns:
- The width of the rectangle.
-
setWidth
public void setWidth(float value)Sets the width of the rectangle.- Parameters:
value
- The width of the rectangle.
-
getHeight
public float getHeight()Gets the height of the rectangle.- Returns:
- The height of the rectangle.
-
setHeight
public void setHeight(float value)Sets the height of the rectangle.- Parameters:
value
- The height of the rectangle.
-
getBorderWidth
public float getBorderWidth()Gets the border width of the rectangle.To force the borders not to appear set the border width to any value 0 or less.
- Returns:
- The border width of the rectangle.
-
setBorderWidth
public void setBorderWidth(float value)Sets the border width of the rectangle.To force the borders not to appear set the border width to any value 0 or less.
- Parameters:
value
- The border width of the rectangle.
-
getCornerRadius
public float getCornerRadius()Gets the corner radius of the rectangle.- Returns:
- The corner radius of the rectangle.
-
setCornerRadius
public void setCornerRadius(float value)Sets the corner radius of the rectangle.- Parameters:
value
- The corner radius of the rectangle.
-
getFillColor
Gets theColor
object to use for the fill of the rectangle.To force no color to appear in the rectangle (only borders) set the fill color to null (Nothing in Visual Basic).
- Returns:
- The
Color
object to use for the fill of the rectangle.
-
setFillColor
Sets theColor
object to use for the fill of the rectangle.To force no color to appear in the rectangle (only borders) set the fill color to null (Nothing in Visual Basic).
- Parameters:
value
- TheColor
object to use for the fill of the rectangle.
-
getBorderColor
Gets theColor
object to use for the border of the rectangle.- Returns:
- The
Color
object to use for the border of the rectangle.
-
setBorderColor
Sets theColor
object to use for the border of the rectangle.- Parameters:
value
- TheColor
object to use for the border of the rectangle.
-
getBorderStyle
Gets theLineStyle
object used to specify the border style of the rectangle.- Returns:
- The
LineStyle
object used to specify the border style of the rectangle.
-
setBorderStyle
Sets theLineStyle
object used to specify the border style of the rectangle.- Parameters:
value
- TheLineStyle
object used to specify the border style of the rectangle.
-