com.denova.ui
Class GridBagControl

java.lang.Object
  |
  +--java.awt.GridBagConstraints
        |
        +--com.denova.ui.GridBagControl
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class GridBagControl
extends java.awt.GridBagConstraints

Tames GridBag. All the components that you want to layout in a grid must be controlled by a single GridBagControl.

Author:
DeNova Copyright © 1997-2008 DeNova All rights reserved worldwide.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.GridBagConstraints
anchor, BOTH, CENTER, EAST, fill, FIRST_LINE_END, FIRST_LINE_START, gridheight, gridwidth, gridx, gridy, HORIZONTAL, insets, ipadx, ipady, LAST_LINE_END, LAST_LINE_START, LINE_END, LINE_START, NONE, NORTH, NORTHEAST, NORTHWEST, PAGE_END, PAGE_START, RELATIVE, REMAINDER, SOUTH, SOUTHEAST, SOUTHWEST, VERTICAL, weightx, weighty, WEST
 
Constructor Summary
GridBagControl(java.awt.Container container)
           
GridBagControl(java.awt.Container container, java.awt.GridBagConstraints gc)
           
GridBagControl(java.awt.Container container, java.awt.GridBagLayout g)
           
GridBagControl(java.awt.Container container, java.awt.GridBagLayout g, java.awt.GridBagConstraints gc)
           
 
Method Summary
 void add(java.awt.Component c)
          Add a component
 void add(java.awt.GridBagConstraints componentConstraints, java.awt.Component c)
          Add a component and set the constraints.
 void addBlankCell()
          Add a blank cell
 void addBlankRow()
          Add a blank row
 void addCentered(java.awt.Component c)
          Center the component
 void addCentered(java.awt.GridBagConstraints componentConstraints, java.awt.Component c)
          Center the component and set the constraints for it.
 void addHorizontalSpace()
          Add blank, stretchable horizontal space
 void addVerticalSpace()
          Add blank, stretchable vertical space.
 void endColumn()
          End the column.
 void endColumn(java.awt.Component c)
          End the column with this component.
 void endColumn(java.awt.GridBagConstraints gc, java.awt.Component c)
          End the column with this component using the specified constraints.
 void endRow()
          End the row.
 void endRow(java.awt.Component c)
          End the row with this component
 void endRow(java.awt.GridBagConstraints gc, java.awt.Component c)
          End the row with this component.
static java.awt.GridBagConstraints fillConstraints(java.awt.GridBagConstraints constraints)
          Adjusts constraints to fill extra horizontal and vertical space
static java.awt.GridBagConstraints fillHorizontalConstraints(java.awt.GridBagConstraints constraints)
          Adjusts constraints to fill extra horizontal space
static java.awt.GridBagConstraints fillVerticalConstraints(java.awt.GridBagConstraints constraints)
          Adjusts constraints to fill extra vertical space
static java.awt.GridBagConstraints getButtonConstraints()
          Returns the default constraints for a JButton
static java.awt.GridBagConstraints getCheckBoxConstraints()
          Returns the default constraints for a JCheckBox
static java.awt.GridBagConstraints getComboBoxConstraints()
          Returns the default constraints for a JComboBox
 java.awt.GridBagConstraints getConstraints()
          Gets the constraints
static java.awt.GridBagConstraints getDefaultConstraints()
          Returns the default constraints
static java.awt.GridBagConstraints getLabelConstraints()
          Returns the default constraints for a JLabel
static java.awt.GridBagConstraints getLabelForTextConstraints()
          Returns the default constraints for a JLabel which labels a JTextField
 java.awt.GridBagLayout getLayout()
          Get the layout
static java.awt.GridBagConstraints getListConstraints()
          Returns the default constraints for a JList
static java.awt.GridBagConstraints getListConstraints(int rows)
          Returns the default constraints for a JList using the specified number of rows
static java.awt.GridBagConstraints getTextAreaConstraints()
          Returns the default constraints for a JTextArea
static java.awt.GridBagConstraints getTextAreaConstraints(int rows)
          Returns the default constraints for a JTextArea using the specified number of rows
static java.awt.GridBagConstraints getTextConstraints()
          Returns the default constraints for a JTextField
static java.awt.GridBagConstraints getTextConstraints(int columns)
          Returns the default constraints for a JTextField using the specified number of columns
static java.awt.GridBagConstraints getWestConstraints()
          Returns the default constraints for a West positioned object
static java.awt.GridBagConstraints setColumnConstraints(java.awt.GridBagConstraints constraints, int columns)
          Adjusts constraints to use specified number of columns
 void setConstraints(java.awt.GridBagConstraints gc)
          Sets the constraints
static void setDefaultConstraints(java.awt.GridBagConstraints gc)
          Sets the default constraints
 void setLayout(java.awt.GridBagLayout newG)
          Set the layout.
static java.awt.GridBagConstraints setRowConstraints(java.awt.GridBagConstraints constraints, int rows)
          Adjusts constraints to use specified number of rows
 
Methods inherited from class java.awt.GridBagConstraints
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridBagControl

public GridBagControl(java.awt.Container container)

GridBagControl

public GridBagControl(java.awt.Container container,
                      java.awt.GridBagLayout g)

GridBagControl

public GridBagControl(java.awt.Container container,
                      java.awt.GridBagConstraints gc)

GridBagControl

public GridBagControl(java.awt.Container container,
                      java.awt.GridBagLayout g,
                      java.awt.GridBagConstraints gc)
Method Detail

setDefaultConstraints

public static void setDefaultConstraints(java.awt.GridBagConstraints gc)
Sets the default constraints

Parameters:
gc - The new defaultConstraints value

getDefaultConstraints

public static java.awt.GridBagConstraints getDefaultConstraints()
Returns the default constraints

Returns:
The defaultConstraints value

getLabelConstraints

public static java.awt.GridBagConstraints getLabelConstraints()
Returns the default constraints for a JLabel

Returns:
The labelConstraints value

getLabelForTextConstraints

public static java.awt.GridBagConstraints getLabelForTextConstraints()
Returns the default constraints for a JLabel which labels a JTextField

Returns:
The labelForTextConstraints value

getTextConstraints

public static java.awt.GridBagConstraints getTextConstraints()
Returns the default constraints for a JTextField

Returns:
The textConstraints value

getTextConstraints

public static java.awt.GridBagConstraints getTextConstraints(int columns)
Returns the default constraints for a JTextField using the specified number of columns

Parameters:
columns - columns
Returns:
The textConstraints value

getButtonConstraints

public static java.awt.GridBagConstraints getButtonConstraints()
Returns the default constraints for a JButton

Returns:
The buttonConstraints value

getComboBoxConstraints

public static java.awt.GridBagConstraints getComboBoxConstraints()
Returns the default constraints for a JComboBox

Returns:
The comboBoxConstraints value

getListConstraints

public static java.awt.GridBagConstraints getListConstraints()
Returns the default constraints for a JList

Returns:
The listConstraints value

getListConstraints

public static java.awt.GridBagConstraints getListConstraints(int rows)
Returns the default constraints for a JList using the specified number of rows

Parameters:
rows - rows in list
Returns:
The listConstraints value

getTextAreaConstraints

public static java.awt.GridBagConstraints getTextAreaConstraints()
Returns the default constraints for a JTextArea

Returns:
The textAreaConstraints value

getTextAreaConstraints

public static java.awt.GridBagConstraints getTextAreaConstraints(int rows)
Returns the default constraints for a JTextArea using the specified number of rows

Parameters:
rows - rows
Returns:
The textAreaConstraints value

getCheckBoxConstraints

public static java.awt.GridBagConstraints getCheckBoxConstraints()
Returns the default constraints for a JCheckBox

Returns:
The checkBoxConstraints value

getWestConstraints

public static java.awt.GridBagConstraints getWestConstraints()
Returns the default constraints for a West positioned object

Returns:
The westConstraints value

fillHorizontalConstraints

public static java.awt.GridBagConstraints fillHorizontalConstraints(java.awt.GridBagConstraints constraints)
Adjusts constraints to fill extra horizontal space

Parameters:
constraints - grid bag constraints
Returns:
new grid bag constraints

fillVerticalConstraints

public static java.awt.GridBagConstraints fillVerticalConstraints(java.awt.GridBagConstraints constraints)
Adjusts constraints to fill extra vertical space

Parameters:
constraints - constraints
Returns:
new grid bag constraints

fillConstraints

public static java.awt.GridBagConstraints fillConstraints(java.awt.GridBagConstraints constraints)
Adjusts constraints to fill extra horizontal and vertical space

Parameters:
constraints -
Returns:
new grid bag constraints

setRowConstraints

public static java.awt.GridBagConstraints setRowConstraints(java.awt.GridBagConstraints constraints,
                                                            int rows)
Adjusts constraints to use specified number of rows

Parameters:
constraints - The new rowConstraints value
rows - The new rowConstraints value
Returns:
new grid bag constraints

setColumnConstraints

public static java.awt.GridBagConstraints setColumnConstraints(java.awt.GridBagConstraints constraints,
                                                               int columns)
Adjusts constraints to use specified number of columns

Parameters:
constraints - The new columnConstraints value
columns - The new columnConstraints value
Returns:
new grid bag constraints

setLayout

public void setLayout(java.awt.GridBagLayout newG)
Set the layout.

Parameters:
newG - The new layout value

getLayout

public java.awt.GridBagLayout getLayout()
Get the layout

Returns:
The layout value

add

public void add(java.awt.Component c)
Add a component

Parameters:
c - component

add

public void add(java.awt.GridBagConstraints componentConstraints,
                java.awt.Component c)
Add a component and set the constraints.

Parameters:
componentConstraints - component constraints
c - component

addCentered

public void addCentered(java.awt.Component c)
Center the component

Parameters:
c - The feature to be added to the Centered attribute

addCentered

public void addCentered(java.awt.GridBagConstraints componentConstraints,
                        java.awt.Component c)
Center the component and set the constraints for it.

Parameters:
componentConstraints - The feature to be added to the Centered attribute
c - The feature to be added to the Centered attribute

addBlankCell

public void addBlankCell()
Add a blank cell


addBlankRow

public void addBlankRow()
Add a blank row


addHorizontalSpace

public void addHorizontalSpace()
Add blank, stretchable horizontal space


addVerticalSpace

public void addVerticalSpace()
Add blank, stretchable vertical space.


endRow

public void endRow(java.awt.GridBagConstraints gc,
                   java.awt.Component c)
End the row with this component.

Parameters:
gc - grid bag constraints
c - component

endRow

public void endRow(java.awt.Component c)
End the row with this component

Parameters:
c - component

endRow

public void endRow()
End the row.


endColumn

public void endColumn(java.awt.GridBagConstraints gc,
                      java.awt.Component c)
End the column with this component using the specified constraints.

Parameters:
gc - grid bag constraints
c - component

endColumn

public void endColumn(java.awt.Component c)
End the column with this component.

Parameters:
c - component

endColumn

public void endColumn()
End the column.


setConstraints

public void setConstraints(java.awt.GridBagConstraints gc)
Sets the constraints

Parameters:
gc - The new constraints value

getConstraints

public java.awt.GridBagConstraints getConstraints()
Gets the constraints

Returns:
The constraints value