    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.

##

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

##

JCTitleLayout()
  A simple constructor.

##

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

##

TOP

      public final static int TOP

LEFT

      public final static int LEFT

RIGHT

      public final static int RIGHT

BOTTOM

      public final static int BOTTOM

CENTER

      public final static int CENTER

NOVALUE

      public final static int NOVALUE

  Sets an offset to this value to indicate that it is not set.

##

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.

##

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

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.

remove

      public void remove(String location)

  Removes the component at the specified location.

  Parameters:
    location - either "Top", "Bottom", "Left" or "Right"

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.

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

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.

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

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