Package com.jgoodies.forms.builder
Class AbstractButtonPanelBuilder
java.lang.Object
com.jgoodies.forms.builder.AbstractButtonPanelBuilder
- Direct Known Subclasses:
ButtonBarBuilder2
The abstract superclass for
ButtonBarBuilder2
.
Provides a cell cursor for traversing
the button bar/stack while components are added. It also offers
convenience methods to append logical columns and rows.TODO: Mention the ButtonStackBuilder2 subclass as soon as it is available.
- Since:
- 1.2
- Version:
- $Revision: 1.7 $
- Author:
- Karsten Lentzsch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
The client property key used to indicate that a button shall get narrow margins on the left and right hand side. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractButtonPanelBuilder
(FormLayout layout, JPanel container) Constructs aAbstractFormBuilder
for the given FormLayout and layout container. -
Method Summary
Modifier and TypeMethodDescriptionprotected final Component
Adds a component to the container using the default cell constraints.protected final void
appendColumn
(ColumnSpec columnSpec) Appends the given column specification to the builder's layout.protected final void
Appends a glue column.protected final void
Appends a glue row.protected final void
Appends a column that is the default gap for related components.protected final void
Appends a row that is the default gap for related components.protected final void
Appends the given row specification to the builder's layout.protected final void
Appends a column that is the default gap for unrelated components.protected final void
Appends a row that is the default gap for unrelated components.protected int
final JPanel
Returns the container used to build the form.final FormLayout
Returns the instance ofFormLayout
used to build this form.final JPanel
getPanel()
Returns the panel used to build the form.final boolean
Returns whether this builder fills the form left-to-right or right-to-left.protected final void
Moves to the next column, does the same as #nextColumn(1).protected final void
nextRow()
Increases the row by one; does the same as #nextRow(1).final void
setBackground
(Color background) Sets the panel's background color.final void
Sets the panel's border.final void
setLeftToRight
(boolean b) Sets the form fill direction to left-to-right or right-to-left.final void
setOpaque
(boolean b) Sets the panel's opaque state.
-
Field Details
-
NARROW_KEY
The client property key used to indicate that a button shall get narrow margins on the left and right hand side.This optional setting will be honored by all JGoodies Look&Feel implementations. The Mac Aqua l&f uses narrow margins only. Other look&feel implementations will likely ignore this key and so may render a wider button margin.
- See Also:
-
-
Constructor Details
-
AbstractButtonPanelBuilder
Constructs aAbstractFormBuilder
for the given FormLayout and layout container.- Parameters:
layout
- theFormLayout
to usecontainer
- the layout container- Throws:
NullPointerException
- if the layout or container is null
-
-
Method Details
-
getContainer
Returns the container used to build the form.- Returns:
- the layout container, a {code JPanel}.
-
getPanel
Returns the panel used to build the form.- Returns:
- the panel used by this builder to build the form
-
getLayout
Returns the instance ofFormLayout
used to build this form.- Returns:
- the FormLayout
-
setBackground
Sets the panel's background color.- Parameters:
background
- the color to set as new background- See Also:
-
setBorder
Sets the panel's border.- Parameters:
border
- the border to set- See Also:
-
setOpaque
public final void setOpaque(boolean b) Sets the panel's opaque state.- Parameters:
b
- true for opaque, false for non-opaque- Since:
- 1.1
- See Also:
-
isLeftToRight
public final boolean isLeftToRight()Returns whether this builder fills the form left-to-right or right-to-left. The initial value of this property is set during the builder construction from the layout container'scomponentOrientation
property.- Returns:
- true indicates left-to-right, false indicates right-to-left
- See Also:
-
setLeftToRight
public final void setLeftToRight(boolean b) Sets the form fill direction to left-to-right or right-to-left. The initial value of this property is set during the builder construction from the layout container'scomponentOrientation
property.- Parameters:
b
- true indicates left-to-right, false right-to-left- See Also:
-
nextColumn
protected final void nextColumn()Moves to the next column, does the same as #nextColumn(1). -
getColumn
protected int getColumn() -
nextRow
protected final void nextRow()Increases the row by one; does the same as #nextRow(1). -
appendColumn
Appends the given column specification to the builder's layout.- Parameters:
columnSpec
- the column specification object to append
-
appendGlueColumn
protected final void appendGlueColumn()Appends a glue column.- See Also:
-
appendRelatedComponentsGapColumn
protected final void appendRelatedComponentsGapColumn()Appends a column that is the default gap for related components.- See Also:
-
appendRow
Appends the given row specification to the builder's layout.- Parameters:
rowSpec
- the row specification object to append
-
appendGlueRow
protected final void appendGlueRow()Appends a glue row.- See Also:
-
appendRelatedComponentsGapRow
protected final void appendRelatedComponentsGapRow()Appends a row that is the default gap for related components.- See Also:
-
add
Adds a component to the container using the default cell constraints. Note that when building from left to right, this method won't adjust the cell constraints if the column span is larger than 1.- Parameters:
component
- the component to add- Returns:
- the added component
-