yu.ac.bg.etf.javaqx.qswing.layouts.formlayout.factories
Class FormFactory

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.layouts.formlayout.factories.FormFactory

public final class FormFactory
extends java.lang.Object

A factory that creates instances of FormLayout for frequently used form layouts. It makes form creation easier and more consistent.

The forms are described by major and minor columns. Major columnsconsist 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
 

Many forms use 1, 2, 3 or 4 major columns, which in turn are often split into 1, 2, 3 or 4 minor columns.

NOTE: This code is part of the JGoodies Forms port.

Version:
$Revision: 1.3 $, 0.2.0
Author:
Karsten Lentzsch, Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
static ColumnSpec BUTTON_COLSPEC
          Describes a logical horizontal column for a fixed size button.
static ColumnSpec DEFAULT_COLSPEC
          An unmodifyable ColumnSpec that determines its preferred width by computing the maximum of all column component preferred widths and its minimum width by computing all column component minimum widths.
static RowSpec DEFAULT_ROWSPEC
          An unmodifyable RowSpec that determines its preferred height by computing the maximum of all column component preferred heights and its minimum height by computing all column component minimum heights.
static ColumnSpec GLUE_COLSPEC
          An unmodifyable ColumnSpec that has an initial width of 0 pixels and that grows.
static RowSpec GLUE_ROWSPEC
          An unmodifyable RowSpec that has an initial height of 0 pixels and that grows.
static ColumnSpec GROWING_BUTTON_COLSPEC
          Describes a logical horizontal column for a growing button.
static ColumnSpec LABEL_COMPONENT_GAP_COLSPEC
          Describes a logical horizontal gap between a label and an associated component.
static RowSpec LINE_GAP_ROWSPEC
          Describes the logical vertical default gap between two rows in the grid.
static ColumnSpec MIN_COLSPEC
          An unmodifyable ColumnSpec that determines its width by computing the maximum of all column component minimum widths.
static RowSpec MIN_ROWSPEC
          An unmodifyable RowSpec that determines its height by computing the maximum of all column component minimum heights.
static RowSpec NARROW_LINE_GAP_ROWSPEC
          Describes a logical vertical narrow gap between two rows in the grid.
static RowSpec PARAGRAPH_GAP_ROWSPEC
          Describes the logical vertical default gap between two paragraphs in the layout grid.
static ColumnSpec PREF_COLSPEC
          An unmodifyable ColumnSpec that determines its width by computing the maximum of all column component preferred widths.
static RowSpec PREF_ROWSPEC
          An unmodifyable RowSpec that determines its height by computing the maximum of all column component preferred heights.
static ColumnSpec RELATED_GAP_COLSPEC
          Describes a logical horizontal gap between two related components.
static RowSpec RELATED_GAP_ROWSPEC
          Describes a logical vertzical gap between two related components.
static ColumnSpec UNRELATED_GAP_COLSPEC
          Describes a logical horizontal gap between two unrelated components.
static RowSpec UNRELATED_GAP_ROWSPEC
          Describes a logical vertical gap between two unrelated components.
 
Method Summary
static ColumnSpec createGapColumnSpec(ConstantSize gapSize)
          Creates and returns a ColumnSpec that represents a gap with the specified ConstantSize.
static RowSpec createGapRowSpec(ConstantSize gapSize)
          Creates and returns a RowSpec that represents a gap with the specified ConstantSize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_COLSPEC

public static final ColumnSpec MIN_COLSPEC
An unmodifyable ColumnSpec that determines its width by computing the maximum of all column component minimum widths.


PREF_COLSPEC

public static final ColumnSpec PREF_COLSPEC
An unmodifyable ColumnSpec that determines its width by computing the maximum of all column component preferred widths.


DEFAULT_COLSPEC

public static final ColumnSpec DEFAULT_COLSPEC
An unmodifyable ColumnSpec that determines its preferred width by computing the maximum of all column component preferred widths and its minimum width by computing all column component minimum widths.

Useful to let a column shrink from preferred width to minimum width if the container space gets scarce.


GLUE_COLSPEC

public static final ColumnSpec GLUE_COLSPEC
An unmodifyable ColumnSpec that has an initial width of 0 pixels and that grows. Useful to describe glue columns that fill the space between other columns.


LABEL_COMPONENT_GAP_COLSPEC

public static final ColumnSpec LABEL_COMPONENT_GAP_COLSPEC
Describes a logical horizontal gap between a label and an associated component. Useful for builders that automatically fill a grid with labels and components.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


RELATED_GAP_COLSPEC

public static final ColumnSpec RELATED_GAP_COLSPEC
Describes a logical horizontal gap between two related components. For example the OK and Cancel buttons are considered related.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


UNRELATED_GAP_COLSPEC

public static final ColumnSpec UNRELATED_GAP_COLSPEC
Describes a logical horizontal gap between two unrelated components.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


BUTTON_COLSPEC

public static final ColumnSpec BUTTON_COLSPEC
Describes a logical horizontal column for a fixed size button. This spec honors the current layout style's default button minimum width.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


GROWING_BUTTON_COLSPEC

public static final ColumnSpec GROWING_BUTTON_COLSPEC
Describes a logical horizontal column for a growing button. This spec does not use the layout style's default button minimum width.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


MIN_ROWSPEC

public static final RowSpec MIN_ROWSPEC
An unmodifyable RowSpec that determines its height by computing the maximum of all column component minimum heights.


PREF_ROWSPEC

public static final RowSpec PREF_ROWSPEC
An unmodifyable RowSpec that determines its height by computing the maximum of all column component preferred heights.


DEFAULT_ROWSPEC

public static final RowSpec DEFAULT_ROWSPEC
An unmodifyable RowSpec that determines its preferred height by computing the maximum of all column component preferred heights and its minimum height by computing all column component minimum heights.

Useful to let a column shrink from preferred height to minimum height if the container space gets scarce.


GLUE_ROWSPEC

public static final RowSpec GLUE_ROWSPEC
An unmodifyable RowSpec that has an initial height of 0 pixels and that grows. Useful to describe glue rows that fill the space between other rows.


RELATED_GAP_ROWSPEC

public static final RowSpec RELATED_GAP_ROWSPEC
Describes a logical vertzical gap between two related components. For example the OK and Cancel buttons are considered related.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


UNRELATED_GAP_ROWSPEC

public static final RowSpec UNRELATED_GAP_ROWSPEC
Describes a logical vertical gap between two unrelated components.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.

See Also:
RELATED_GAP_ROWSPEC

NARROW_LINE_GAP_ROWSPEC

public static final RowSpec NARROW_LINE_GAP_ROWSPEC
Describes a logical vertical narrow gap between two rows in the grid. Useful if the vertical space is scarce or if an individual vertical gap shall be small than the default line gap.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


LINE_GAP_ROWSPEC

public static final RowSpec LINE_GAP_ROWSPEC
Describes the logical vertical default gap between two rows in the grid. A little bit larger than the narrow line gap.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.


PARAGRAPH_GAP_ROWSPEC

public static final RowSpec PARAGRAPH_GAP_ROWSPEC
Describes the logical vertical default gap between two paragraphs in the layout grid. This gap is larger than the default line gap.

Note: In a future version this constant will likely be moved to a class LogicalSize or StyledSize.

Method Detail

createGapColumnSpec

public static ColumnSpec createGapColumnSpec(ConstantSize gapSize)
Creates and returns a ColumnSpec that represents a gap with the specified ConstantSize.

Parameters:
gapSize - a ConstantSize that specifies the gap
Returns:
a ColumnSpec that describes a horizontal gap

createGapRowSpec

public static RowSpec createGapRowSpec(ConstantSize gapSize)
Creates and returns a RowSpec that represents a gap with the specified ConstantSize.

Parameters:
gapSize - a ConstantSize that specifies the gap
Returns:
a RowSpec that describes a vertical gap


Copyright © 2007 ETF and contributors. All Rights Reserved.