Package com.jgoodies.forms.factories
Class CC
java.lang.Object
com.jgoodies.forms.factories.CC
- All Implemented Interfaces:
Serializable
,Cloneable
A factory for CellConstraints objects.
Examples:
The following cell constraints locate a component in the third column of the fifth row; column and row span are 1; the component will be aligned with the column's right-hand side and the row's bottom.
The following cell constraints locate a component in the third column of the fifth row; column and row span are 1; the component will be aligned with the column's right-hand side and the row's bottom.
CC.xy (3, 5); CC.xy (3, 5, CC.RIGHT, CC.BOTTOM); CC.xy (3, 5, "right, bottom"); CC.xyw (3, 5, 1); CC.xyw (3, 5, 1, CC.RIGHT, CC.BOTTOM); CC.xyw (3, 5, 1, "right, bottom"); CC.xywh(3, 5, 1, 1); CC.xywh(3, 5, 1, 1, CC.RIGHT, CC.BOTTOM); CC.xywh(3, 5, 1, 1, "right, bottom");See also the examples in the
FormLayout
class comment.- Since:
- 1.3
- Version:
- $Revision: 1.3 $
- Author:
- Karsten Lentzsch
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CellConstraints.Alignment
static final CellConstraints.Alignment
static final CellConstraints.Alignment
static final CellConstraints.Alignment
static final CellConstraints.Alignment
static final CellConstraints.Alignment
static final CellConstraints.Alignment
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CellConstraints
rc
(int row, int col) Sets row and column origins; sets height and width to 1; uses the default alignments.static CellConstraints
rc
(int row, int col, CellConstraints.Alignment rowAlign, CellConstraints.Alignment colAlign) Sets the row and column origins; sets width and height to 1; set horizontal and vertical alignment using the specified objects.static CellConstraints
Sets row and column origins; sets height and width to 1; decodes vertical and horizontal alignments from the given string.static CellConstraints
rchw
(int row, int col, int rowSpan, int colSpan) Sets the row, column, height, and width; uses default alignments.static CellConstraints
rchw
(int row, int col, int rowSpan, int colSpan, CellConstraints.Alignment rowAlign, CellConstraints.Alignment colAlign) Sets the row, column, height, and width; sets the vertical and horizontal alignment using the specified alignment objects.static CellConstraints
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.static CellConstraints
rcw
(int row, int col, int colSpan) Sets the row, column, height, and width; uses a height (row span) of 1 and the vertical and horizontal default alignments.static CellConstraints
rcw
(int row, int col, int colSpan, CellConstraints.Alignment rowAlign, CellConstraints.Alignment colAlign) Sets the row, column, height, and width; sets the vertical and horizontal alignment using the specified alignment objects.static CellConstraints
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.static CellConstraints
xy
(int col, int row) Sets column and row origins; sets width and height to 1; uses the default alignments.static CellConstraints
xy
(int col, int row, CellConstraints.Alignment colAlign, CellConstraints.Alignment rowAlign) Sets the column and row origins; sets width and height to 1; set horizontal and vertical alignment using the specified objects.static CellConstraints
Sets column and row origins; sets width and height to 1; decodes horizontal and vertical alignments from the given string.static CellConstraints
xyw
(int col, int row, int colSpan) Sets the column, row, width, and height; uses a height (row span) of 1 and the horizontal and vertical default alignments.static CellConstraints
xyw
(int col, int row, int colSpan, CellConstraints.Alignment colAlign, CellConstraints.Alignment rowAlign) Sets the column, row, width, and height; sets the horizontal and vertical alignment using the specified alignment objects.static CellConstraints
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.static CellConstraints
xywh
(int col, int row, int colSpan, int rowSpan) Sets the column, row, width, and height; uses default alignments.static CellConstraints
xywh
(int col, int row, int colSpan, int rowSpan, CellConstraints.Alignment colAlign, CellConstraints.Alignment rowAlign) Sets the column, row, width, and height; sets the horizontal and vertical alignment using the specified alignment objects.static CellConstraints
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.
-
Field Details
-
DEFAULT
-
FILL
-
LEFT
-
RIGHT
-
CENTER
-
TOP
-
BOTTOM
-
-
Constructor Details
-
CC
public CC()
-
-
Method Details
-
xy
Sets column and row origins; sets width and height to 1; uses the default alignments.Examples:
CC.xy(1, 1); CC.xy(1, 3);
- Parameters:
col
- the new column indexrow
- the new row index- Returns:
- this
-
xy
Sets column and row origins; sets width and height to 1; decodes horizontal and vertical alignments from the given string.Examples:
CC.xy(1, 3, "left, bottom"); CC.xy(1, 3, "l, b"); CC.xy(1, 3, "center, fill"); CC.xy(1, 3, "c, f");
- Parameters:
col
- the new column indexrow
- the new row indexencodedAlignments
- describes the horizontal and vertical alignments- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
xy
public static CellConstraints xy(int col, int row, CellConstraints.Alignment colAlign, CellConstraints.Alignment rowAlign) Sets the column and row origins; sets width and height to 1; set horizontal and vertical alignment using the specified objects.Examples:
CC.xy(1, 3, CellConstraints.LEFT, CellConstraints.BOTTOM); CC.xy(1, 3, CellConstraints.CENTER, CellConstraints.FILL);
- Parameters:
col
- the new column indexrow
- the new row indexcolAlign
- horizontal component alignmentrowAlign
- vertical component alignment- Returns:
- this
-
xyw
Sets the column, row, width, and height; uses a height (row span) of 1 and the horizontal and vertical default alignments.Examples:
CC.xyw(1, 3, 7); CC.xyw(1, 3, 2);
- Parameters:
col
- the new column indexrow
- the new row indexcolSpan
- the column span or grid width- Returns:
- this
-
xyw
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string. The row span (height) is set to 1.Examples:
CC.xyw(1, 3, 7, "left, bottom"); CC.xyw(1, 3, 7, "l, b"); CC.xyw(1, 3, 2, "center, fill"); CC.xyw(1, 3, 2, "c, f");
- Parameters:
col
- the new column indexrow
- the new row indexcolSpan
- the column span or grid widthencodedAlignments
- describes the horizontal and vertical alignments- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
xyw
public static CellConstraints xyw(int col, int row, int colSpan, CellConstraints.Alignment colAlign, CellConstraints.Alignment rowAlign) Sets the column, row, width, and height; sets the horizontal and vertical alignment using the specified alignment objects. The row span (height) is set to 1.Examples:
CC.xyw(1, 3, 2, CellConstraints.LEFT, CellConstraints.BOTTOM); CC.xyw(1, 3, 7, CellConstraints.CENTER, CellConstraints.FILL);
- Parameters:
col
- the new column indexrow
- the new row indexcolSpan
- the column span or grid widthcolAlign
- horizontal component alignmentrowAlign
- vertical component alignment- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
xywh
Sets the column, row, width, and height; uses default alignments.Examples:
CC.xywh(1, 3, 2, 1); CC.xywh(1, 3, 7, 3);
- Parameters:
col
- the new column indexrow
- the new row indexcolSpan
- the column span or grid widthrowSpan
- the row span or grid height- Returns:
- this
-
xywh
public static CellConstraints xywh(int col, int row, int colSpan, int rowSpan, String encodedAlignments) Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.Examples:
CC.xywh(1, 3, 2, 1, "left, bottom"); CC.xywh(1, 3, 2, 1, "l, b"); CC.xywh(1, 3, 7, 3, "center, fill"); CC.xywh(1, 3, 7, 3, "c, f");
- Parameters:
col
- the new column indexrow
- the new row indexcolSpan
- the column span or grid widthrowSpan
- the row span or grid heightencodedAlignments
- describes the horizontal and vertical alignments- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
xywh
public static CellConstraints xywh(int col, int row, int colSpan, int rowSpan, CellConstraints.Alignment colAlign, CellConstraints.Alignment rowAlign) Sets the column, row, width, and height; sets the horizontal and vertical alignment using the specified alignment objects.Examples:
CC.xywh(1, 3, 2, 1, CellConstraints.LEFT, CellConstraints.BOTTOM); CC.xywh(1, 3, 7, 3, CellConstraints.CENTER, CellConstraints.FILL);
- Parameters:
col
- the new column indexrow
- the new row indexcolSpan
- the column span or grid widthrowSpan
- the row span or grid heightcolAlign
- horizontal component alignmentrowAlign
- vertical component alignment- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
rc
Sets row and column origins; sets height and width to 1; uses the default alignments.Examples:
CC.rc(1, 1); CC.rc(3, 1);
- Parameters:
row
- the new row indexcol
- the new column index- Returns:
- this
-
rc
Sets row and column origins; sets height and width to 1; decodes vertical and horizontal alignments from the given string.Examples:
CC.rc(3, 1, "bottom, left"); CC.rc(3, 1, "b, l"); CC.rc(3, 1, "fill, center"); CC.rc(3, 1, "f, c");
- Parameters:
row
- the new row indexcol
- the new column indexencodedAlignments
- describes the vertical and horizontal alignments- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
rc
public static CellConstraints rc(int row, int col, CellConstraints.Alignment rowAlign, CellConstraints.Alignment colAlign) Sets the row and column origins; sets width and height to 1; set horizontal and vertical alignment using the specified objects.Examples:
CC.rc(3, 1, CellConstraints.BOTTOM, CellConstraints.LEFT); CC.rc(3, 1, CellConstraints.FILL, CellConstraints.CENTER);
- Parameters:
row
- the new row indexcol
- the new column indexrowAlign
- vertical component alignmentcolAlign
- horizontal component alignment- Returns:
- this
-
rcw
Sets the row, column, height, and width; uses a height (row span) of 1 and the vertical and horizontal default alignments.Examples:
CC.rcw(3, 1, 7); CC.rcw(3, 1, 2);
- Parameters:
row
- the new row indexcol
- the new column indexcolSpan
- the column span or grid width- Returns:
- this
-
rcw
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string. The row span (height) is set to 1.Examples:
CC.rcw(3, 1, 7, "bottom, left"); CC.rcw(3, 1, 7, "b, l"); CC.rcw(3, 1, 2, "fill, center"); CC.rcw(3, 1, 2, "f, c");
- Parameters:
row
- the new row indexcol
- the new column indexcolSpan
- the column span or grid widthencodedAlignments
- describes the vertical and horizontal alignments- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
rcw
public static CellConstraints rcw(int row, int col, int colSpan, CellConstraints.Alignment rowAlign, CellConstraints.Alignment colAlign) Sets the row, column, height, and width; sets the vertical and horizontal alignment using the specified alignment objects. The row span (height) is set to 1.Examples:
CC.rcw(3, 1, 2, CellConstraints.BOTTOM, CellConstraints.LEFT); CC.rcw(3, 1, 7, CellConstraints.FILL, CellConstraints.CENTER);
- Parameters:
row
- the new row indexcol
- the new column indexcolSpan
- the column span or grid widthrowAlign
- vertical component alignmentcolAlign
- horizontal component alignment- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
rchw
Sets the row, column, height, and width; uses default alignments.Examples:
CC.rchw(1, 3, 2, 1); CC.rchw(1, 3, 7, 3);
- Parameters:
row
- the new row indexcol
- the new column indexrowSpan
- the row span or grid heightcolSpan
- the column span or grid width- Returns:
- this
-
rchw
public static CellConstraints rchw(int row, int col, int rowSpan, int colSpan, String encodedAlignments) Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.Examples:
CC.rchw(3, 1, 1, 2, "bottom, left"); CC.rchw(3, 1, 1, 2, "b, l"); CC.rchw(3, 1, 3, 7, "fill, center"); CC.rchw(3, 1, 3, 7, "f, c");
- Parameters:
row
- the new row indexcol
- the new column indexrowSpan
- the row span or grid heightcolSpan
- the column span or grid widthencodedAlignments
- describes the vertical and horizontal alignments- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-
rchw
public static CellConstraints rchw(int row, int col, int rowSpan, int colSpan, CellConstraints.Alignment rowAlign, CellConstraints.Alignment colAlign) Sets the row, column, height, and width; sets the vertical and horizontal alignment using the specified alignment objects.Examples:
CC.rchw(3, 1, 1, 2, CellConstraints.BOTTOM, CellConstraints.LEFT); CC.rchw(3, 1, 3, 7, CellConstraints.FILL, CellConstraints.CENTER);
- Parameters:
row
- the new row indexcol
- the new column indexrowSpan
- the row span or grid heightcolSpan
- the column span or grid widthrowAlign
- vertical component alignmentcolAlign
- horizontal component alignment- Returns:
- this
- Throws:
IllegalArgumentException
- if an alignment orientation is invalid
-