All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gjt.Border

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----gjt.Border

public class Border
extends Panel
A panel containing a single component, around which a border is drawn. Of course, the single component may be a container which may contain other components, so a Border can surround multiple components.

Thickness of the border, and the gap between the Component and the border are specified at time of construction. Default border thickness is 2 - default gap is 0.

Border color may be set via setLineColor(Color).

Border employs a DrawnRectangle to paint the border. Derived classes are free to override DrawnRectangle border() if they wish to use an extension of DrawnRectangle for drawing their border.

The following code snippet, from gjt.test.BorderTest creates an AWT Button, and embeds the button in a border. That border is then embedded in another border. The AWT Button winds up inside of a cyan border with a pixel width of 7, inside of a black border (pixel width 2):

      private Border makeBorderedAWTButton() {
          Button button;
          Border cyanBorder, blackBorder;
          button = new Button("Button Inside Two Borders");
          cyanBorder = new Border(button, 7);
          cyanBorder.setLineColor(Color.cyan);
          blackBorder = new Border(cyanBorder);
          return blackBorder;
      }

See Also:
DrawnRectangle, ThreeDBorder, EtchedBorder, BorderTest

Variable Index

 o _defaultGap
 o _defaultThickness
 o border
 o borderMe
 o gap
 o thickness

Constructor Index

 o Border(Component)
 o Border(Component, int)
 o Border(Component, int, int)

Method Index

 o border()
 o getComponent()
 o getInnerBounds()
 o getInsets()
 o getLineColor()
 o insets()
Deprecated.
 o paint(Graphics)
 o paramString()
 o reshape(int, int, int, int)
Deprecated.
 o resize(int, int)
Deprecated.
 o setBounds(int, int, int, int)
 o setLineColor(Color)
 o setSize(int, int)

Variables

 o thickness
 protected int thickness
 o gap
 protected int gap
 o border
 protected DrawnRectangle border
 o borderMe
 protected Component borderMe
 o _defaultThickness
 protected static int _defaultThickness
 o _defaultGap
 protected static int _defaultGap

Constructors

 o Border
 public Border(Component borderMe)
 o Border
 public Border(Component borderMe,
               int thickness)
 o Border
 public Border(Component borderMe,
               int thickness,
               int gap)

Methods

 o getComponent
 public Component getComponent()
 o getInnerBounds
 public Rectangle getInnerBounds()
 o setLineColor
 public void setLineColor(Color c)
 o getLineColor
 public Color getLineColor()
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Container
 o insets
 public Insets insets()
Note: insets() is deprecated. for JDK1.1

Overrides:
insets in class Container
 o getInsets
 public Insets getInsets()
Overrides:
getInsets in class Container
 o resize
 public void resize(int w,
                    int h)
Note: resize() is deprecated. for JDK1.1

Overrides:
resize in class Component
 o setSize
 public void setSize(int w,
                     int h)
Overrides:
setSize in class Component
 o reshape
 public void reshape(int x,
                     int y,
                     int w,
                     int h)
Note: reshape() is deprecated. for JDK1.1

Overrides:
reshape in class Component
 o setBounds
 public void setBounds(int x,
                       int y,
                       int w,
                       int h)
Overrides:
setBounds in class Component
 o paramString
 protected String paramString()
Overrides:
paramString in class Container
 o border
 protected DrawnRectangle border()

All Packages  Class Hierarchy  This Package  Previous  Next  Index