org.swixml.converters
Class LayoutConverter
java.lang.Object
org.swixml.converters.LayoutConverter
- Converter
public class LayoutConverter
extends java.lang.Object
The
LayoutConverter
class defines a converter that creates LayoutManager objects
based on a provided String.
Examples for Valid XML attribute notations:
FlowLayout
can be created with all 3 construtors:
- FlowLayout()
- FlowLayout(int align)
- FlowLayout(int align, int hgap, int vgap)
- BorderLayout()
- BorderLayout(int hgap, int vgap)
- GridBagLayout()
- GridBagLayout(rowWeights(0,0,1.0,0))
- GridBagLayout(colWeights(0.5, 0.5, 1.0, 99.9))
- GridBagLayout(columnWidths(5, 5, 10, 33))
- GridBagLayout(rowHeights(5, 5, 10, 33))
Object | convert(Class type, Attribute attr, Localizer localizer) - Convert the specified input object into an output object of the
specified type.
|
Class | convertsTo() - A
Converters conversTo method informs about the Class type the converter
is returning when its convert method is called
|
BORDER_LAYOUT
public static final String BORDER_LAYOUT
CARD_LAYOUT
public static final String CARD_LAYOUT
FLOW_LAYOUT
public static final String FLOW_LAYOUT
GRIDBAG_LAYOUT
public static final String GRIDBAG_LAYOUT
GRID_LAYOUT
public static final String GRID_LAYOUT
TEMPLATE
public static final Class TEMPLATE
converter's return type
convert
public Object convert(Class type,
Attribute attr,
Localizer localizer)
Convert the specified input object into an output object of the
specified type.
FlowLayout
can be created with all 3 construtors:
- FlowLayout()
- FlowLayout(int align)
- FlowLayout(int align, int hgap, int vgap)
- BorderLayout()
- BorderLayout(int hgap, int vgap)
- GridLayout()
- GridLayout(int rows, int cols)
- GridLayout(int rows, int cols, int hgap, int vgap)
- GridBagLayout()
- GridBagLayout(rowWeights(0,0,1.0,0))
- GridBagLayout(colWeights(0.5, 0.5, 1.0, 99.9))
- GridBagLayout(columnWidths(5, 5, 10, 33))
- GridBagLayout(rowHeights(5, 5, 10, 33))
- CardLayout() - Creates a new card layout with gaps of size zero.
- CardLayout(int hgap, int vgap) - Creates a new card layout with the specified horizontal and vertical gaps.
Here is how to access the card layout manager of a component installed by SwixML
(CardLayout)((Container)swingEngine.find("id_of_my_CLed_comp")).getLayout()
- convert in interface Converter
type
- Class
not usedattr
- Attribute
value is needed for conversion
convertsTo
public Class convertsTo()
A Converters
conversTo method informs about the Class type the converter
is returning when its convert
method is called
- convertsTo in interface Converter
Class
- the Class the converter is returning when its convert method is called
Copyright B) 2002 - 2005 - Wolf Paulus - CarlsbadCubes.com . All rights reserved.