Class SimpleEtchedBorder

All Implemented Interfaces:
Border, ColorConstants

public final class SimpleEtchedBorder extends SchemeBorder
Provides a two pixel wide constant sized border, having an etched look.
  • Field Details

    • singleton

      public static final Border singleton
      The singleton instance of this class
    • INSETS

      protected static final Insets INSETS
      The insets
  • Constructor Details

    • SimpleEtchedBorder

      protected SimpleEtchedBorder()
      Constructs a default border having a two pixel wide border.
      Since:
      2.0
  • Method Details

    • getInsets

      public Insets getInsets(IFigure figure)
      Returns the Insets used by this border. This is a constant value of two pixels in each direction.
      Specified by:
      getInsets in interface Border
      Overrides:
      getInsets in class SchemeBorder
      Parameters:
      figure - The figure this border belongs to
      Returns:
      The insets
      See Also:
    • isOpaque

      public boolean isOpaque()
      Returns the opaque state of this border. This border is opaque and takes responsibility to fill the region it encloses.
      Specified by:
      isOpaque in interface Border
      Overrides:
      isOpaque in class SchemeBorder
      Returns:
      true if this border is opaque
      See Also:
    • paint

      public void paint(IFigure figure, Graphics g, Insets insets)
      Description copied from interface: Border
      Paints the border. The border should paint inside figure's IFigure.getBounds(), inset by the parameter insets. The border generally should not paint inside its own insets. More specifically, Border b should paint inside the rectangle: figure.getBounds().getCropped(insets) and outside of the rectangle: figure.getBounds().getCropped(insets).getCropped(getInsets()) where inside is defined as Rectangle.contains(int, int).
      Specified by:
      paint in interface Border
      Overrides:
      paint in class SchemeBorder
      Parameters:
      figure - The figure this border belongs to
      g - The graphics object used for painting
      insets - The insets
      See Also: