public final class ButtonStackBuilder extends AbstractButtonPanelBuilder
FormLayout and honors the platform'
LayoutStyle regarding button sizes, and gaps.Example:
Close, Up an
Down, where Up and Down are related, and Close is not relate
to the other buttons, which makes a wide gap for the unrelated an
a smaller gap for the related buttons
ButtonBarBuilder,
LayoutStylefocusGroupedcurrentCellConstraints| Constructor and Description |
|---|
ButtonStackBuilder()
Constructs a ButtonStackBuilder on a default JPane
using a pre-configured FormLayout as layout manager.
|
ButtonStackBuilder(JPanel panel)
Constructs a ButtonStackBuilder on the given pane
using a pre-configured FormLayout as layout manager.
|
| Modifier and Type | Method and Description |
|---|---|
ButtonStackBuilder |
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.
|
ButtonStackBuilder |
addButton(JComponent... buttons)
Adds one or many sequences of related buttons.
|
ButtonStackBuilder |
addButton(JComponent button)
Adds a button component that has a minimum widt
specified by the
LayoutStyle.getDefaultButtonWidth(). |
ButtonStackBuilder |
addFixed(JComponent component)
Adds a fixed size component.
|
ButtonStackBuilder |
addGlue()
Adds a glue that will be given the extra space
if this box is larger than its preferred size.
|
ButtonStackBuilder |
addRelatedGap()
Adds the standard gap for related components.
|
ButtonStackBuilder |
addStrut(ConstantSize size)
Adds a strut of a specified size.
|
ButtonStackBuilder |
addUnrelatedGap()
Adds the standard gap for unrelated components.
|
ButtonStackBuilder |
background(Color background)
Sets the panel's background color and makes the panel opaque.
|
ButtonStackBuilder |
border(Border border)
Sets the panel's border.
|
static ButtonStackBuilder |
create()
Creates and returns an empty ButtonStackBuilder.
|
ButtonStackBuilder |
opaque(boolean b)
Sets the panel's opaque state.
|
add, appendColumn, appendGlueColumn, appendGlueRow, appendRelatedComponentsGapColumn, appendRelatedComponentsGapRow, appendRow, appendUnrelatedComponentsGapColumn, appendUnrelatedComponentsGapRow, build, createButton, getColumn, getPanel, getRow, isLeftToRight, nextColumn, nextRow, setBackground, setBorder, setLeftToRight, setOpaquecreateComponentFactory, getColumnCount, getComponentFactory, getContainer, getLayout, getRowCount, setComponentFactorypublic ButtonStackBuilder()
public ButtonStackBuilder(JPanel panel)
panel - the layout containerpublic static ButtonStackBuilder create()
public ButtonStackBuilder addButton(JComponent button)
LayoutStyle.getDefaultButtonWidth().
addButton in class AbstractButtonPanelBuilderbutton - the component to addNullPointerException - if button is nullpublic ButtonStackBuilder 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 addAbstractButtonPanelBuilder.addButton(JComponent)public ButtonStackBuilder addButton(Action... actions)
AbstractButtonPanelBuilderaddButton in class AbstractButtonPanelBuilderactions - an array of buttons to addpublic ButtonStackBuilder addFixed(JComponent component)
component - the component to addpublic ButtonStackBuilder addGlue()
public ButtonStackBuilder addRelatedGap()
AbstractButtonPanelBuilderaddRelatedGap in class AbstractButtonPanelBuilderpublic ButtonStackBuilder addUnrelatedGap()
AbstractButtonPanelBuilderaddUnrelatedGap in class AbstractButtonPanelBuilderpublic ButtonStackBuilder addStrut(ConstantSize size)
size - a constant that describes the gappublic ButtonStackBuilder background(Color background)
AbstractButtonPanelBuilderbackground in class AbstractButtonPanelBuilderbackground - the color to set as new backgroundJComponent.setBackground(Color)public ButtonStackBuilder border(Border border)
AbstractButtonPanelBuilderborder in class AbstractButtonPanelBuilderborder - the border to setJComponent.setBorder(Border)public ButtonStackBuilder opaque(boolean b)
AbstractButtonPanelBuilderopaque in class AbstractButtonPanelBuilderb - true for opaque, false for non-opaqueJComponent.setOpaque(boolean)Copyright © 2002-2014 JGoodies Software GmbH. All Rights Reserved.