|
||||||||||
| 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
com.jgoodies.forms.builder.ButtonBarBuilder
public final class ButtonBarBuilder
A non-visual builder for building consistent button bars that compl
with popular style guides. Utilizes the JGoodies FormLayoutLayoutStyle regarding button sizes
and gaps.
Examples:
ButtonStackBuilder,
LayoutStyle| Field Summary |
|---|
| Fields inherited from class com.jgoodies.forms.builder.AbstractButtonPanelBuilder |
|---|
focusGrouped |
| Fields inherited from class com.jgoodies.forms.builder.AbstractBuilder |
|---|
currentCellConstraints |
| Constructor Summary | |
|---|---|
ButtonBarBuilder()
Constructs an empty ButtonBarBuilder on a JPanel. |
|
ButtonBarBuilder(JPanel panel)
Constructs an empty ButtonBarBuilder on the given panel. |
|
| Method Summary | |
|---|---|
ButtonBarBuilder |
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. |
ButtonBarBuilder |
addButton(JComponent... buttons)
Adds one or many sequences of related buttons. |
ButtonBarBuilder |
addButton(JComponent button)
Adds a button component that has a minimum widt specified by the LayoutStyle.getDefaultButtonWidth(). |
ButtonBarBuilder |
addFixed(JComponent component)
Adds a fixed size component with narrow margin. |
ButtonBarBuilder |
addGlue()
Adds a glue that will be given the extra space if this button bar is larger than its preferred size. |
ButtonBarBuilder |
addGrowing(JComponent component)
Adds a component that grows if the container grows. |
ButtonBarBuilder |
addRelatedGap()
Adds the standard horizontal gap for related components. |
ButtonBarBuilder |
addStrut(ConstantSize width)
Adds a horizontal strut of the specified width. |
ButtonBarBuilder |
addUnrelatedGap()
Adds the standard horizontal gap for unrelated components. |
ButtonBarBuilder |
background(Color background)
Sets the panel's background color and makes the panel opaque. |
ButtonBarBuilder |
border(Border border)
Sets the panel's border. |
ButtonBarBuilder |
opaque(boolean b)
Sets the panel's opaque state. |
| Methods inherited from class com.jgoodies.forms.builder.AbstractButtonPanelBuilder |
|---|
add, appendColumn, appendGlueColumn, appendGlueRow, appendRelatedComponentsGapColumn, appendRelatedComponentsGapRow, appendRow, appendUnrelatedComponentsGapColumn, appendUnrelatedComponentsGapRow, build, createButton, getColumn, getPanel, getRow, isLeftToRight, nextColumn, nextRow, setBackground, setBorder, setLeftToRight, setOpaque |
| 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 |
| Constructor Detail |
|---|
public ButtonBarBuilder()
public ButtonBarBuilder(JPanel panel)
panel - the layout container| Method Detail |
|---|
public ButtonBarBuilder addButton(JComponent button)
LayoutStyle.getDefaultButtonWidth().
addButton in class AbstractButtonPanelBuilderbutton - the component to add
NullPointerException - if button is nullpublic ButtonBarBuilder addButton(JComponent... buttons)
AbstractButtonPanelBuildernull. 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:
addButton in class AbstractButtonPanelBuilderbuttons - the buttons to add
AbstractButtonPanelBuilder.addButton(JComponent)public ButtonBarBuilder addButton(Action... actions)
AbstractButtonPanelBuilder
addButton in class AbstractButtonPanelBuilderactions - an array of buttons to addpublic ButtonBarBuilder addFixed(JComponent component)
component - the component to add
public ButtonBarBuilder addGrowing(JComponent component)
LayoutStyle.getDefaultButtonWidth().
component - the component to add
public ButtonBarBuilder addGlue()
public ButtonBarBuilder addRelatedGap()
addRelatedGap in class AbstractButtonPanelBuilderLayoutStyle.getRelatedComponentsPadX()public ButtonBarBuilder addUnrelatedGap()
addUnrelatedGap in class AbstractButtonPanelBuilderLayoutStyle.getUnrelatedComponentsPadX()public ButtonBarBuilder addStrut(ConstantSize width)
addRelatedGap()addUnrelatedGap() respectively.
width - describes the gap width
ColumnSpec.createGap(ConstantSize)public ButtonBarBuilder background(Color background)
AbstractButtonPanelBuilder
background in class AbstractButtonPanelBuilderbackground - the color to set as new backgroundJComponent.setBackground(Color)public ButtonBarBuilder border(Border border)
AbstractButtonPanelBuilder
border in class AbstractButtonPanelBuilderborder - the border to setJComponent.setBorder(Border)public ButtonBarBuilder opaque(boolean b)
AbstractButtonPanelBuilder
opaque in class AbstractButtonPanelBuilderb - true for opaque, false for non-opaqueJComponent.setOpaque(boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||