Class RectangleElement

java.lang.Object
com.dynamicpdf.api.elements.Element
com.dynamicpdf.api.elements.RectangleElement

public class RectangleElement extends Element
Represents a rectangle page element.

This class can be used to place rectangles of any size or color on a page.

  • Constructor Details

    • RectangleElement

      public RectangleElement(ElementPlacement placement, float width, float height)
      Initializes a new instance of the RectangleElement 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

      public Color getFillColor()
      Gets the Colorobject 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 Colorobject to use for the fill of the rectangle.
    • setFillColor

      public void setFillColor(Color value)
      Sets the Colorobject 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 - The Colorobject to use for the fill of the rectangle.
    • getBorderColor

      public Color getBorderColor()
      Gets the Colorobject to use for the border of the rectangle.
      Returns:
      The Colorobject to use for the border of the rectangle.
    • setBorderColor

      public void setBorderColor(Color value)
      Sets the Colorobject to use for the border of the rectangle.
      Parameters:
      value - The Colorobject to use for the border of the rectangle.
    • getBorderStyle

      public LineStyle getBorderStyle()
      Gets the LineStyle object used to specify the border style of the rectangle.
      Returns:
      The LineStyle object used to specify the border style of the rectangle.
    • setBorderStyle

      public void setBorderStyle(LineStyle value)
      Sets the LineStyle object used to specify the border style of the rectangle.
      Parameters:
      value - The LineStyle object used to specify the border style of the rectangle.