|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jgoodies.forms.builder.AbstractBuilder
com.jgoodies.forms.builder.AbstractButtonPanelBuilder
public abstract class AbstractButtonPanelBuilder
The abstract superclass for ButtonBarBuilder
Provides a cell cursor for traversin
the button bar/stack while components are added. It also offer
convenience methods to append logical columns and rows.
| Field Summary | |
|---|---|
protected boolean |
focusGrouped
Indicates whether a focus group has been built in build(). |
| Fields inherited from class com.jgoodies.forms.builder.AbstractBuilder |
|---|
currentCellConstraints |
| Constructor Summary | |
|---|---|
protected |
AbstractButtonPanelBuilder(FormLayout layout,
JPanel container)
Constructs an AbstractButtonPanelBuilde for the given FormLayout and layout container. |
| Method Summary | |
|---|---|
protected Component |
add(Component component)
Adds a component to the container using the default cell constraints. |
protected AbstractButtonPanelBuilder |
addButton(Action... actions)
Constructs an array of JButtons from the given Action array and adds them as a sequence of related buttons separated by a default gap. |
protected AbstractButtonPanelBuilder |
addButton(JComponent... buttons)
Adds one or many sequences of related buttons. |
protected abstract AbstractButtonPanelBuilder |
addButton(JComponent button)
|
protected abstract AbstractButtonPanelBuilder |
addRelatedGap()
Adds the standard gap for related components. |
protected abstract AbstractButtonPanelBuilder |
addUnrelatedGap()
Adds the standard gap for unrelated components. |
protected void |
appendColumn(ColumnSpec columnSpec)
Appends the given column specification to the builder's layout. |
protected void |
appendGlueColumn()
Appends a glue column. |
protected void |
appendGlueRow()
Appends a glue row. |
protected void |
appendRelatedComponentsGapColumn()
Appends a column that is the default gap for related components. |
protected void |
appendRelatedComponentsGapRow()
Appends a row that is the default gap for related components. |
protected void |
appendRow(RowSpec rowSpec)
Appends the given row specification to the builder's layout. |
protected void |
appendUnrelatedComponentsGapColumn()
Appends a column that is the default gap for unrelated components. |
protected void |
appendUnrelatedComponentsGapRow()
Appends a row that is the default gap for unrelated components. |
protected AbstractButtonPanelBuilder |
background(Color background)
Sets the panel's background color and makes the panel opaque. |
protected AbstractButtonPanelBuilder |
border(Border border)
Sets the panel's border. |
JPanel |
build()
Returns the panel used to build the form and lazily build a focus traversal group for all contained AbstractButtons. |
protected JButton |
createButton(Action action)
Creates and returns a button that is bound to the given Action. |
protected int |
getColumn()
|
JPanel |
getPanel()
Returns the panel used to build the form and lazily build a focus traversal group for all contained AbstractButtons. |
protected int |
getRow()
Returns the cursor's row. |
boolean |
isLeftToRight()
Returns whether this builder fills the form left-to-righ or right-to-left. |
protected void |
nextColumn()
Moves to the next column, does the same as #nextColumn(1). |
protected void |
nextRow()
Increases the row by one; does the same as #nextRow(1). |
protected AbstractButtonPanelBuilder |
opaque(boolean b)
Sets the panel's opaque state. |
void |
setBackground(Color background)
Sets the panel's background color and makes the panel opaque. |
void |
setBorder(Border border)
Sets the panel's border. |
void |
setLeftToRight(boolean b)
Sets the form fill direction to left-to-right or right-to-left. |
void |
setOpaque(boolean b)
Sets the panel's opaque state. |
| Methods inherited from class com.jgoodies.forms.builder.AbstractBuilder |
|---|
createComponentFactory, getColumnCount, getComponentFactory, getComponentFactoryDefault, getContainer, getLayout, getRowCount, setComponentFactory, setComponentFactoryDefault |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean focusGrouped
build()
Reset to false whenever a component is added.
| Constructor Detail |
|---|
protected AbstractButtonPanelBuilder(FormLayout layout,
JPanel container)
layout - the FormLayout to usecontainer - the layout container
NullPointerException - if layout or container is null| Method Detail |
|---|
public JPanel getPanel()
public JPanel build()
protected AbstractButtonPanelBuilder background(Color background)
background - the color to set as new backgroundJComponent.setBackground(Color)protected AbstractButtonPanelBuilder border(Border border)
border - the border to setJComponent.setBorder(Border)protected AbstractButtonPanelBuilder opaque(boolean b)
b - true for opaque, false for non-opaqueJComponent.setOpaque(boolean)public void setBackground(Color background)
background - the color to set as new backgroundJComponent.setBackground(Color)public void setBorder(Border border)
border - the border to setJComponent.setBorder(Border)public void setOpaque(boolean b)
b - true for opaque, false for non-opaqueJComponent.setOpaque(boolean)public final boolean isLeftToRight()
componentOrientation property.
setLeftToRight(boolean),
ComponentOrientationpublic final void setLeftToRight(boolean b)
componentOrientation property.
b - true indicates left-to-right, false right-to-leftisLeftToRight(),
ComponentOrientationprotected final void nextColumn()
protected final int getColumn()
protected final int getRow()
protected final void nextRow()
protected final void appendColumn(ColumnSpec columnSpec)
columnSpec - the column specification object to appendprotected final void appendGlueColumn()
appendRelatedComponentsGapColumn(),
appendUnrelatedComponentsGapColumn()protected final void appendRelatedComponentsGapColumn()
appendGlueColumn(),
appendUnrelatedComponentsGapColumn()protected final void appendUnrelatedComponentsGapColumn()
appendGlueColumn(),
appendRelatedComponentsGapColumn()protected final void appendRow(RowSpec rowSpec)
rowSpec - the row specification object to appendprotected final void appendGlueRow()
appendRelatedComponentsGapRow(),
appendUnrelatedComponentsGapRow()protected final void appendRelatedComponentsGapRow()
appendGlueRow(),
appendUnrelatedComponentsGapRow()protected final void appendUnrelatedComponentsGapRow()
appendGlueRow(),
appendRelatedComponentsGapRow()protected Component add(Component component)
component - the component to add
protected abstract AbstractButtonPanelBuilder addButton(JComponent button)
protected AbstractButtonPanelBuilder addButton(JComponent... buttons)
null. The next sequence is separated by a
unrelated gap
Each button has the minimum width as specified b
LayoutStyle.getDefaultButtonWidth(). The gap width betwee
the buttons is LayoutStyle.getRelatedComponentsPadX().Examples:
buttons - the buttons to add
NullPointerException - if buttons is null
IllegalArgumentException - if buttons is emptyaddButton(JComponent)protected AbstractButtonPanelBuilder addButton(Action... actions)
actions - an array of buttons to addprotected abstract AbstractButtonPanelBuilder addRelatedGap()
protected abstract AbstractButtonPanelBuilder addUnrelatedGap()
protected JButton createButton(Action action)
JGButton configure
the accessible name and accessible description from Action
that provide these information.ComponentFactory.createButton(Action)).
action - provides bound visual properties for the button
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||