Layout Converters

A variety of layouts are created by the default instance of DispatchingLayoutConverter. When "Layout" is listed as the property type for a property, the default instance of DispatchingLayoutConverter is used to convert the resource bundle key or string. Layouts are unique in that they cannot be modified once created. Thus, layouts only have creation properties, but no regular properties. Also there is point listening for changes for layouts or trying to update them after creation time. So, no layout property can be map consistent, and no layout property can be changed through an argument map.

The following is a list of component converters / configurers, installed in the default instance of DispatchingLayoutConverter. All of the installed layout converters have the braced property syntax.

FlowLayout (flow)
Property Type
Note
Creation Properties


align
String
One of "left", "center", "right", "leading" or "trailing". Defaults to center.
hgap
Integer Defaults to 5.
vgap
Integer Defaults to 5.

BorderLayout (border)
Property Type
Note
Creation Properties


hgap
Integer
Defaults to 0.
vgap
Integer Defaults to 0.

GridLayout (grid)
Property Type
Note
Creation Properties

rows
Integer
Defaults to 0.
cols
Integer Defaults to 0.
hgap
Integer Defaults to 0.
vgap
Integer Defaults to 0.

GridBagLayout (gridbag)
Property Type
Note
Creation Properties

<None>



CardLayout (card)
Property Type
Note
Creation Properties

hgap
Integer
Defaults to 0.
vgap
Integer Defaults to 0.

BoxLayout (box)
Property Type
Note
Creation Properties

axis
String
Either "x", "y", "line" or "page", defaults to line.

OverlayLayout (overlay)
Property Type
Note
Creation Properties


<None>




Component Constraint Converters

When a component is added to a container that supports layouts, a constraint can be specified for the component. See the syntax for ComponentConstraintPair. The syntax of the constraint string depends on the layout used for the container. For containers that use BorderLayout, the following atomic converter is used:

BorderConstraint

Syntax: One of the following strings:

String
Constraint
center
BorderLayout.CENTER
c
BorderLayout.CENTER
north
BorderLayout.NORTH
n
BorderLayout.NORTH
south
BorderLayout.SOUTH
s
BorderLayout.NORTH
east
BorderLayout.EAST
e
BorderLayout.EAST
west
BorderLayout.WEST
w
BorderLayout.WEST
lineStart
BorderLayout.LINE_START
ls
BorderLayout.LINE_START
lineEnd
BorderLayout.LINE_END
le
BorderLayout.LINE_END
pageStart
BorderLayout.PAGE_START
ps
BorderLayout.PAGE_START
pageEnd
BorderLayout.PAGE_END
pe
BorderLayout.PAGE_END
afterLastLine
BorderLayout.AFTER_LAST_LINE
all
BorderLayout.AFTER_LAST_LINE
afterLineEnds
BorderLayout.AFTER_LINE_ENDS
ale
BorderLayout.AFTER_LINE_ENDS
beforeFirstLine
BorderLayout.BEFORE_FIRST_LINE
bfl
BorderLayout.BEFORE_FIRST_LINE
beforeLineBegins
BorderLayout.BEFORE_LINE_BEGINS
blb
BorderLayout.BEFORE_LINE_BEGINS

For containers that use GridBagLayout, the following converter is used to create instances of GridBagConstaints from the constraint string. The converter has the braced property syntax:

GridBagConstraint (gbc)
Property Type
Map Consistency
Note
Creation Properties



<None>



Properties



anchor
String
No Must be one of "center", "n", "ne", "nw", "s", "se", "sw", "lineStart", "lineEnd", "pageStart", "pageEnd", "firstLineStart", "firstLineEnd", "lastLineStart", or "lastLineEnd"
fill
String
No Must be one of "none", "h", "v", or "both".
insets
Insets
No
ipadx
Integer
No
ipady
Integer No
gridx
String
No Either "rel" for GridBagConstraints.RELATIVE,  or an integer string.
gridy
String
No Either "rel" for GridBagConstraints.RELATIVE,  or an integer string.
gridwidth
String
No Either "rel" for GridBagConstraints.RELATIVE, "rem" for GridBagConstraints.REMAINDER, or an integer string.
gridheight
String
No Either "rel" for GridBagConstraints.RELATIVE, "rem" for GridBagConstraints.REMAINDER, or an integer string.
weightx
Double
No
weighty
Double
No