Package hec.gfx2d

Class G2dBorder

All Implemented Interfaces:
Serializable, Border

public class G2dBorder extends AbstractBorder
See Also:
  • Field Details

    • thickness

      protected int thickness
    • lineColor

      protected Color lineColor
    • roundedCorners

      protected boolean roundedCorners
    • borderStyle

      protected float[] borderStyle
  • Constructor Details

    • G2dBorder

      public G2dBorder(Color color)
      Creates a line border with the specified color and a thickness = 1.
      Parameters:
      color - the color for the border
    • G2dBorder

      public G2dBorder(Color color, int thickness)
      Creates a line border with the specified color and thickness.
      Parameters:
      color - the color of the border
      thickness - the thickness of the border
    • G2dBorder

      @ConstructorProperties({"lineColor","thickness","borderStyle"}) public G2dBorder(Color color, int thickness, float[] borderStyle)
      Creates a line border with the specified color, thickness, and corner shape.
      Parameters:
      color - the color of the border
      thickness - the thickness of the border
      Since:
      1.3
  • Method Details

    • paintBorder

      public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
      Paints the border for the specified component with the specified position and size.
      Specified by:
      paintBorder in interface Border
      Overrides:
      paintBorder in class AbstractBorder
      Parameters:
      c - the component for which this border is being painted
      g - the paint graphics
      x - the x position of the painted border
      y - the y position of the painted border
      width - the width of the painted border
      height - the height of the painted border
    • getBorderInsets

      public Insets getBorderInsets(Component c, Insets insets)
      Reinitialize the insets parameter with this Border's current Insets.
      Overrides:
      getBorderInsets in class AbstractBorder
      Parameters:
      c - the component for which this border insets value applies
      insets - the object to be reinitialized
    • getLineColor

      public Color getLineColor()
      Returns the color of the border.
    • getThickness

      public int getThickness()
      Returns the thickness of the border.
    • getRoundedCorners

      public boolean getRoundedCorners()
      Returns whether this border will be drawn with rounded corners.
      Since:
      1.3
    • isBorderOpaque

      public boolean isBorderOpaque()
      Returns whether or not the border is opaque.
      Specified by:
      isBorderOpaque in interface Border
      Overrides:
      isBorderOpaque in class AbstractBorder
    • getBorderStyle

      public float[] getBorderStyle()
    • setBorderStyle

      public void setBorderStyle(float[] borderStyle)