chrriis.uihierarchy.constraints
Class GridBagHConstraints
java.lang.Object
chrriis.uihierarchy.constraints.GridBagHConstraints
- All Implemented Interfaces:
- LayoutHConstraints
- public class GridBagHConstraints
- extends Object
- implements LayoutHConstraints
The constraints for a GridBag layout. Constraints are manipulated by the
createConstraints
method, if they are a String.
The format is of the form "inherit, key1=value1, key2=value2, ...". Inherit
is optional and can have two forms: "inherit" or "inherit=mappedName". The
inherit keyword is used to first apply some earlier constraints before
applying a new set of constraints. This allows chaining of constraints.
If used with a mapped name then it will use the constraints applied to the
level that was mapped, else it will use the previous sibbling's
constraints.
Additionaly, "gridx" and "gridy" accept the special forms "gridx++" and
"gridy++" which take the value of the previous level, incremented by one.
Key/value pairs are (case is insensitive):
- gridx = an integer.
- gridy = an integer.
- gridwidth = an integer, or one of the possible GridBagConstraints fields
(e.g.: REMAINDER).
- gridheight = an integer, or one of the possible GridBagConstraints fields
(e.g.: REMAINDER).
- weightx = a double.
- weighty = a double.
- anchor = one of the possible GridBagConstraints fields (e.g.: NORTH).
- fill = one of the possible GridBagConstraints fields (e.g.: BOTH).
- insets = four dimensions in the form "top:left:bottom:right".
- ipadx = an integer.
- ipady = an integer.
- Version:
- 1.1 2003.11.03
- Author:
- Christopher Deckers (chrriis@brainlex.com)
GridBagHConstraints
public GridBagHConstraints()
createConstraints
public Object createConstraints(SingleLevelAccessor accessor,
Container parentContainer,
Object constraints)
- Create the constraints for a gridbag layout, if the parameter is a String.
- Specified by:
createConstraints
in interface LayoutHConstraints
- Parameters:
accessor
- The accessor of the level for which to create the
constraints.parentContainer
- The parent container.constraints
- The constraints of the component.
- Returns:
- null, or the original constraints if not a String.