ch.elca.el4j.services.gui.swing.util
Class GridConstraintsUtil

java.lang.Object
  extended by ch.elca.el4j.services.gui.swing.util.GridConstraintsUtil

public class GridConstraintsUtil
extends Object

Utility to make GridBagConstraints code nicer.

Author:
David Bernhard (DBD)
File-location:
GridConstraintsUtil
Last check-in date:
2010-01-15 14:26:34 +0100 (Fr, 15. Jan 2010) by jonasha for revision 4093

Constructor Summary
GridConstraintsUtil()
          Constructor.
GridConstraintsUtil(int initialRow)
          Constructor that allows an initial row to be specified.
 
Method Summary
 GridConstraintsUtil anchor(int anchor)
          Set a new anchor for the next object.
 GridBagConstraints current()
           
 GridConstraintsUtil height(int height)
          Set a new height for the next object.
 GridConstraintsUtil insets(int t, int l, int b, int r)
          Set insets for the next element.
 GridBagConstraints newLine()
           
 GridBagConstraints next()
           
 void setPeristentFill(int fill)
          Persistently set the fill parameter.
 void setPersistentInsets(Insets i)
          Persistently set insets.
 GridConstraintsUtil weight(double weight)
          Set the column weight for the next object.
 GridConstraintsUtil weightY(double weightY)
          Set the row weight for the next object.
 GridConstraintsUtil width(int width)
          Set a new width for the next object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridConstraintsUtil

public GridConstraintsUtil()
Constructor. Fields to zero.


GridConstraintsUtil

public GridConstraintsUtil(int initialRow)
Constructor that allows an initial row to be specified. In particular, row -1 is allowed so that a loop can begin with newLine().

Parameters:
initialRow - The initial row.
Method Detail

anchor

public GridConstraintsUtil anchor(int anchor)
Set a new anchor for the next object. This is applied once then reset.

Parameters:
anchor - The anchor to set.
Returns:
this with the modification made.

width

public GridConstraintsUtil width(int width)
Set a new width for the next object. This is applied once then reset.

Parameters:
width - The width to set.
Returns:
this with the modification made.

height

public GridConstraintsUtil height(int height)
Set a new height for the next object. This is applied once then reset.

Parameters:
height - The height to set.
Returns:
this with the modification made.

weight

public GridConstraintsUtil weight(double weight)
Set the column weight for the next object.

Parameters:
weight - The weight to set.
Returns:
this with the modification.

weightY

public GridConstraintsUtil weightY(double weightY)
Set the row weight for the next object.

Parameters:
weightY - The weight to set.
Returns:
this with the modification.

current

public GridBagConstraints current()
Returns:
A GridBagConstraints pointing to the current row/column.

next

public GridBagConstraints next()
Returns:
A GridBagConstraints for the next cell.

newLine

public GridBagConstraints newLine()
Returns:
A GridBagConstraints for the first cell on a new line.

setPersistentInsets

public void setPersistentInsets(Insets i)
Persistently set insets.

Parameters:
i - The insets.

setPeristentFill

public void setPeristentFill(int fill)
Persistently set the fill parameter.

Parameters:
fill - The fill parameter to set.

insets

public GridConstraintsUtil insets(int t,
                                  int l,
                                  int b,
                                  int r)
Set insets for the next element.

Parameters:
t - Top.
l - Left.
b - Bottom.
r - Right.
Returns:
this with the modification.


Copyright © 2005-2011 ELCA. All Rights Reserved.