|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.forms.factories.FormFactory
public final class FormFactory
A factory that creates instances of
FormLayout
for frequently used
form layouts. It makes form creation easier and more consistent.
The FormLayout
factory methods are work in progress
and may change without notice. If you want to use these methods,
you may consider copying them into your codebase.
The forms are described by major and minor columns. Major columns consist of a leading label and a set of related components, for example: a label plus textfield, or label plus textfield plus button. The component part of a major column is divided into minor columns as shown in this layout:
<- major column 1 -> <- major column 2 -> label1 textfield1a textfield1b label2 textfield2a textfield2b label3 textfield3a textfield3b label4 textfield4 label5 textfield5 label6 textfield6
Most forms use 1, 2, 3 or 4 major columns, which in turn are often split into 1, 2, 3 or 4 minor columns.
FormLayout
,
ColumnSpec
Field Summary | |
---|---|
static ColumnSpec |
BUTTON_COLSPEC
|
static ColumnSpec |
DEFAULT_COLSPEC
|
static RowSpec |
DEFAULT_ROWSPEC
|
static ColumnSpec |
GLUE_COLSPEC
|
static RowSpec |
GLUE_ROWSPEC
|
static ColumnSpec |
GROWING_BUTTON_COLSPEC
|
static RowSpec |
LINE_GAP_ROWSPEC
|
static ColumnSpec |
MIN_COLSPEC
|
static RowSpec |
MIN_ROWSPEC
|
static RowSpec |
NARROW_LINE_GAP_ROWSPEC
|
static RowSpec |
PARAGRAPH_GAP_ROWSPEC
|
static ColumnSpec |
PREF_COLSPEC
|
static RowSpec |
PREF_ROWSPEC
|
static ColumnSpec |
RELATED_GAP_COLSPEC
|
static RowSpec |
RELATED_GAP_ROWSPEC
|
static ColumnSpec |
UNRELATED_GAP_COLSPEC
|
static RowSpec |
UNRELATED_GAP_ROWSPEC
|
Constructor Summary | |
---|---|
FormFactory()
|
Method Summary | |
---|---|
static FormLayout |
createColumnLayout(int majorColumns,
int minorColumns,
ColumnSpec labelColumnSpec)
Creates and answers an instance of FormLayout
to build forms with the specified number of major and minor columns. |
static FormLayout |
createColumnLayout(int majorColumns,
int minorColumns,
ColumnSpec labelColumnSpec,
ColumnSpec componentColumnSpec,
ConstantSize indent,
ConstantSize majorColumnGap,
ConstantSize minorColumnGap)
Creates and answers an instance of FormLayout
to build forms with the given number of major columns. |
static FormLayout |
createColumnLayout(int majorColumns,
int minorColumns,
ColumnSpec labelColumnSpec,
ConstantSize indent,
ConstantSize minorColumnGap)
Creates and answers an instance of FormLayout
to build forms with the given number of major columns. |
static ColumnSpec |
createGapColumnSpec(ConstantSize gapSize)
Creates and answers a ColumnSpec that represents a gap with the
specified ConstantSize . |
static RowSpec |
createGapRowSpec(ConstantSize gapSize)
Creates and answers a RowSpec that represents a gap with the
specified ConstantSize . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ColumnSpec MIN_COLSPEC
public static final ColumnSpec PREF_COLSPEC
public static final ColumnSpec DEFAULT_COLSPEC
public static final ColumnSpec GLUE_COLSPEC
public static final ColumnSpec RELATED_GAP_COLSPEC
public static final ColumnSpec UNRELATED_GAP_COLSPEC
public static final ColumnSpec BUTTON_COLSPEC
public static final ColumnSpec GROWING_BUTTON_COLSPEC
public static final RowSpec MIN_ROWSPEC
public static final RowSpec PREF_ROWSPEC
public static final RowSpec DEFAULT_ROWSPEC
public static final RowSpec GLUE_ROWSPEC
public static final RowSpec RELATED_GAP_ROWSPEC
public static final RowSpec UNRELATED_GAP_ROWSPEC
public static final RowSpec LINE_GAP_ROWSPEC
public static final RowSpec NARROW_LINE_GAP_ROWSPEC
public static final RowSpec PARAGRAPH_GAP_ROWSPEC
Constructor Detail |
---|
public FormFactory()
Method Detail |
---|
public static FormLayout createColumnLayout(int majorColumns, int minorColumns, ColumnSpec labelColumnSpec)
FormLayout
to build forms with the specified number of major and minor columns.
The layout will use default values for all gaps.
This method is work in progress and may be moved, removed, or change without notice.
majorColumns
- the number of used major columnsminorColumns
- the number of used minor columnslabelColumnSpec
- specifies the label columns
FormLayout
public static FormLayout createColumnLayout(int majorColumns, int minorColumns, ColumnSpec labelColumnSpec, ConstantSize indent, ConstantSize minorColumnGap)
FormLayout
to build forms with the given number of major columns.
Major columns consists of a label and a component section, where each
component section is divided into the given number of minor columns.
The layout will use the specified gaps to separate major columns, and the label and component section.
This method is work in progress and may be moved, removed, or change without notice.
majorColumns
- the number of major columnsminorColumns
- the number of minor columnslabelColumnSpec
- specifies the label columnsindent
- an optional ConstantSize
that describes the width of the leading indent columnminorColumnGap
- a ConstantSize
that describes
the gap between minor columns
FormLayout
public static FormLayout createColumnLayout(int majorColumns, int minorColumns, ColumnSpec labelColumnSpec, ColumnSpec componentColumnSpec, ConstantSize indent, ConstantSize majorColumnGap, ConstantSize minorColumnGap)
FormLayout
to build forms with the given number of major columns.
Major columns consists of a label and a component section, where each
component section is divided into the given number of minor columns.
The layout will use the specified gaps to separate major columns, minor columns, and the label and component section.
This method is work in progress and may be moved, removed, or change without notice.
majorColumns
- the number of major columnsminorColumns
- the number of minor columnslabelColumnSpec
- specifies the label columnscomponentColumnSpec
- specifies the label columnsindent
- an optional ConstantSize
that describes the width of the leading indent columnmajorColumnGap
- a ConstantSize
that describes
the gap between major columnsminorColumnGap
- a ConstantSize
that describes
the gap between minor columns
FormLayout
public static ColumnSpec createGapColumnSpec(ConstantSize gapSize)
ColumnSpec
that represents a gap with the
specified ConstantSize
.
gapSize
- a ConstantSize
that specifies the gap
ColumnSpec
that describes a horizontal gappublic static RowSpec createGapRowSpec(ConstantSize gapSize)
RowSpec
that represents a gap with the
specified ConstantSize
.
gapSize
- a ConstantSize
that specifies the gap
RowSpec
that describes a vertical gap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |