de.pxclass.gui
Class PXElasticConstraints

java.lang.Object
  extended by de.pxclass.gui.PXElasticConstraints
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PXElasticConstraints
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Specifies the layout constraints of a component to be laid out by PXElasticLayout.

Since:
0.9
Version:
$Revision: 72 $
Author:
D. Starke
See Also:
Serialized Form

Field Summary
 int anchor
          This field is used when the component is smaller than its cell.
static int AS_STRETCH_X
          Resize the component horizontally in the way it gets stretched (resp.
static int AS_STRETCH_X_AND_Y
          Resize the component both horizontally and vertically in the way it gets stretched (resp.
static int AS_STRETCH_Y
          Resize the component vertically in the way it gets stretched (resp.
static int BOTH
          Resize the component both horizontally and vertically.
static int CENTER
          Put the component in the center of its cell.
static int CUT_OUT_OF_BOUNDS
          Set the component to a size of 0 x 0 when it is not completely visible in the bounds of the parent container.
static int EAST
          Put the component on the right side of its cell, centered vertically.
 int fill
          This field is used when the component's cell is larger than the component's requested size.
 int gridHeight
          Specifies the number of rows for the component's cell.
 int gridWidth
          Specifies the number of columns for the component's cell.
 int gridX
          Specifies the column at the left of the component's cell, where the leftmost column has gridX=0.
 int gridY
          Specifies the row at the top of the component's cell, where the topmost row has gridY=0.
static int HEED_ALL_SIZES
          Convenience constant for HEED_MINIMUM_SIZE | HEED_MAXIMUM_SIZE.
static int HEED_MAXIMUM_HEIGHT
          Do not to resize a component beyond its maximum height.
static int HEED_MAXIMUM_SIZE
          Convenience constant for HEED_MAXIMUM_WIDTH | HEED_MAXIMUM_HEIGHT.
static int HEED_MAXIMUM_WIDTH
          Do not to resize a component beyond its maximum width.
static int HEED_MINIMUM_HEIGHT
          Do not to resize a component below its minimum height.
static int HEED_MINIMUM_SIZE
          Convenience constant for HEED_MINIMUM_WIDTH | HEED_MINIMUM_HEIGHT.
static int HEED_MINIMUM_WIDTH
          Do not to resize a component below its minimum width.
static int HEED_NO_SIZES
          Do not heed the component's minimum or maximum size.
static int HORIZONTAL
          Resize the component horizontally but not vertically.
 java.awt.Insets insets
          This field specifies the external padding of the component, the minimum amount of space between the component and the edges of its cell.
 int limitPolicy
          Specifies the behaviour of the layout manager when reaching the limits of the size of the component associated with these constraints.
static int NONE
          Do not resize the component.
static int NORTH
          Put the component at the top of its cell, centered horizontally.
static int NORTHEAST
          Put the component at the top-right corner of its cell.
static int NORTHWEST
          Put the component at the top-left corner of its cell.
 double shrinkX
          This field is used when the components parent container is smaller then the size requested by all its children components.
 double shrinkY
          This field is used when the components parent container is smaller then the size requested by all its children components.
static int SOUTH
          Put the component at the bottom of its cell, centered horizontally.
static int SOUTHEAST
          Put the component at the bottom-right corner of its cell.
static int SOUTHWEST
          Put the component at the bottom-left corner of its cell.
 double stretchX
          This field is used when the components parent container is larger then the size requested by all its children components.
 double stretchY
          This field is used when the components parent container is larger then the size requested by all its children components.
static int VERTICAL
          Resize the component vertically but not horizontally.
static int WEST
          Put the component on the left side of its cell, centered vertically.
 
Constructor Summary
PXElasticConstraints()
          Creates a new elastic constraint object.
PXElasticConstraints(int gridX, int gridY, double shrinkX, double shrinkY, double stretchX, double stretchY, int anchor, int fill)
          Creates a new elastic constraint object.
PXElasticConstraints(int gridX, int gridY, int gridWidth, int gridHeight, double shrinkX, double shrinkY, double stretchX, double stretchY, int anchor, int fill, int limitPolicy, java.awt.Insets insets)
          Creates a new elastic constraint object with the specified values.
 
Method Summary
 java.lang.Object clone()
          Creates a copy of this elastic constraint object.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAnchorString()
          Returns a string representation of the anchor-parameter of this constraints object.
 java.lang.String getFillString()
          Returns a string representation of the fill-parameter of this constraints object.
 java.lang.String getLimitPolicyString()
          Returns a string representation of the limitPolicy-parameter of this constraints object.
 int hashCode()
           
 boolean isCuttingOutOfBounds()
          Gets whether or not the layout manager should cut the associated component off the layout if it is resized below its minimum size.
 boolean isHeedingMaximumHeight()
          Gets whether or not the layout manager should heed the maximum height of the associated component.
 boolean isHeedingMaximumWidth()
          Gets whether or not the layout manager should heed the maximum width of the associated component.
 boolean isHeedingMinimumHeight()
          Gets whether or not the layout manager should heed the minimum height of the associated component.
 boolean isHeedingMinimumWidth()
          Gets whether or not the layout manager should heed the minimum width of the associated component.
 PXElasticConstraints nextColumn()
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(double newStretchX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(double newStretchX, double newShrinkX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth, double newStretchX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth, double newStretchX, double newShrinkX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth, int newGridHeight)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth, int newGridHeight, double newStretchX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth, int newGridHeight, double newStretchX, double newShrinkX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth, int newGridHeight, int newFill, double newStretchX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(int newGridWidth, int newGridHeight, int newFill, double newStretchX, double newShrinkX)
          Sets the gridX of these constraints to the next cell and returns this constraints object.
 PXElasticConstraints nextColumn(PXElasticConstraints baseConstraints)
          Sets the gridX of these constraints to the next cell of baseConstraints and returns this constraints object.
 PXElasticConstraints nextRow()
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(double newStretchX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(double newStretchX, double newShrinkX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, double newStretchX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, double newStretchX, double newShrinkX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, int newGridHeight)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, int newGridHeight, double newStretchX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, int newGridHeight, double newStretchX, double newShrinkX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, int newGridHeight, int newFill)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, int newGridHeight, int newFill, double newStretchX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(int newGridWidth, int newGridHeight, int newFill, double newStretchX, double newShrinkX)
          Sets the gridY of these constraints to the first cell in the next row and returns this constraints object.
 PXElasticConstraints nextRow(PXElasticConstraints baseConstraints)
          Sets the gridY of these constraints to the next cell of baseConstraints and returns this constraints object.
 java.lang.String paramString()
          Returns a string representation of the parameters of this constraints object.
 void resetAll()
          Resets all values of this constraints object to their defaults.
 PXElasticConstraints resetAnchor()
          Resets the anchor of these constraints to WEST and returns this constraints object.
 PXElasticConstraints resetFill()
          Resets the fill of these constraints to NONE and returns this constraints object.
 PXElasticConstraints setAnchor(int newAnchor)
          Sets the anchor of these constraints to newAnchor and returns this constraints object.
 PXElasticConstraints setFill(int newFill)
          Sets the fill of these constraints to newFill and returns this constraints object.
 PXElasticConstraints setInsets(java.awt.Insets newInsets)
          Sets the insets of these constraints to newInsets and returns this constraints object.
 PXElasticConstraints setInsets(int top, int left, int bottom, int right)
          Sets the insets of these constraints to the given inset values and returns this constraints object.
 PXElasticConstraints setShrinkX(double newShrinkX)
          Sets the shrinkX of these constraints to newShrinkX and returns this constraints object.
 PXElasticConstraints setShrinkY(double newShrinkY)
          Sets the shrinkY of these constraints to newShrinkY and returns this constraints object.
 PXElasticConstraints setStretchX(double newStretchX)
          Sets the stretchX of these constraints to newStretchX and returns this constraints object.
 PXElasticConstraints setStretchY(double newStretchY)
          Sets the stretchY of these constraints to newStretchY and returns this constraints object.
 java.lang.String toString()
          Returns a string representation of this constraints object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Do not resize the component.

See Also:
fill, Constant Field Values

AS_STRETCH_X

public static final int AS_STRETCH_X
Resize the component horizontally in the way it gets stretched (resp. shrinked) by stretchX (resp. shrinkX). The component is not resized vertically.

See Also:
fill, Constant Field Values

HORIZONTAL

public static final int HORIZONTAL
Resize the component horizontally but not vertically.

See Also:
fill, Constant Field Values

AS_STRETCH_Y

public static final int AS_STRETCH_Y
Resize the component vertically in the way it gets stretched (resp. shrinked) by stretchY (resp. shrinkY). The component is not resized horizontally.

See Also:
fill, Constant Field Values

VERTICAL

public static final int VERTICAL
Resize the component vertically but not horizontally.

See Also:
fill, Constant Field Values

BOTH

public static final int BOTH
Resize the component both horizontally and vertically.

See Also:
fill, Constant Field Values

AS_STRETCH_X_AND_Y

public static final int AS_STRETCH_X_AND_Y
Resize the component both horizontally and vertically in the way it gets stretched (resp. shrinked) by stretchX and stretchY (resp. shrinkX and shrinkY).

See Also:
fill, Constant Field Values

CENTER

public static final int CENTER
Put the component in the center of its cell.

See Also:
anchor, Constant Field Values

NORTH

public static final int NORTH
Put the component at the top of its cell, centered horizontally.

See Also:
anchor, Constant Field Values

WEST

public static final int WEST
Put the component on the left side of its cell, centered vertically.

See Also:
anchor, Constant Field Values

SOUTH

public static final int SOUTH
Put the component at the bottom of its cell, centered horizontally.

See Also:
anchor, Constant Field Values

EAST

public static final int EAST
Put the component on the right side of its cell, centered vertically.

See Also:
anchor, Constant Field Values

NORTHWEST

public static final int NORTHWEST
Put the component at the top-left corner of its cell.

See Also:
anchor, Constant Field Values

NORTHEAST

public static final int NORTHEAST
Put the component at the top-right corner of its cell.

See Also:
anchor, Constant Field Values

SOUTHWEST

public static final int SOUTHWEST
Put the component at the bottom-left corner of its cell.

See Also:
anchor, Constant Field Values

SOUTHEAST

public static final int SOUTHEAST
Put the component at the bottom-right corner of its cell.

See Also:
anchor, Constant Field Values

HEED_NO_SIZES

public static final int HEED_NO_SIZES
Do not heed the component's minimum or maximum size.

See Also:
limitPolicy, Constant Field Values

HEED_MAXIMUM_WIDTH

public static final int HEED_MAXIMUM_WIDTH
Do not to resize a component beyond its maximum width.

See Also:
limitPolicy, HEED_MAXIMUM_HEIGHT, HEED_MAXIMUM_SIZE, Constant Field Values

HEED_MAXIMUM_HEIGHT

public static final int HEED_MAXIMUM_HEIGHT
Do not to resize a component beyond its maximum height.

See Also:
limitPolicy, HEED_MAXIMUM_WIDTH, HEED_MAXIMUM_SIZE, Constant Field Values

HEED_MAXIMUM_SIZE

public static final int HEED_MAXIMUM_SIZE
Convenience constant for HEED_MAXIMUM_WIDTH | HEED_MAXIMUM_HEIGHT.

See Also:
limitPolicy, HEED_MAXIMUM_WIDTH, HEED_MAXIMUM_HEIGHT, Constant Field Values

HEED_MINIMUM_WIDTH

public static final int HEED_MINIMUM_WIDTH
Do not to resize a component below its minimum width.

See Also:
limitPolicy, HEED_MINIMUM_HEIGHT, HEED_MINIMUM_SIZE, Constant Field Values

HEED_MINIMUM_HEIGHT

public static final int HEED_MINIMUM_HEIGHT
Do not to resize a component below its minimum height.

See Also:
limitPolicy, HEED_MINIMUM_WIDTH, HEED_MINIMUM_SIZE, Constant Field Values

HEED_MINIMUM_SIZE

public static final int HEED_MINIMUM_SIZE
Convenience constant for HEED_MINIMUM_WIDTH | HEED_MINIMUM_HEIGHT.

See Also:
limitPolicy, HEED_MINIMUM_WIDTH, HEED_MINIMUM_HEIGHT, Constant Field Values

HEED_ALL_SIZES

public static final int HEED_ALL_SIZES
Convenience constant for HEED_MINIMUM_SIZE | HEED_MAXIMUM_SIZE.

See Also:
limitPolicy, HEED_MINIMUM_SIZE, HEED_MAXIMUM_SIZE, Constant Field Values

CUT_OUT_OF_BOUNDS

public static final int CUT_OUT_OF_BOUNDS
Set the component to a size of 0 x 0 when it is not completely visible in the bounds of the parent container.

See Also:
limitPolicy, Constant Field Values

gridX

public int gridX
Specifies the column at the left of the component's cell, where the leftmost column has gridX=0.

The default value is 0. gridX should be greather than 0.


gridY

public int gridY
Specifies the row at the top of the component's cell, where the topmost row has gridY=0.

The default value is 0. gridY should be greather than 0.


gridWidth

public int gridWidth
Specifies the number of columns for the component's cell.

gridWidth should be greater than 0 and the default value is 1.


gridHeight

public int gridHeight
Specifies the number of rows for the component's cell.

gridHeight should be greater than 0 and the default value is 1.


anchor

public int anchor
This field is used when the component is smaller than its cell. It determines where, within the cell, to place the component. Possible values are CENTER, NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, and NORTHWEST. The default value is WEST.


insets

public java.awt.Insets insets
This field specifies the external padding of the component, the minimum amount of space between the component and the edges of its cell.

The default value is null which is interpreted as all insets set to 0.


fill

public int fill
This field is used when the component's cell is larger than the component's requested size. It determines whether to resize the component, and if so, how.

The following values are valid for fill:

The default value is NONE.


shrinkX

public double shrinkX
This field is used when the components parent container is smaller then the size requested by all its children components.

The elastic layout manager calculates the shrinkX of a column to be the maximum shrinkX of all the components in that column. If the resulting layout is larger horizontally than the area it needs to fill, the missing space is distributed to each column in proportion to its shrinkX – each column with a shrinkX greater than 0 is getting smaller. A column that has a shrinkX of 0 is not beeing resized.

If all the shrinkX values of all columns of the layout area are zero, all columns and their components remain unresized – the rightmost components might exceed the size of the parent container and could be not visible any more.

The default value of this field is 0. shrinkX should be a non-negative value.


shrinkY

public double shrinkY
This field is used when the components parent container is smaller then the size requested by all its children components.

The elastic layout manager calculates the shrinkY of a row to be the maximum shrinkY of all the components in that row. If the resulting layout is larger vertically than the area it needs to fill, the missing space is distributed to each row in proportion to its shrinkY – each row with a shrinkY greater than 0 is getting smaller. A row that has a shrinkY of 0 is not beeing resized.

If all the shrinkY values of all rows of the layout area are zero, all rows and their components remain unresized – the bottommost components might exceed the size of the parent container and could be not visible any more.

The default value of this field is 0. shrinkY should be a non-negative value.


stretchX

public double stretchX
This field is used when the components parent container is larger then the size requested by all its children components.

The elastic layout manager calculates the stretchX of a column to be the maximum stretchX of all the components in that column. If the resulting layout is smaller horizontally than the area it needs to fill, the extra space is distributed to each column in proportion to its stretchX – each column with a stretchX greater than 0 is getting larger. A column that has a stretchX of 0 is not beeing resized.

If all the stretchX values of all columns of the layout area are zero, all columns and their components remain unresized – the extra space appears right of the rightmost column.

The default value of this field is 0. stretchX should be a non-negative value.


stretchY

public double stretchY
This field is used when the components parent container is larger then the size requested by all its children components.

The elastic layout manager calculates the stretchY of a row to be the maximum stretchY of all the components in that row. If the resulting layout is smaller vertically than the area it needs to fill, the extra space is distributed to each row in proportion to its stretchY – each row with a stretchY greater than 0 is getting larger. A row that has a stretchY of 0 is not beeing resized.

If all the stretchY values of all rows of the layout area are zero, all rows and their components remain unresized – the extra space appears below the bottommost row.

The default value of this field is 0. stretchY should be a non-negative value.


limitPolicy

public int limitPolicy
Specifies the behaviour of the layout manager when reaching the limits of the size of the component associated with these constraints.

Default is "do not heed the maximum size of a component, but heed its minimum size, the component will always be painted".

See Also:
HEED_NO_SIZES, HEED_MAXIMUM_SIZE, HEED_MINIMUM_SIZE, CUT_OUT_OF_BOUNDS
Constructor Detail

PXElasticConstraints

public PXElasticConstraints()
Creates a new elastic constraint object. The constraint values are initialized as follows:
constraint value
gridX 0
gridY 0
gridWidth 1
gridHeight 1
shrinkX 0.0
shrinkY 0.0
stretchX 0.0
stretchY 0.0
anchor WEST
fill NONE
limitPolicy HEED_MINIMUM_SIZE
insets null


PXElasticConstraints

public PXElasticConstraints(int gridX,
                            int gridY,
                            double shrinkX,
                            double shrinkY,
                            double stretchX,
                            double stretchY,
                            int anchor,
                            int fill)
Creates a new elastic constraint object. The constraint values not specified by parameters are initialized as follows:
constraint value
gridWidth 1
gridHeight 1
limitPolicy HEED_MINIMUM_SIZE
insets null

Parameters:
gridX - see gridX
gridY - see gridY
shrinkX - see shrinkX
shrinkY - see shrinkY
stretchX - see stretchX
stretchY - see stretchY
anchor - see anchor
fill - see fill

PXElasticConstraints

public PXElasticConstraints(int gridX,
                            int gridY,
                            int gridWidth,
                            int gridHeight,
                            double shrinkX,
                            double shrinkY,
                            double stretchX,
                            double stretchY,
                            int anchor,
                            int fill,
                            int limitPolicy,
                            java.awt.Insets insets)
Creates a new elastic constraint object with the specified values.

Parameters:
gridX - see gridX
gridY - see gridY
gridWidth - see gridWidth
gridHeight - see gridHeight
shrinkX - see shrinkX
shrinkY - see shrinkY
stretchX - see stretchX
stretchY - see stretchY
anchor - see anchor
fill - see fill
limitPolicy - see limitPolicy
insets - see insets
Method Detail

clone

public java.lang.Object clone()
Creates a copy of this elastic constraint object.

Overrides:
clone in class java.lang.Object
Returns:
a copy of this elastic constraint object

resetAll

public void resetAll()
Resets all values of this constraints object to their defaults.


setFill

public PXElasticConstraints setFill(int newFill)
Sets the fill of these constraints to newFill and returns this constraints object.


resetFill

public PXElasticConstraints resetFill()
Resets the fill of these constraints to NONE and returns this constraints object.


setAnchor

public PXElasticConstraints setAnchor(int newAnchor)
Sets the anchor of these constraints to newAnchor and returns this constraints object.


resetAnchor

public PXElasticConstraints resetAnchor()
Resets the anchor of these constraints to WEST and returns this constraints object.


setShrinkX

public PXElasticConstraints setShrinkX(double newShrinkX)
Sets the shrinkX of these constraints to newShrinkX and returns this constraints object.


setStretchX

public PXElasticConstraints setStretchX(double newStretchX)
Sets the stretchX of these constraints to newStretchX and returns this constraints object.


setShrinkY

public PXElasticConstraints setShrinkY(double newShrinkY)
Sets the shrinkY of these constraints to newShrinkY and returns this constraints object.


setStretchY

public PXElasticConstraints setStretchY(double newStretchY)
Sets the stretchY of these constraints to newStretchY and returns this constraints object.


setInsets

public PXElasticConstraints setInsets(java.awt.Insets newInsets)
Sets the insets of these constraints to newInsets and returns this constraints object.


setInsets

public PXElasticConstraints setInsets(int top,
                                      int left,
                                      int bottom,
                                      int right)
Sets the insets of these constraints to the given inset values and returns this constraints object.


nextColumn

public PXElasticConstraints nextColumn()
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth and gridHeight is not changed by this method.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

Returns:
this constraints object
See Also:
nextColumn(int), nextColumn(int,int)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth)
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth of the next cell is set to newGridWidth.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(), nextColumn(int,int)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth,
                                       int newGridHeight)
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
newGridHeight - the gridHeight to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(), nextColumn(int)

nextColumn

public PXElasticConstraints nextColumn(PXElasticConstraints baseConstraints)
Sets the gridX of these constraints to the next cell of baseConstraints and returns this constraints object.

The gridWidth of the current cell of baseConstraints is taken into account when calculating the new gridX: If the baseConstraints's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX of this constraints object to 3.

Parameters:
baseConstraints - the baseConstraints to calculate the new gridX of this constraints object
Returns:
this constraints object
See Also:
nextColumn(int,int)

nextColumn

public PXElasticConstraints nextColumn(double newStretchX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The stretchX of the next cell is set to newStretchX.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

Parameters:
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(), setStretchX(double)

nextColumn

public PXElasticConstraints nextColumn(double newStretchX,
                                       double newShrinkX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

Parameters:
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(), setStretchX(double), setShrinkX(double)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth,
                                       double newStretchX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth of the next cell is set to newGridWidth. The stretchX of the next cell is set to newStretchX.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(int), setStretchX(double)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth,
                                       double newStretchX,
                                       double newShrinkX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth of the next cell is set to newGridWidth. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(int), setStretchX(double), setShrinkX(double)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth,
                                       int newGridHeight,
                                       double newStretchX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The stretchX of the next cell is set to newStretchX. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
newGridHeight - the gridHeight to apply to the next cell
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(int, int), setStretchX(double)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth,
                                       int newGridHeight,
                                       double newStretchX,
                                       double newShrinkX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
newGridHeight - the gridHeight to apply to the next cell
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(int, int), setStretchX(double), setShrinkX(double)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth,
                                       int newGridHeight,
                                       int newFill,
                                       double newStretchX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight. The fill of the next cell is set to newFill. The stretchX of the next cell is set to newStretchX.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged. If the newGridHeight's value is less or equal to 0 then the current value of gridHeight remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
newGridHeight - the gridHeight to apply to the next cell
newFill - the fill to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(int,int), setFill(int), setStretchX(double)

nextColumn

public PXElasticConstraints nextColumn(int newGridWidth,
                                       int newGridHeight,
                                       int newFill,
                                       double newStretchX,
                                       double newShrinkX)
Sets the gridX of these constraints to the next cell and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight. The fill of the next cell is set to newFill. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridWidth of the current cell is taken into account when calculating the new gridX: If the current cell's gridX is 1 and its gridWidth is 2 then nextColumn sets gridX to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged. If the newGridHeight's value is less or equal to 0 then the current value of gridHeight remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the next cell
newGridHeight - the gridHeight to apply to the next cell
newFill - the fill to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextColumn(int,int), setFill(int), setStretchX(double), setShrinkX(double)

nextRow

public PXElasticConstraints nextRow()
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth and gridHeight is not changed by this method.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

Returns:
this constraints object
See Also:
nextRow(int), nextRow(int,int)

nextRow

public PXElasticConstraints nextRow(int newGridWidth)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
Returns:
this constraints object
See Also:
nextRow(), nextRow(int,int)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    int newGridHeight)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newGridHeight - the gridHeight to apply to the first cell of the next row
Returns:
this constraints object
See Also:
nextRow(), nextRow(int)

nextRow

public PXElasticConstraints nextRow(PXElasticConstraints baseConstraints)
Sets the gridY of these constraints to the next cell of baseConstraints and returns this constraints object.

The gridHeight of the current cell of baseConstraints is taken into account when calculating the new gridY: If the baseConstraints's gridY is 1 and its gridHeight is 2 then nextRow sets gridY of this constraints object to 3.

Parameters:
baseConstraints - the baseConstraints to calculate the new gridY of this constraints object
Returns:
this constraints object
See Also:
nextColumn(int,int)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    int newGridHeight,
                                    int newFill)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight and the fill of the next cell is set to newFill.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged. If the newGridHeight's value is less or equal to 0 then the current value of gridHeight remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newGridHeight - the gridHeight to apply to the first cell of the next row
newFill - the fill to apply to the first cell of the next row
Returns:
this constraints object
See Also:
nextRow(int,int), setFill(int)

nextRow

public PXElasticConstraints nextRow(double newStretchX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth and gridHeight is not changed by this method. The stretchX of the next cell is set to newStretchX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

Parameters:
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(), setStretchX(double)

nextRow

public PXElasticConstraints nextRow(double newStretchX,
                                    double newShrinkX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth and gridHeight is not changed by this method. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

Parameters:
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(), setStretchX(double), setShrinkX(double)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    double newStretchX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth. The stretchX of the next cell is set to newStretchX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(int), setStretchX(double)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    double newStretchX,
                                    double newShrinkX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(int), setStretchX(double), setShrinkX(double)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    int newGridHeight,
                                    double newStretchX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight. The stretchX of the next cell is set to newStretchX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newGridHeight - the gridHeight to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(int,int), setStretchX(double)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    int newGridHeight,
                                    double newStretchX,
                                    double newShrinkX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newGridHeight - the gridHeight to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(int,int), setStretchX(double), setShrinkX(double)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    int newGridHeight,
                                    int newFill,
                                    double newStretchX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight and the fill of the next cell is set to newFill. The stretchX of the next cell is set to newStretchX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged. If the newGridHeight's value is less or equal to 0 then the current value of gridHeight remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newGridHeight - the gridHeight to apply to the first cell of the next row
newFill - the fill to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(int,int,int), setStretchX(double)

nextRow

public PXElasticConstraints nextRow(int newGridWidth,
                                    int newGridHeight,
                                    int newFill,
                                    double newStretchX,
                                    double newShrinkX)
Sets the gridY of these constraints to the first cell in the next row and returns this constraints object. The gridWidth of the next cell is set to newGridWidth, the gridHeight of the next cell is set to newGridHeight and the fill of the next cell is set to newFill. The stretchX of the next cell is set to newStretchX. The shrinkX of the next cell is set to newShrinkX.

The gridHeight of the current cell is taken into account when calculating the new gridY: If the current cell's gridY is 1 and its gridHeight is 2 then nextRow sets gridY to 3.

If the newGridWidth's value is less or equal to 0 then the current value of gridWidth remains unchanged. If the newGridHeight's value is less or equal to 0 then the current value of gridHeight remains unchanged.

Parameters:
newGridWidth - the gridWidth to apply to the first cell of the next row
newGridHeight - the gridHeight to apply to the first cell of the next row
newFill - the fill to apply to the first cell of the next row
newStretchX - the stretchX to apply to the next cell
newShrinkX - the shrinkX to apply to the next cell
Returns:
this constraints object
See Also:
nextRow(int,int,int), setStretchX(double), setShrinkX(double)

isHeedingMaximumHeight

public boolean isHeedingMaximumHeight()
Gets whether or not the layout manager should heed the maximum height of the associated component.

Returns:
true if the layout manager should heed the maximum height of the associated component, else false

isHeedingMaximumWidth

public boolean isHeedingMaximumWidth()
Gets whether or not the layout manager should heed the maximum width of the associated component.

Returns:
true if the layout manager should heed the maximum width of the associated component, else false

isHeedingMinimumHeight

public boolean isHeedingMinimumHeight()
Gets whether or not the layout manager should heed the minimum height of the associated component.

Returns:
true if the layout manager should heed the minimum height of the associated component, else false

isHeedingMinimumWidth

public boolean isHeedingMinimumWidth()
Gets whether or not the layout manager should heed the minimum width of the associated component.

Returns:
true if the layout manager should heed the minimum width of the associated component, else false

isCuttingOutOfBounds

public boolean isCuttingOutOfBounds()
Gets whether or not the layout manager should cut the associated component off the layout if it is resized below its minimum size.

Returns:
true if the layout manager should cut the associated component off, else false

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getAnchorString

public java.lang.String getAnchorString()
Returns a string representation of the anchor-parameter of this constraints object.

Returns:
a string representation of the anchor-parameter of this constraints object

getFillString

public java.lang.String getFillString()
Returns a string representation of the fill-parameter of this constraints object.

Returns:
a string representation of the fill-parameters of this constraints object

getLimitPolicyString

public java.lang.String getLimitPolicyString()
Returns a string representation of the limitPolicy-parameter of this constraints object.

Returns:
a string representation of the limitPolicy-parameters of this constraints object

paramString

public java.lang.String paramString()
Returns a string representation of the parameters of this constraints object.

Returns:
a string representation of the parameters of this constraints object
See Also:
toString()

toString

public java.lang.String toString()
Returns a string representation of this constraints object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this constraints object
See Also:
paramString()


Copyright © 2008. All Rights Reserved.