edu.mit.csail.sdg.alloy4
Class OurBorder

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4.OurBorder
All Implemented Interfaces:
javax.swing.border.Border

public final class OurBorder
extends java.lang.Object
implements javax.swing.border.Border

Graphical border on zero, one, two, three, or all four sides of a component.

Thread Safety: Can be called only by the AWT event thread.


Constructor Summary
OurBorder(boolean top, boolean left, boolean bottom, boolean right)
          Construct a Border object that draws a light gray line on 0, 1, 2, 3, or all 4 sides of the component.
OurBorder(java.awt.Color top, java.awt.Color left, java.awt.Color bottom, java.awt.Color right)
          Construct a Border object that draws a border on 0, 1, 2, 3, or all 4 sides of the component.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
          This method is called by Swing to retrieve the dimension of the border.
 boolean isBorderOpaque()
          This method is called by Swing to find out whether this border object needs to fill in its own background.
 void paintBorder(java.awt.Component component, java.awt.Graphics graphics, int x, int y, int width, int height)
          This method is called by Swing to actually draw the borders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OurBorder

public OurBorder(java.awt.Color top,
                 java.awt.Color left,
                 java.awt.Color bottom,
                 java.awt.Color right)
Construct a Border object that draws a border on 0, 1, 2, 3, or all 4 sides of the component. Note: it paints the borders top, bottom, left, then right.

Parameters:
top - - nonnull if we want to draw a border line (with that color) above the component
left - - nonnull if we want to draw a border line (with that color) to the left of the component
bottom - - nonnull if we want to draw a border line (with that color) below the component
right - - nonnull if we want to draw a border line (with that color) to the right of the component

OurBorder

public OurBorder(boolean top,
                 boolean left,
                 boolean bottom,
                 boolean right)
Construct a Border object that draws a light gray line on 0, 1, 2, 3, or all 4 sides of the component. Note: it paints the borders top, bottom, left, then right.

Parameters:
top - - true if we want to draw a Color.LIGHT_GRAY border line above the component
left - - true if we want to draw a Color.LIGHT_GRAY border line to the left of the component
bottom - - true if we want to draw a Color.LIGHT_GRAY border line below the component
right - - true if we want to draw a Color.LIGHT_GRAY border line to the right of the component
Method Detail

paintBorder

public void paintBorder(java.awt.Component component,
                        java.awt.Graphics graphics,
                        int x,
                        int y,
                        int width,
                        int height)
This method is called by Swing to actually draw the borders.

Specified by:
paintBorder in interface javax.swing.border.Border

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
This method is called by Swing to retrieve the dimension of the border.

Specified by:
getBorderInsets in interface javax.swing.border.Border

isBorderOpaque

public boolean isBorderOpaque()
This method is called by Swing to find out whether this border object needs to fill in its own background.

Specified by:
isBorderOpaque in interface javax.swing.border.Border