com.jgoodies.forms.layout

Class FormSpec

public abstract class FormSpec extends Object implements Serializable

An abstract class that specifies columns and rows in FormLayout by their default alignment, start size and resizing behavior. API users will use the subclasses ColumnSpec and RowSpec.

Version: $Revision: 1.4 $

Author: Karsten Lentzsch

See Also: ColumnSpec RowSpec FormLayout CellConstraints

Nested Class Summary
static classFormSpec.DefaultAlignment
An ordinal-based serializable typesafe enumeration for the column and row default alignment types.
Field Summary
static doubleDEFAULT_GROW
The default resize weight.
static doubleNO_GROW
Gives a column or row a fixed size.
Constructor Summary
protected FormSpec(FormSpec.DefaultAlignment defaultAlignment, Size size, double resizeWeight)
Constructs a FormSpec for the given default alignment, size, and resize weight.
protected FormSpec(FormSpec.DefaultAlignment defaultAlignment, String encodedDescription)
Constructs a FormSpec from the specified encoded description.
Method Summary
FormSpec.DefaultAlignmentgetDefaultAlignment()
Returns the default alignment.
doublegetResizeWeight()
Returns the current resize weight.
SizegetSize()
Returns the size.
StringtoShortString()
Returns a string representation of this form specification.
StringtoString()
Returns a string representation of this form specification.

Field Detail

DEFAULT_GROW

public static final double DEFAULT_GROW
The default resize weight.

NO_GROW

public static final double NO_GROW
Gives a column or row a fixed size.

Constructor Detail

FormSpec

protected FormSpec(FormSpec.DefaultAlignment defaultAlignment, Size size, double resizeWeight)
Constructs a FormSpec for the given default alignment, size, and resize weight. The resize weight must be a non-negative double; you can use NONE as a convenience value for no resize.

Parameters: defaultAlignment the spec's default alignment size a constant, component or bounded size resizeWeight the spec resize weight

Throws: IllegalArgumentException if the resize weight is negative

FormSpec

protected FormSpec(FormSpec.DefaultAlignment defaultAlignment, String encodedDescription)
Constructs a FormSpec from the specified encoded description. The description will be parsed to set initial values.

Parameters: defaultAlignment the default alignment encodedDescription the encoded description

Method Detail

getDefaultAlignment

public final FormSpec.DefaultAlignment getDefaultAlignment()
Returns the default alignment.

Returns: the default alignment

getResizeWeight

public final double getResizeWeight()
Returns the current resize weight.

Returns: the resize weight.

getSize

public final Size getSize()
Returns the size.

Returns: the size

toShortString

public final String toShortString()
Returns a string representation of this form specification. The string representation consists of three elements separated by a colon (":"), first the alignment, second the size, and third the resize spec.

This method does not return a decoded version of this object; the contrary is the case. Many instances will return a string that cannot be parsed.

Note: The string representation may change at any time. It is strongly recommended to not use this string for parsing purposes.

Returns: a string representation of the form specification.

toString

public final String toString()
Returns a string representation of this form specification. The string representation consists of three elements separated by a colon (":"), first the alignment, second the size, and third the resize spec.

This method does not return a decoded version of this object; the contrary is the case. Many instances will return a string that cannot be parsed.

Note: The string representation may change at any time. It is strongly recommended to not use this string for parsing purposes.

Returns: a string representation of the form specification.

Copyright © 2002-2007 JGoodies Karsten Lentzsch. All Rights Reserved.