Class ncsa.horizon.awt.SingleComponentPanel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.awt.SingleComponentPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----ncsa.horizon.awt.SingleComponentPanel

public class SingleComponentPanel
extends Panel
a Panel that maintains a nice border around a single component.

This Panel is a nice container to maintain space between an enclosing Frame and the Component this Panel contains. When the Frame is resized, this Panel will resize its enclosed component to maintain the space.

This Panel is designed to hold only one Component. The Component to be enclosed can either be passed to the constructor or added afterward with the add(Component) method. If there are several components to be laid out, one should wrap them in a regular AWT Panel before enclosing them in this one. If add(Component) is called after a Component has already been added, the previous one is replaced. This Panel automatically sets the up the necessary layout (via initLayout()) upon construction; therefore, one should not call this Panel's setLayout() method. Doing so voids the features of this class and may produce undesired effects. Similarly, one should not call the add(String, Component) or add(Component, int) methods.


Variable Index

 o bgap
 o item
the single component contained in this Panel
 o lgap
 o rgap
 o tgap

Constructor Index

 o SingleComponentPanel()
construct the Panel with the single Component it will enclose to be added later.
 o SingleComponentPanel(Component)
construct the Panel to enclose the single given Component
 o SingleComponentPanel(Component, int, int, int, int)
construct the Panel with a given size border and enclosing a single given Component.
 o SingleComponentPanel(int, int, int, int)
construct the Panel with a given size border.

Method Index

 o add(Component)
 o initLayout()
initialize the Layout.
 o reshape(int, int, int, int)

Variables

 o item
  protected Component item
the single component contained in this Panel
 o tgap
  protected int tgap
 o bgap
  protected int bgap
 o rgap
  protected int rgap
 o lgap
  protected int lgap

Constructors

 o SingleComponentPanel
  public SingleComponentPanel()
construct the Panel with the single Component it will enclose to be added later.
 o SingleComponentPanel
  public SingleComponentPanel(int bottom,
                              int left,
                              int right,
                              int top)
construct the Panel with a given size border. (The single Component it will enclose should be added later.)
 o SingleComponentPanel
  public SingleComponentPanel(Component comp,
                              int bottom,
                              int left,
                              int right,
                              int top)
construct the Panel with a given size border and enclosing a single given Component.
 o SingleComponentPanel
  public SingleComponentPanel(Component comp)
construct the Panel to enclose the single given Component

Methods

 o initLayout
  protected void initLayout()
initialize the Layout. This sets the LayoutManager and its parameters.
 o add
  public Component add(Component comp)
Overrides:
add in class Container
 o reshape
  public void reshape(int x,
                      int y,
                      int width,
                      int height)
Overrides:
reshape in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index