public final class RowSpec extends FormSpec
Examples:
The following examples specify a centered row with a size of 14 dlu
that won't grow.
new RowSpec(Sizes.dluX(14));
new RowSpec(RowSpec.CENTER, Sizes.dluX(14), 0.0);
new RowSpec(rowSpec.CENTER, Sizes.dluX(14), RowSpec.NO_GROW);
RowSpec.parse("14dlu");
RowSpec.parse("14dlu:0");
RowSpec.parse("center:14dlu:0");
The FormSpecs provides
predefined frequently used RowSpec instances.
FormSpecs,
Serialized FormFormSpec.DefaultAlignment| Modifier and Type | Field and Description |
|---|---|
static FormSpec.DefaultAlignment |
BOTTOM
By default put the components in the bottom.
|
private static java.util.Map<java.lang.String,RowSpec> |
CACHE
Maps encoded row specifications to RowSpec instances.
|
static FormSpec.DefaultAlignment |
CENTER
By default put the components in the center.
|
static FormSpec.DefaultAlignment |
DEFAULT
Unless overridden the default alignment for a row is CENTER.
|
static FormSpec.DefaultAlignment |
FILL
By default fill the component into the row.
|
static FormSpec.DefaultAlignment |
TOP
By default put the components in the top.
|
BOTTOM_ALIGN, CENTER_ALIGN, DEFAULT_GROW, FILL_ALIGN, LEFT_ALIGN, NO_ALIGN, NO_GROW, RIGHT_ALIGN, TOP_ALIGN| Modifier | Constructor and Description |
|---|---|
|
RowSpec(FormSpec.DefaultAlignment defaultAlignment,
Size size,
double resizeWeight)
Constructs a RowSpec from the given default orientation,
size, and resize weight.
|
|
RowSpec(Size size)
Constructs a RowSpec for the given size using the
default alignment, and no resizing.
|
private |
RowSpec(java.lang.String encodedDescription)
Constructs a RowSpec from the specified encoded description.
|
| Modifier and Type | Method and Description |
|---|---|
static RowSpec |
createGap(ConstantSize gapHeight)
Creates and returns a
RowSpec that represents a gap with the
specified ConstantSize. |
static RowSpec |
decode(java.lang.String encodedRowSpec)
Parses the encoded row specification and returns a RowSpec object
that represents the string.
|
static RowSpec |
decode(java.lang.String encodedRowSpec,
LayoutMap layoutMap)
Parses the encoded row specifications and returns a RowSpec object
that represents the string.
|
(package private) static RowSpec |
decodeExpanded(java.lang.String expandedTrimmedLowerCaseSpec)
Decodes an expanded, trimmed, lower case row spec.
|
static RowSpec[] |
decodeSpecs(java.lang.String encodedRowSpecs)
Parses and splits encoded row specifications using the default
LayoutMap and returns an array of RowSpec objects. |
static RowSpec[] |
decodeSpecs(java.lang.String encodedRowSpecs,
LayoutMap layoutMap)
Parses and splits encoded row specifications using the given
LayoutMap and returns an array of RowSpec objects. |
protected boolean |
isHorizontal()
Returns if this is a horizontal specification (vs.
|
canGrow, encode, getDefaultAlignment, getDefaultAlignmentExplictlySet, getResizeWeight, getSize, maximumSize, setDefaultAlignment, setResizeWeight, setSize, toShortString, toStringpublic static final FormSpec.DefaultAlignment TOP
public static final FormSpec.DefaultAlignment CENTER
public static final FormSpec.DefaultAlignment BOTTOM
public static final FormSpec.DefaultAlignment FILL
public static final FormSpec.DefaultAlignment DEFAULT
private static final java.util.Map<java.lang.String,RowSpec> CACHE
public RowSpec(FormSpec.DefaultAlignment defaultAlignment, Size size, double resizeWeight)
The resize weight must be a non-negative double; you can use
NO_FILL as a convenience value for no resize.
defaultAlignment - the row's default alignmentsize - constant size, component size, or bounded sizeresizeWeight - the row's non-negative resize weightjava.lang.IllegalArgumentException - if the size is invalid or
the resize weight is negativepublic RowSpec(Size size)
size - constant size, component size, or bounded sizejava.lang.IllegalArgumentException - if the size is invalidprivate RowSpec(java.lang.String encodedDescription)
Unlike the factory method decode(String), this constructor
does not expand layout variables, and it cannot vend cached objects.
encodedDescription - the encoded descriptionpublic static RowSpec createGap(ConstantSize gapHeight)
RowSpec that represents a gap with the
specified ConstantSize.gapHeight - specifies the gap heightjava.lang.NullPointerException - if gapHeight is nullpublic static RowSpec decode(java.lang.String encodedRowSpec)
encodedRowSpec - the encoded row specificationjava.lang.NullPointerException - if encodedRowSpec is nulldecode(String, LayoutMap),
LayoutMap.getRoot()public static RowSpec decode(java.lang.String encodedRowSpec, LayoutMap layoutMap)
encodedRowSpec - the encoded column specificationlayoutMap - expands layout row variablesjava.lang.NullPointerException - if encodedRowSpec or
layoutMap is nulldecodeSpecs(String, LayoutMap)static RowSpec decodeExpanded(java.lang.String expandedTrimmedLowerCaseSpec)
expandedTrimmedLowerCaseSpec - the encoded column specificationpublic static RowSpec[] decodeSpecs(java.lang.String encodedRowSpecs)
LayoutMap and returns an array of RowSpec objects.encodedRowSpecs - comma separated encoded row specificationsjava.lang.NullPointerException - if encodedRowSpecs is nulldecodeSpecs(String, LayoutMap),
decode(String),
LayoutMap.getRoot()public static RowSpec[] decodeSpecs(java.lang.String encodedRowSpecs, LayoutMap layoutMap)
LayoutMap and returns an array of RowSpec objects.encodedRowSpecs - comma separated encoded row specificationslayoutMap - expands layout row variablesjava.lang.NullPointerException - encodedRowSpecs or
layoutMap is nullRowSpec(String)protected boolean isHorizontal()
isHorizontal in class FormSpecfalse (for vertical)