Class CellBorder

java.lang.Object
javax.swing.border.AbstractBorder
org.opensourcephysics.display.CellBorder
All Implemented Interfaces:
Serializable, Border

public class CellBorder extends AbstractBorder
A class which implements a line border on only the top and left hand side.
Author:
Wolfgang Christian
See Also:
  • Field Details

    • thickness

      protected int thickness
    • lineColor

      protected Color lineColor
  • Constructor Details

    • CellBorder

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

      public CellBorder(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
  • 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)
      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
    • getLineColor

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

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