Class ThinBorder

All Implemented Interfaces:
Serializable, Border

public class ThinBorder extends AbstractBorder
A class which implements three different kinds of borders:
- The raised bevel border,
- The lowered bevel border,
- The line border.
Author:
Christopher Mindus
See Also:
  • Field Details

  • Constructor Details

    • ThinBorder

      public ThinBorder(int borderType)
      Creates a bevel border with the specified type. Depending on the type, the correct top and bottom colors will be used.
      Parameters:
      borderType - the type of bevel for the border.
  • Method Details

    • setHorzMargin

      public void setHorzMargin(int margin)
      Sets the horizontal margin.
    • 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)
      Returns the insets of the border.
      Specified by:
      getBorderInsets in interface Border
      Overrides:
      getBorderInsets in class AbstractBorder
      Parameters:
      c - the component for which this border insets value applies
    • 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.