Package com.jgoodies.forms.builder
Class FormBuilder.ComponentAdder
- java.lang.Object
-
- com.jgoodies.forms.builder.FormBuilder.ComponentAdder
-
- Direct Known Subclasses:
FormBuilder.NoOpComponentAdder
- Enclosing class:
- FormBuilder
public static class FormBuilder.ComponentAdder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected FormBuilder
builder
private java.awt.Component
component
private boolean
labelForSet
-
Constructor Summary
Constructors Constructor Description ComponentAdder(FormBuilder builder, java.awt.Component component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FormBuilder
add(CellConstraints constraints)
FormBuilder
at(CellConstraints constraints)
Sets the given cell constraints.FormBuilder.ComponentAdder
labelFor(java.awt.Component c)
FormBuilder
rc(int row, int col)
Sets row and column origins; sets height and width to 1; uses the default alignments.FormBuilder
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.FormBuilder
rc(int row, int col, java.lang.String encodedAlignments)
Sets row and column origins; sets height and width to 1; decodes vertical and horizontal alignments from the given string.FormBuilder
rchw(int row, int col, int rowSpan, int colSpan)
Sets the row, column, height, and width; uses default alignments.FormBuilder
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.FormBuilder
rchw(int row, int col, int rowSpan, int colSpan, java.lang.String encodedAlignments)
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.FormBuilder
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.FormBuilder
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.FormBuilder
rcw(int row, int col, int colSpan, java.lang.String encodedAlignments)
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.FormBuilder
xy(int col, int row)
Sets column and row origins; sets width and height to 1; uses the default alignments.FormBuilder
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.FormBuilder
xy(int col, int row, java.lang.String encodedAlignments)
Sets column and row origins; sets width and height to 1; decodes horizontal and vertical alignments from the given string.FormBuilder
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.FormBuilder
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.FormBuilder
xyw(int col, int row, int colSpan, java.lang.String encodedAlignments)
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.FormBuilder
xywh(int col, int row, int colSpan, int rowSpan)
Sets the column, row, width, and height; uses default alignments.FormBuilder
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.FormBuilder
xywh(int col, int row, int colSpan, int rowSpan, java.lang.String encodedAlignments)
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.
-
-
-
Field Detail
-
builder
protected final FormBuilder builder
-
component
private final java.awt.Component component
-
labelForSet
private boolean labelForSet
-
-
Constructor Detail
-
ComponentAdder
ComponentAdder(FormBuilder builder, java.awt.Component component)
-
-
Method Detail
-
labelFor
public final FormBuilder.ComponentAdder labelFor(java.awt.Component c)
-
at
public final FormBuilder at(CellConstraints constraints)
Sets the given cell constraints.Examples:
.add(aComponent).at(cellConstraints)
- Parameters:
constraints
- specifies where an how to place a component- Returns:
- a reference to the builder
-
xy
public final FormBuilder xy(int col, int row)
Sets column and row origins; sets width and height to 1; uses the default alignments.Examples:
.add(aComponent).xy(1, 1) .add(aComponent).xy(1, 3)
- Parameters:
col
- the column indexrow
- the row index- Returns:
- a reference to the builder
-
xy
public final FormBuilder xy(int col, int row, java.lang.String encodedAlignments)
Sets column and row origins; sets width and height to 1; decodes horizontal and vertical alignments from the given string.Examples:
.add(aComponent).xy(1, 3, "left, bottom"); .add(aComponent).xy(1, 3, "l, b"); .add(aComponent).xy(1, 3, "center, fill"); .add(aComponent).xy(1, 3, "c, f");
- Parameters:
col
- the column indexrow
- the row indexencodedAlignments
- describes the horizontal and vertical alignments- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
xy
public final FormBuilder 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:
.add(aComponent).xy(1, 3, CellConstraints.LEFT, CellConstraints.BOTTOM); .add(aComponent).xy(1, 3, CellConstraints.CENTER, CellConstraints.FILL);
- Parameters:
col
- the column indexrow
- the row indexcolAlign
- horizontal component alignmentrowAlign
- vertical component alignment- Returns:
- a reference to the builder
-
xyw
public final FormBuilder 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.Examples:
.add(aComponent).xyw(1, 3, 7); .add(aComponent).xyw(1, 3, 2);
- Parameters:
col
- the column indexrow
- the row indexcolSpan
- the column span or grid width- Returns:
- a reference to the builder
-
xyw
public final FormBuilder xyw(int col, int row, int colSpan, java.lang.String encodedAlignments)
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:
.add(aComponent).xyw(1, 3, 7, "left, bottom") .add(aComponent).xyw(1, 3, 7, "l, b"); .add(aComponent).xyw(1, 3, 2, "center, fill"); .add(aComponent).xyw(1, 3, 2, "c, f");
- Parameters:
col
- the column indexrow
- the row indexcolSpan
- the column span or grid widthencodedAlignments
- describes the horizontal and vertical alignments- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
xyw
public final FormBuilder 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:
.add(aComponent).xyw(1, 3, 2, CellConstraints.LEFT, CellConstraints.BOTTOM); .add(aComponent).xyw(1, 3, 7, CellConstraints.CENTER, CellConstraints.FILL);
- Parameters:
col
- the column indexrow
- the row indexcolSpan
- the column span or grid widthcolAlign
- horizontal component alignmentrowAlign
- vertical component alignment- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
xywh
public final FormBuilder xywh(int col, int row, int colSpan, int rowSpan)
Sets the column, row, width, and height; uses default alignments.Examples:
.add(aComponent).xywh(1, 3, 2, 1); .add(aComponent).xywh(1, 3, 7, 3);
- Parameters:
col
- the column indexrow
- the row indexcolSpan
- the column span or grid widthrowSpan
- the row span or grid height- Returns:
- a reference to the builder
-
xywh
public final FormBuilder xywh(int col, int row, int colSpan, int rowSpan, java.lang.String encodedAlignments)
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.Examples:
.add(aComponent).xywh(1, 3, 2, 1, "left, bottom"); .add(aComponent).xywh(1, 3, 2, 1, "l, b"); .add(aComponent).xywh(1, 3, 7, 3, "center, fill"); .add(aComponent).xywh(1, 3, 7, 3, "c, f");
- Parameters:
col
- the column indexrow
- the row indexcolSpan
- the column span or grid widthrowSpan
- the row span or grid heightencodedAlignments
- describes the horizontal and vertical alignments- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
xywh
public final FormBuilder 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:
.add(aComponent).xywh(1, 3, 2, 1, CellConstraints.LEFT, CellConstraints.BOTTOM); .add(aComponent).xywh(1, 3, 7, 3, CellConstraints.CENTER, CellConstraints.FILL);
- Parameters:
col
- the column indexrow
- the row indexcolSpan
- the column span or grid widthrowSpan
- the row span or grid heightcolAlign
- horizontal component alignmentrowAlign
- vertical component alignment- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
rc
public final FormBuilder rc(int row, int col)
Sets row and column origins; sets height and width to 1; uses the default alignments.Examples:
.add(aComponent).rc(1, 1) .add(aComponent).rc(3, 1)
- Parameters:
row
- the row indexcol
- the column index- Returns:
- a reference to the builder
-
rc
public final FormBuilder rc(int row, int col, java.lang.String encodedAlignments)
Sets row and column origins; sets height and width to 1; decodes vertical and horizontal alignments from the given string.Examples:
.add(aComponent).rc(3, 1, "bottom, left") .add(aComponent).rc(3, 1, "b, l") .add(aComponent).rc(3, 1, "fill, center") .add(aComponent).rc(3, 1, "f, c")
- Parameters:
row
- the row indexcol
- the column indexencodedAlignments
- describes the vertical and horizontal alignments- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
rc
public final FormBuilder 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:
.add(aComponent).rc(3, 1, CellConstraints.BOTTOM, CellConstraints.LEFT); .add(aComponent).rc(3, 1, CellConstraints.FILL, CellConstraints.CENTER);
- Parameters:
row
- the row indexcol
- the column indexrowAlign
- vertical component alignmentcolAlign
- horizontal component alignment- Returns:
- a reference to the builder
-
rcw
public final FormBuilder 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.Examples:
.add(aComponent).rcw(3, 1, 7); .add(aComponent).rcw(3, 1, 2);
- Parameters:
row
- the row indexcol
- the column indexcolSpan
- the column span or grid width- Returns:
- a reference to the builder
-
rcw
public final FormBuilder rcw(int row, int col, int colSpan, java.lang.String encodedAlignments)
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:
.add(aComponent).rcw(3, 1, 7, "bottom, left"); .add(aComponent).rcw(3, 1, 7, "b, l"); .add(aComponent).rcw(3, 1, 2, "fill, center"); .add(aComponent).rcw(3, 1, 2, "f, c");
- Parameters:
row
- the row indexcol
- the column indexcolSpan
- the column span or grid widthencodedAlignments
- describes the vertical and horizontal alignments- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
rcw
public final FormBuilder 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:
.add(aComponent).rcw(3, 1, 2, CellConstraints.BOTTOM, CellConstraints.LEFT); .add(aComponent).rcw(3, 1, 7, CellConstraints.FILL, CellConstraints.CENTER);
- Parameters:
row
- the row indexcol
- the column indexcolSpan
- the column span or grid widthrowAlign
- vertical component alignmentcolAlign
- horizontal component alignment- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
rchw
public final FormBuilder rchw(int row, int col, int rowSpan, int colSpan)
Sets the row, column, height, and width; uses default alignments.Examples:
.add(aComponent).rchw(1, 3, 2, 1); .add(aComponent).rchw(1, 3, 7, 3);
- Parameters:
row
- the row indexcol
- the column indexrowSpan
- the row span or grid heightcolSpan
- the column span or grid width- Returns:
- a reference to the builder
-
rchw
public final FormBuilder rchw(int row, int col, int rowSpan, int colSpan, java.lang.String encodedAlignments)
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.Examples:
.add(aComponent).rchw(3, 1, 1, 2, "bottom, left"); .add(aComponent).rchw(3, 1, 1, 2, "b, l"); .add(aComponent).rchw(3, 1, 3, 7, "fill, center"); .add(aComponent).rchw(3, 1, 3, 7, "f, c");
- Parameters:
row
- the row indexcol
- the column indexrowSpan
- the row span or grid heightcolSpan
- the column span or grid widthencodedAlignments
- describes the vertical and horizontal alignments- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
rchw
public final FormBuilder 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:
.add(aComponent).rchw(3, 1, 1, 2, CellConstraints.BOTTOM, CellConstraints.LEFT); .add(aComponent).rchw(3, 1, 3, 7, CellConstraints.FILL, CellConstraints.CENTER);
- Parameters:
row
- the row indexcol
- the column indexrowSpan
- the row span or grid heightcolSpan
- the column span or grid widthrowAlign
- vertical component alignmentcolAlign
- horizontal component alignment- Returns:
- a reference to the builder
- Throws:
java.lang.IllegalArgumentException
- if an alignment orientation is invalid
-
add
protected FormBuilder add(CellConstraints constraints)
-
-