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

com::jgoodies::forms::builder::PanelBuilder Class Reference

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

com::jgoodies::forms::builder::AbstractFormBuilder com::jgoodies::forms::builder::ButtonBarBuilder com::jgoodies::forms::builder::ButtonStackBuilder com::jgoodies::forms::builder::I15dPanelBuilder com::jgoodies::forms::builder::DefaultFormBuilder

List of all members.


Detailed Description

An general purpose panel builder that uses the FormLayout to lay out JPanels. It provides convenience methods to set a default border and to add labels, titles and titled separators.

The PanelBuilder is the working horse for layouts when more specialized builders like the ButtonBarBuilder or DefaultFormBuilder are inappropriate.

The Forms tutorial includes several examples that present and compare different style to build with the PanelBuilder: static row numbers vs. row variable, explicit CellConstraints vs. builder cursor, static rows vs. dynamically added rows. Also, you may check out the Tips & Tricks section of the Forms HTML documentation.

The texts used in method addLabel can contain an optional mnemonic marker. The mnemonic and mnemonic index are indicated by a single ampersand (&). For example "&Save&quot, or "Save &as&quot. To use the ampersand itself, duplicate it, for example "Look&&Feel&quot.

Example:
This example creates a panel with 3 columns and 3 rows.

 FormLayout layout = new FormLayout(
      "right:pref, 6dlu, 50dlu, 4dlu, default",  // columns 
      "pref, 3dlu, pref, 3dlu, pref");           // rows

 PanelBuilder builder = new PanelBuilder(layout);
 CellConstraints cc = new CellConstraints();
 builder.addLabel("&Title",      cc.xy  (1, 1));
 builder.add(new JTextField(),   cc.xywh(3, 1, 3, 1));
 builder.addLabel("&Price",      cc.xy  (1, 3));
 builder.add(new JTextField(),   cc.xy  (3, 3));
 builder.addLabel("&Author",     cc.xy  (1, 5));
 builder.add(new JTextField(),   cc.xy  (3, 5));
 builder.add(new JButton("..."), cc.xy  (5, 5));
 return builder.getPanel();
 

Author:
Karsten Lentzsch
Version:
Revision
1.14

See also:
com.jgoodies.forms.factories.ComponentFactory

I15dPanelBuilder

DefaultFormBuilder

Definition at line 94 of file PanelBuilder.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)
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)
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)
final JLabel addTitle (String text)
final JLabel addTitle (String text, String encodedConstraints)
final JLabel addTitle (String text, CellConstraints constraints)
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 ()
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 ()
 PanelBuilder (JPanel panel, FormLayout layout)
 PanelBuilder (FormLayout layout, JPanel panel)
 PanelBuilder (FormLayout layout)
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 ()

Private Attributes

ComponentFactory componentFactory

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

Generated by  Doxygen 1.6.0   Back to index