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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FormBuilder
private final Component
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FormBuilder
add
(CellConstraints constraints) final FormBuilder
at
(CellConstraints constraints) Sets the given cell constraints.final FormBuilder
rc
(int row, int col) Sets row and column origins; sets height and width to 1; uses the default alignments.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.final FormBuilder
Sets row and column origins; sets height and width to 1; decodes vertical and horizontal alignments from the given string.final FormBuilder
rchw
(int row, int col, int rowSpan, int colSpan) Sets the row, column, height, and width; uses default alignments.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.final FormBuilder
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.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.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.final FormBuilder
Sets the row, column, height, and width; decodes the vertical and horizontal alignments from the given string.final FormBuilder
xy
(int col, int row) Sets column and row origins; sets width and height to 1; uses the default alignments.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.final FormBuilder
Sets column and row origins; sets width and height to 1; decodes horizontal and vertical alignments from the given string.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.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.final FormBuilder
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.final FormBuilder
xywh
(int col, int row, int colSpan, int rowSpan) Sets the column, row, width, and height; uses default alignments.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.final FormBuilder
Sets the column, row, width, and height; decodes the horizontal and vertical alignments from the given string.
-
Field Details
-
builder
-
component
-
labelForSet
private boolean labelForSet
-
-
Constructor Details
-
ComponentAdder
ComponentAdder(FormBuilder builder, Component component)
-
-
Method Details
-
labelFor
-
at
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
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
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:
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
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
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:
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:
IllegalArgumentException
- if an alignment orientation is invalid
-
xywh
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
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:
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:
IllegalArgumentException
- if an alignment orientation is invalid
-
rc
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
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:
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
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
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:
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:
IllegalArgumentException
- if an alignment orientation is invalid
-
rchw
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
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:
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:
IllegalArgumentException
- if an alignment orientation is invalid
-
add
-