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.
|
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.
|
DEFAULT_GROW, NO_GROW
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.
|
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(String encodedRowSpec)
Parses the encoded row specification and returns a RowSpec object
that represents the string.
|
static RowSpec |
decode(String encodedRowSpec,
LayoutMap layoutMap)
Parses the encoded row specifications and returns a RowSpec object
that represents the string.
|
static RowSpec[] |
decodeSpecs(String encodedRowSpecs)
Parses and splits encoded row specifications using the default
LayoutMap and returns an array of RowSpec objects. |
static RowSpec[] |
decodeSpecs(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. vertical).
|
encode, getDefaultAlignment, getDefaultAlignmentExplictlySet, getResizeWeight, getSize, toShortString, toString
public 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
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 weightIllegalArgumentException
- if the size is invalid or
the resize weight is negativepublic RowSpec(Size size)
size
- constant size, component size, or bounded sizeIllegalArgumentException
- if the size is invalidpublic static RowSpec createGap(ConstantSize gapHeight)
RowSpec
that represents a gap with the
specified ConstantSize
.gapHeight
- specifies the gap heightNullPointerException
- if gapHeight
is null
public static RowSpec decode(String encodedRowSpec)
encodedRowSpec
- the encoded row specificationNullPointerException
- if encodedRowSpec
is null
decode(String, LayoutMap)
,
LayoutMap.getRoot()
public static RowSpec decode(String encodedRowSpec, LayoutMap layoutMap)
encodedRowSpec
- the encoded column specificationlayoutMap
- expands layout row variablesNullPointerException
- if encodedRowSpec
or
layoutMap
is null
decodeSpecs(String, LayoutMap)
public static RowSpec[] decodeSpecs(String encodedRowSpecs)
LayoutMap
and returns an array of RowSpec objects.encodedRowSpecs
- comma separated encoded row specificationsNullPointerException
- if encodedRowSpecs
is null
decodeSpecs(String, LayoutMap)
,
decode(String)
,
LayoutMap.getRoot()
public static RowSpec[] decodeSpecs(String encodedRowSpecs, LayoutMap layoutMap)
LayoutMap
and returns an array of RowSpec objects.encodedRowSpecs
- comma separated encoded row specificationslayoutMap
- expands layout row variablesNullPointerException
- encodedRowSpecs
or
layoutMap
is null
RowSpec(String)
protected boolean isHorizontal()
false
(for vertical)Copyright © 2002-2014 JGoodies Software GmbH. All Rights Reserved.