Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class ncsa.horizon.awt.SingleComponentLayout

java.lang.Object
  |
  +--ncsa.horizon.awt.SingleComponentLayout

public class SingleComponentLayout
extends java.lang.Object
implements java.awt.LayoutManager
a LayoutManager that maintains a border around a single component.

This LayoutManager is a is sometimes useful for laying out a single component within a Frame maintaining a specifiable amount of space between the single component and the enclosing Frame. When the Frame is resized, the enclosed component will resize such that the space is maintained.

This LayoutManager is designed to layout only one Component. By default, the component that is laid out will be the last one that was added to the container. If there is a chance that several the container's add() methods might get called more than once, one can call the setComponent() method to indicate which one is the desired component. The constructors that take a component as an argument calls the setComponent() method automatically. One should note that all components that are not to be laid out will be automatically removed from the container at layout time.


Field Summary
int bgap
           
int lgap
           
int rgap
           
int tgap
           
 
Constructor Summary
SingleComponentLayout()
          construct the LayoutManager to manage a single Component.
SingleComponentLayout(int bottom, int left, int right, int top)
          construct the LayoutManager to manage a single Component using a given size border.
 
Method Summary
void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
void layoutContainer(java.awt.Container parent)
           
java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
           
java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
           
void removeLayoutComponent(java.awt.Component comp)
           
void setComponent(java.awt.Component comp)
          Deprecated. tell the LayoutManager which component should be layed out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

tgap

protected int tgap

bgap

protected int bgap

rgap

protected int rgap

lgap

protected int lgap
Constructor Detail

SingleComponentLayout

public SingleComponentLayout()
construct the LayoutManager to manage a single Component. If this constructor is used, the setComponent() method should also be called.

SingleComponentLayout

public SingleComponentLayout(int bottom,
                             int left,
                             int right,
                             int top)
construct the LayoutManager to manage a single Component using a given size border. If this constructor is used, the setComponent() method should also be called.
Method Detail

setComponent

public void setComponent(java.awt.Component comp)
Deprecated. components should be added to container directly
tell the LayoutManager which component should be layed out. This need only be called if there is a chance that more than one component was added to the container before it is laid out. This method would specify which component is the desired one; otherwise, the last component to be added is assumed to be the desired one. Note that all other components will be removed from the container when it is laid out.

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Description copied from interface:
 
Specified by:
removeLayoutComponent(java.awt.Component) in interface java.awt.LayoutManager

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Description copied from interface:
 
Specified by:
addLayoutComponent(java.lang.String, java.awt.Component) in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Description copied from interface:
 
Specified by:
minimumLayoutSize(java.awt.Container) in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Description copied from interface:
 
Specified by:
preferredLayoutSize(java.awt.Container) in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container parent)
Description copied from interface:
 
Specified by:
layoutContainer(java.awt.Container) in interface java.awt.LayoutManager

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD