All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.util.JCTitleLayout

java.lang.Object
   |
   +----jclass.util.JCTitleLayout

public class JCTitleLayout
extends Object
implements LayoutManager
JCTitleLayout is a layout class that allows the developer to add titles to a central item (like JCTable). It is similar to BorderLayout, but it allows specification of offsets for each title.


Variable Index

 o BOTTOM
 o CENTER
 o LEFT
 o NOVALUE
Sets an offset to this value to indicate that it is not set.
 o RIGHT
 o TOP

Constructor Index

 o JCTitleLayout()
A simple constructor.

Method Index

 o add(String, String)
Creates a Label and adds it to the JCTitleLayout at the specified location.
 o addLayoutComponent(String, Component)
Adds the component to the JCTitleLayout as the specified location.
 o layoutContainer(Container)
This performs the layout calculation.
 o minimumLayoutSize(Container)
Returns the minimum size required by the JCTitleLayout.
 o preferredLayoutSize(Container)
Returns the preferred size for the JCTitleLayout.
 o remove(String)
Removes the component at the specified location.
 o removeLayoutComponent(Component)
Removes the component if it is present.
 o setOffsets(String, Insets)
Sets the offsets for a specified location.

Variables

 o TOP
 public static final int TOP
 o LEFT
 public static final int LEFT
 o RIGHT
 public static final int RIGHT
 o BOTTOM
 public static final int BOTTOM
 o CENTER
 public static final int CENTER
 o NOVALUE
 public static final int NOVALUE
Sets an offset to this value to indicate that it is not set.

Constructors

 o JCTitleLayout
 public JCTitleLayout()
A simple constructor. It calls reset() to set up the component and offset arrays. Initially, all of the offsets are set to NOVALUE, which causes the left, top, right and bottom areas to appear centered.

Methods

 o addLayoutComponent
 public void addLayoutComponent(String location,
                                Component comp)
Adds the component to the JCTitleLayout as the specified location. It always replaces an existing component. This method is part of the LayoutManager interface.

Parameters:
location - "Top", "Bottom", "Left", "Right" or "Center"
comp - component to add to JCTitleLayout
 o add
 public void add(String location,
                 String text)
Creates a Label and adds it to the JCTitleLayout at the specified location. It always replaces an existing component.

Parameters:
location - either "Top", "Bottom", "Left" or "Right"
text - the text added to the title.
 o remove
 public void remove(String location)
Removes the component at the specified location.

Parameters:
location - either "Top", "Bottom", "Left" or "Right"
 o removeLayoutComponent
 public void removeLayoutComponent(Component comp)
Removes the component if it is present. This method is part of the LayoutManager interface.

Parameters:
comp - the component to remove.
 o minimumLayoutSize
 public Dimension minimumLayoutSize(Container target)
Returns the minimum size required by the JCTitleLayout. This method is part of the LayoutManager interface

Parameters:
target - the parent container
Returns:
the preferred size for this layout
 o preferredLayoutSize
 public Dimension preferredLayoutSize(Container target)
Returns the preferred size for the JCTitleLayout. This method is part of the LayoutManager interface.

Parameters:
target - the parent container.
Returns:
the preferred size for this layout.
 o setOffsets
 public void setOffsets(String location,
                        Insets offsets)
Sets the offsets for a specified location.

Parameters:
location - either "Top", "Bottom", "Left" or "Right"
offsets - the distances from the container edge and the center component; if an offset is not to be set, set its value to NO_VALUE
See Also:
Insets
 o layoutContainer
 public void layoutContainer(Container target)
This performs the layout calculation. The item in the CENTER area gets the space that it needs, and the other components receive that rest. This method is part of the LayoutManager interface.

Parameters:
target - the parent container

All Packages  Class Hierarchy  This Package  Previous  Next  Index