org.openpermis.editor.policy.gui.forms
Class SmartConstraints

java.lang.Object
  extended by org.openpermis.editor.policy.gui.forms.SmartConstraints
Direct Known Subclasses:
SmartLayoutConstraints

public class SmartConstraints
extends Object

Smarter version of CellConstraints that holds the current location.

Since:
0.3.0

Constructor Summary
SmartConstraints()
          Returns a new smart constraints object starting at (1, 1).
SmartConstraints(int x, int y)
          Creates a new smart constraints object with the specified initial coordinates.
 
Method Summary
 com.jgoodies.forms.layout.CellConstraints col(int columnWidth)
          Returns a cell constraints with the current location height of one.
protected  int getInitialX()
          Returns the initial x coordinate.
protected  int getX()
          Returns the x coordinate.
protected  int getY()
          Returns the y coordinate.
 void reset(int startX, int startY)
          Resets the smart constraints to the specified coordinates.
 void row(int offsetY)
          Advances the y coordinate by the given amount and resets the x coordinate.
 com.jgoodies.forms.layout.CellConstraints x(int offsetX)
          Returns a cell constraints with the current location and a width and height of one.
 com.jgoodies.forms.layout.CellConstraints xw(int offsetX, int width)
          Returns a cell constraints with the current location, the specified width and height of one.
 com.jgoodies.forms.layout.CellConstraints y(int offsetY)
          Returns a cell constraints with the current location and a width and height of one.
 com.jgoodies.forms.layout.CellConstraints yw(int offsetY, int width)
          Returns a cell constraints with the current location and a width of one and the given height.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartConstraints

public SmartConstraints()
Returns a new smart constraints object starting at (1, 1).

The initial x coordinate is also set to 1.

Since:
0.3.0

SmartConstraints

public SmartConstraints(int x,
                        int y)
Creates a new smart constraints object with the specified initial coordinates.

Parameters:
x - the x coordinate, also serves as initial x coordinate.
y - the y coordinate.
Since:
0.3.0
Method Detail

getInitialX

protected int getInitialX()
Returns the initial x coordinate.

Returns:
the initial x coordinate.
Since:
0.9.0

getX

protected int getX()
Returns the x coordinate.

Returns:
the x coordinate.
Since:
0.9.0

getY

protected int getY()
Returns the y coordinate.

Returns:
the y coordinate.
Since:
0.9.0

reset

public void reset(int startX,
                  int startY)
Resets the smart constraints to the specified coordinates.

The x coordinate also server as initial x coordinate.

Parameters:
startX - the x coordinate, also serves as initial x coordinate.
startY - the y coordinate.
Since:
0.3.0

row

public void row(int offsetY)
Advances the y coordinate by the given amount and resets the x coordinate.

Parameters:
offsetY - the number of rows to advance.
Since:
0.9.0

col

public com.jgoodies.forms.layout.CellConstraints col(int columnWidth)
Returns a cell constraints with the current location height of one.

The width and x coordinate advancement is determined by the column width specified. The width is equivalent to columnWidth * 2 - 1 and the x coordinate is advanced by columnWidth * 2, the y coordinate is left untouched.

Parameters:
columnWidth - the column width of the cell constraints to return.
Returns:
the cell constraints requested.
Since:
0.9.0

x

public com.jgoodies.forms.layout.CellConstraints x(int offsetX)
Returns a cell constraints with the current location and a width and height of one.

The x coordinate is incremented by the specified offset once the constraints are determined, the y coordinate is left untouched.

Parameters:
offsetX - the x coordinate offset.
Returns:
the cell constraints requested.
Since:
0.3.0

xw

public com.jgoodies.forms.layout.CellConstraints xw(int offsetX,
                                                    int width)
Returns a cell constraints with the current location, the specified width and height of one.

The x coordinate is incremented by the specified offset once the constraints are determined, the y coordinate is left untouched.

Parameters:
offsetX - the x coordinate offset.
width - the width of the cell constraint returned.
Returns:
the cell constraints requested.
Since:
0.3.0

y

public com.jgoodies.forms.layout.CellConstraints y(int offsetY)
Returns a cell constraints with the current location and a width and height of one.

The x coordinate is reset to the initial value and the y coordinate is incremented by the specified offset once the constraints are determined.

Parameters:
offsetY - the y coordinate offset.
Returns:
the cell constraints requested.
Since:
0.3.0

yw

public com.jgoodies.forms.layout.CellConstraints yw(int offsetY,
                                                    int width)
Returns a cell constraints with the current location and a width of one and the given height.

The x coordinate is reset to the initial value and the y coordinate is incremented by the specified offset once the constraints are determined.

Parameters:
offsetY - the y coordinate offset.
width - the width of the cell constraint returned.
Returns:
the cell constraints requested.
Since:
0.3.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:17:21
Copyright (c) 2002-2007 Ergon Informatik AG