JavaGantt 2011.1 API

eu.beesoft.gaia.swing.form
Class CellConstraints

java.lang.Object
  extended by java.awt.GridBagConstraints
      extended by eu.beesoft.gaia.swing.form.CellConstraints
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class CellConstraints
extends java.awt.GridBagConstraints
implements java.lang.Cloneable

Constraints extends capabilities of java.awt.GridBagConstraints and is designe to use with Form component. It has a properties to manage border painting around a cell. When property is set, a line is drawed.

There is a set of the init() methods implemented in this class. They set the grid coordinates and sizes (variables in GrdiBagConstraints without modifying other variables. You can call them on a single CellConstraints instance, because it is internally cloned in GridBagLayout. So you can write this code:

 Form form = new Form ();
 CellConstraints cc = new CellConstraints ();
 form.add (new JLabel ("First"), cc.init (0, 0));
 form.add (new JTextField (10), cc.init (1, 0));
 form.add (new JLabel ("Second"), cc.init (0, 1));
 form.add (new JTextField (), cc.init (1, 1));
 

See Also:
Serialized Form

Field Summary
 boolean bottomBorder
          Set to true if Form should draw a horizontal line on the bottom margin.
 boolean leftBorder
          Set to true if Form should draw a vertical line on the left margin.
 boolean rightBorder
          Set to true if Form should draw a vertical line on the right margin.
 boolean topBorder
          Set to true if Form should draw a horizontal line on the top margin.
 
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
CellConstraints()
          Creates a new instance of CellConstraints.
 
Method Summary
 java.lang.Object clone()
          Clones this instance.
 void init(int x)
          Initializes this instance with given arguments.
 void init(int x, int y)
          Initializes this instance with given arguments.
 void init(int x, int y, int width)
          Initializes this instance with given arguments.
 void init(int x, int y, int width, int height)
          Initializes this instance with given arguments.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leftBorder

public boolean leftBorder
Set to true if Form should draw a vertical line on the left margin.


topBorder

public boolean topBorder
Set to true if Form should draw a horizontal line on the top margin.


rightBorder

public boolean rightBorder
Set to true if Form should draw a vertical line on the right margin.


bottomBorder

public boolean bottomBorder
Set to true if Form should draw a horizontal line on the bottom margin.

Constructor Detail

CellConstraints

public CellConstraints()
Creates a new instance of CellConstraints.

Method Detail

init

public void init(int x)
Initializes this instance with given arguments. Other parameters are unchanged.

Parameters:
x - - the value to set to gridx field

init

public void init(int x,
                 int y)
Initializes this instance with given arguments. Other parameters are unchanged.

Parameters:
x - - the value to set to gridx field
y - - the value to set to gridy field

init

public void init(int x,
                 int y,
                 int width)
Initializes this instance with given arguments. Other parameters are unchanged.

Parameters:
x - - the value to set to gridx field
y - - the value to set to gridy field
width - - the value to set to gridwidth field

init

public void init(int x,
                 int y,
                 int width,
                 int height)
Initializes this instance with given arguments. Other parameters are unchanged.

Parameters:
x - - the value to set to gridx field
y - - the value to set to gridy field
width - - the value to set to gridwidth field
height - - the value to set to height field

clone

public java.lang.Object clone()
Clones this instance.

Overrides:
clone in class java.awt.GridBagConstraints
Returns:
cloned CellConstraints instance

JavaGantt 2011.1 API