public class FormLayoutConverter extends Object implements LayoutConverter
com.jgoodies.forms.layout.FormLayout
.
Examples:
<panel> <layout type="FormLayout" columns="p, 3dlu, p:grow" rows="p, 3dlu, p"/> <label constraints="1,1" text="Company"/> <textfield constraints="3,1"/> <label constraints="1,3" text="Contact"/> <textfield constraints="3,3"/> </panel>
<panel> <layout type="FormLayout" columns="right:max(40dlu;pref), 3dlu, d:grow, 7dlu, right:pref, 3dlu, d:grow" rows="p, 3dlu, p, 9dlu, p, 3dlu, p" columnGroups="1,5; 3,7"/> <label constraints="1,1" text="Company"/> <textfield constraints="3,1,5,1"/> <label constraints="1,3" text="Contact"/> <textfield constraints="3,3,5,1"/> <label constraints="1,5" text="PTI [kW]"/> <textfield constraints="3,5"/> <label constraints="5,5" text="Power [kW]"/> <textfield constraints="7,5"/> <label constraints="1,7" text="R [mm]"/> <textfield constraints="3,7"/> <label constraints="5,7" text="D [mm]"/> <textfield constraints="7,7"/> </panel>
Constructor and Description |
---|
FormLayoutConverter() |
Modifier and Type | Method and Description |
---|---|
Object |
convertConstraintsAttribute(Attribute attr)
Creates a CellConstraints instance.
|
Object |
convertConstraintsElement(Element element)
Returns always
null . |
LayoutManager |
convertLayoutAttribute(Attribute attr)
Returns always
null . |
LayoutManager |
convertLayoutElement(Element element)
Creates a FormLayout instance.
|
String |
getID()
Returns "formlayout".
|
public String getID()
getID
in interface LayoutConverter
public LayoutManager convertLayoutAttribute(Attribute attr)
null
.convertLayoutAttribute
in interface LayoutConverter
public LayoutManager convertLayoutElement(Element element)
Creates a FormLayout instance.
Attributes:
columns
(required): The column specifications as documented in JGoodies FormLayout.row
(required): The row specifications as documented in JGoodies FormLayout.columnGroups
(optional): The column groups, where each column
in a group gets the same group wide width. Groups are separated by semicolons,
column indices in a group are separated by colons. E.g. "1,5; 3,7,9" defines
two groups, where first group contains columns 1 and 5; and second group
contains columns 3, 7 and 9. Note that column indices are 1-based.rowGroups
(optional): The row groups, where each row
in a group gets the same group wide height. Groups are separated by semicolons,
row indices in a group are separated by colons. E.g. "1,5; 3,7,9" defines
two groups, where first group contains rows 1 and 5; and second group
contains rows 3, 7 and 9. Note that row indices are 1-based.Examples for Valid XML element notations:
<layout type="FormLayout" columns="p, 3dlu, p" rows="p, 3dlu, p"/>
<layout type="FormLayout" columns="p, 3dlu, p, 3dlu, p, 3dlu, p" rows="p, 3dlu, p"
columnGroups="1,5; 3,7" rowGroups="1,3"/>
convertLayoutElement
in interface LayoutConverter
public Object convertConstraintsAttribute(Attribute attr)
Creates a CellConstraints instance.
Allowed syntaxes of attribute value:
"x, y"
"x, y, w, h"
"x, y, hAlign, vAlign"
"x, y, w, h, hAlign, vAlign"
See JGoodies FormLayout for details.
Examples for Valid XML attribute notations:
constraints="1, 3"
constraints="1, 3, 2, 1"
constraints="1, 3, left, bottom"
constraints="1, 3, 2, 1, l, b"
convertConstraintsAttribute
in interface LayoutConverter
public Object convertConstraintsElement(Element element)
null
.convertConstraintsElement
in interface LayoutConverter
Copyright (c) 2002 - 2015 - Wolf Paulus - wolfpaulus.com. All rights reserved.