public abstract class FormSpec
extends java.lang.Object
implements java.io.Serializable
ColumnSpec
and RowSpec
.ColumnSpec
,
RowSpec
,
FormLayout
,
CellConstraints
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
FormSpec.DefaultAlignment
An ordinal-based serializable typesafe enumeration for the
column and row default alignment types.
|
Modifier and Type | Field and Description |
---|---|
(package private) static FormSpec.DefaultAlignment |
BOTTOM_ALIGN
By default put the components in the bottom.
|
(package private) static FormSpec.DefaultAlignment |
CENTER_ALIGN
By default put the components in the center.
|
static double |
DEFAULT_GROW
The default resize weight.
|
(package private) static FormSpec.DefaultAlignment |
FILL_ALIGN
By default fill the column or row.
|
(package private) static FormSpec.DefaultAlignment |
LEFT_ALIGN
By default put components in the left.
|
static double |
NO_GROW
Gives a column or row a fixed size.
|
(package private) static FormSpec.DefaultAlignment |
RIGHT_ALIGN
By default put components in the right.
|
(package private) static FormSpec.DefaultAlignment |
TOP_ALIGN
By default put the components in the top.
|
Modifier | Constructor and Description |
---|---|
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,
java.lang.String encodedDescription)
Constructs a
FormSpec from the specified encoded
description. |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
canGrow()
Checks and answers whether this spec can grow or not.
|
FormSpec.DefaultAlignment |
getDefaultAlignment()
Returns the default alignment.
|
double |
getResizeWeight()
Returns the current resize weight.
|
Size |
getSize()
Returns the size.
|
(package private) abstract boolean |
isHorizontal()
Returns if this is a horizontal specification (vs. vertical).
|
(package private) int |
maximumSize(java.awt.Container container,
java.util.List components,
FormLayout.Measure minMeasure,
FormLayout.Measure prefMeasure,
FormLayout.Measure defaultMeasure)
Computes the maximum size for the given list of components, using
this form spec and the specified measure.
|
java.lang.String |
toShortString()
Returns a string representation of this form specification.
|
java.lang.String |
toString()
Returns a string representation of this form specification.
|
static final FormSpec.DefaultAlignment LEFT_ALIGN
static final FormSpec.DefaultAlignment RIGHT_ALIGN
static final FormSpec.DefaultAlignment TOP_ALIGN
static final FormSpec.DefaultAlignment BOTTOM_ALIGN
static final FormSpec.DefaultAlignment CENTER_ALIGN
static final FormSpec.DefaultAlignment FILL_ALIGN
public static final double NO_GROW
public static final double DEFAULT_GROW
protected FormSpec(FormSpec.DefaultAlignment defaultAlignment, Size size, double resizeWeight)
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.defaultAlignment
- the spec's default alignmentsize
- a constant, component or bounded sizeresizeWeight
- the spec resize weightjava.lang.IllegalArgumentException
- if the resize weight is negativeprotected FormSpec(FormSpec.DefaultAlignment defaultAlignment, java.lang.String encodedDescription)
FormSpec
from the specified encoded
description. The description will be parsed to set initial values.defaultAlignment
- the default alignmentencodedDescription
- the encoded descriptionpublic final FormSpec.DefaultAlignment getDefaultAlignment()
public final Size getSize()
public final double getResizeWeight()
final boolean canGrow()
NO_GROW
.public final java.lang.String toString()
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.
toString
in class java.lang.Object
public final java.lang.String toShortString()
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.
abstract boolean isHorizontal()
final int maximumSize(java.awt.Container container, java.util.List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure)
Invoked by FormLayout to determine the size of one of my elements
container
- the layout containercomponents
- the list of components to measureminMeasure
- the measure used to determine the minimum sizeprefMeasure
- the measure used to determine the preferred sizedefaultMeasure
- the measure used to determine the default size