Logo Search packages:      
Sourcecode: libjgoodies-forms-java version File versions  Download package

com::jgoodies::forms::builder::ButtonStackBuilder Class Reference

Inheritance diagram for com::jgoodies::forms::builder::ButtonStackBuilder:

com::jgoodies::forms::builder::PanelBuilder com::jgoodies::forms::builder::AbstractFormBuilder

List of all members.

Detailed Description

A non-visual builder that assists you in building consistent button stacks using the FormLayout.

This builder sets a hint for narrow margin for the gridded buttons. This can reduce the button stack's width if some buttons have long texts. For example, a stack with 'OK', 'Cancel', 'Configure...' will likely exceed the minimum button width. The narrow margins help getting narrow stacks. Note that some look&feels do not support the narrow margin feature, and conversely, others have only narrow margins. The JGoodies look&feels honor the setting, the Mac Aqua l&f uses narrow margins all the time.

The following example builds a button stack with Close, Up and Down, where Up and Down are related, and Close is not related to the other buttons, which makes a wide gap for the unrelated and a smaller gap for the related buttons.

 private JPanel createCloseUpDownButtonStack(
         JButton close, JButton up, JButton down) {
     ButtonStackBuilder builder = new ButtonStackBuilder();
     return builder.getPanel();

Karsten Lentzsch

See also:



Definition at line 81 of file ButtonStackBuilder.java.

Public Member Functions

final Component add (Component component)
final Component add (Component component, String encodedCellConstraints)
final Component add (Component component, CellConstraints cellConstraints)
final JLabel add (JLabel label, CellConstraints labelConstraints, Component component, CellConstraints componentConstraints)
void addButtons (JButton[] buttons)
void addFixed (JComponent component)
void addGlue ()
void addGridded (JComponent component)
final JLabel addLabel (String textWithMnemonic, CellConstraints labelConstraints, Component component, CellConstraints componentConstraints)
final JLabel addLabel (String textWithMnemonic)
final JLabel addLabel (String textWithMnemonic, String encodedConstraints)
final JLabel addLabel (String textWithMnemonic, CellConstraints constraints)
void addRelatedGap ()
final JComponent addSeparator (String text)
final JComponent addSeparator (String text, int columnSpan)
final JComponent addSeparator (String text, String encodedConstraints)
final JComponent addSeparator (String text, CellConstraints constraints)
void addStrut (ConstantSize size)
final JLabel addTitle (String text)
final JLabel addTitle (String text, String encodedConstraints)
final JLabel addTitle (String text, CellConstraints constraints)
void addUnrelatedGap ()
final void appendColumn (String encodedColumnSpec)
final void appendColumn (ColumnSpec columnSpec)
final void appendGlueColumn ()
final void appendGlueRow ()
final void appendLabelComponentsGapColumn ()
final void appendParagraphGapRow ()
final void appendRelatedComponentsGapColumn ()
final void appendRelatedComponentsGapRow ()
final void appendRow (String encodedRowSpec)
final void appendRow (RowSpec rowSpec)
final void appendUnrelatedComponentsGapColumn ()
final void appendUnrelatedComponentsGapRow ()
 ButtonStackBuilder (JPanel panel)
 ButtonStackBuilder ()
final int getColumn ()
final int getColumnCount ()
final Container getContainer ()
final FormLayout getLayout ()
final JPanel getPanel ()
final int getRow ()
final int getRowCount ()
final boolean isLeftToRight ()
final void nextColumn (int columns)
final void nextColumn ()
final void nextLine (int lines)
final void nextLine ()
final void nextRow (int rows)
final void nextRow ()
final void setAlignment (CellConstraints.Alignment hAlign, CellConstraints.Alignment vAlign)
final void setBorder (Border border)
final void setBounds (int column, int row, int columnSpan, int rowSpan)
final void setColumn (int column)
final void setColumnSpan (int columnSpan)
final void setComponentFactory (ComponentFactory newFactory)
final void setDefaultDialogBorder ()
final void setExtent (int columnSpan, int rowSpan)
final void setHAlignment (CellConstraints.Alignment alignment)
final void setLeftToRight (boolean b)
final void setOrigin (int column, int row)
final void setRow (int row)
final void setRowSpan (int rowSpan)
final void setVAlignment (CellConstraints.Alignment alignment)

Protected Member Functions

final CellConstraints cellConstraints ()
final CellConstraints createLeftAdjustedConstraints (int columnSpan)
final int getColumnIncrementSign ()
final ComponentFactory getComponentFactory ()
int getLeadingColumn ()

Static Private Attributes

static final ColumnSpec[] COL_SPECS
static final String NARROW_KEY = "jgoodies.isNarrow"
static final RowSpec[] ROW_SPECS

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index