org.xnap.gui.util
Class GridBagHelper

java.lang.Object
  extended by org.xnap.gui.util.GridBagHelper

public class GridBagHelper
extends java.lang.Object

This helper class provides convenience methods to add components to a GridBagLayout.


Field Summary
static java.awt.Insets COMPONENT_INSETS
          The default insets for components.
static java.awt.Insets LABEL_INSETS
          The default insets for labels.
static java.awt.Insets PANEL_INSETS
          The default insets for panels.
static java.awt.Insets STRING_INSETS
          The default insets for strings.
static int X_SPACING
           
 
Constructor Summary
GridBagHelper()
           
 
Method Summary
static void add(java.awt.Container p, java.awt.Component c)
           
static void add(java.awt.Container p, java.awt.Component c, boolean fill)
           
static void add(java.awt.Container p, java.awt.Component c, java.awt.Insets insets, boolean fill)
           
static void add(java.awt.Container p, java.awt.Component c, java.awt.Insets insets, boolean fill, int anchor)
           
static javax.swing.JLabel add(java.awt.Container p, java.lang.String s)
           
static void addComponent(java.awt.Container p, java.awt.Component c)
          Adds c without a break.
static void addComponent(java.awt.Container p, java.awt.Component c, int anchor)
          Adds c without a break.
static void addHorizontalSpacer(java.awt.Container p)
          Adds a horizontal spacer to p that sucks up the remaining space.
static javax.swing.JLabel addLabel(java.awt.Container p, java.lang.String s)
          Fill is set to false.
static javax.swing.JLabel addLabel(java.awt.Container p, java.lang.String s, boolean fill)
          Adds a label to p that displays s.
static void addPanel(java.awt.Container p, java.awt.Component c)
           
static void addVerticalSpacer(java.awt.Container p)
          Adds a vertical spacer to p that sucks up the remaining space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X_SPACING

public static final int X_SPACING
See Also:
Constant Field Values

COMPONENT_INSETS

public static final java.awt.Insets COMPONENT_INSETS
The default insets for components.


LABEL_INSETS

public static final java.awt.Insets LABEL_INSETS
The default insets for labels.


PANEL_INSETS

public static final java.awt.Insets PANEL_INSETS
The default insets for panels.


STRING_INSETS

public static final java.awt.Insets STRING_INSETS
The default insets for strings.

Constructor Detail

GridBagHelper

public GridBagHelper()
Method Detail

add

public static void add(java.awt.Container p,
                       java.awt.Component c,
                       java.awt.Insets insets,
                       boolean fill,
                       int anchor)

add

public static void add(java.awt.Container p,
                       java.awt.Component c,
                       java.awt.Insets insets,
                       boolean fill)

add

public static void add(java.awt.Container p,
                       java.awt.Component c,
                       boolean fill)

add

public static void add(java.awt.Container p,
                       java.awt.Component c)

add

public static javax.swing.JLabel add(java.awt.Container p,
                                     java.lang.String s)

addComponent

public static void addComponent(java.awt.Container p,
                                java.awt.Component c,
                                int anchor)
Adds c without a break.


addComponent

public static void addComponent(java.awt.Container p,
                                java.awt.Component c)
Adds c without a break.


addLabel

public static javax.swing.JLabel addLabel(java.awt.Container p,
                                          java.lang.String s,
                                          boolean fill)
Adds a label to p that displays s. The label is placed a bit more south than the rest of the controls.

Returns:
the added label

addHorizontalSpacer

public static void addHorizontalSpacer(java.awt.Container p)
Adds a horizontal spacer to p that sucks up the remaining space. All components that have been added to p are pushed eastwards.


addLabel

public static javax.swing.JLabel addLabel(java.awt.Container p,
                                          java.lang.String s)
Fill is set to false.

See Also:
addLabel(Container, String, boolean)

addPanel

public static void addPanel(java.awt.Container p,
                            java.awt.Component c)

addVerticalSpacer

public static void addVerticalSpacer(java.awt.Container p)
Adds a vertical spacer to p that sucks up the remaining space. All components that have been added to p are pushed northwards.



Copyright © 2001-2005 XNap Team. All Rights Reserved.