org.swixml.converters

Class LayoutConverter

Implemented Interfaces:
Converter

public class LayoutConverter
extends java.lang.Object
implements Converter

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:

Version:
$Revision: 1.1 $
Author:
Wolf Paulus
See Also:
java.awt.LayoutManager, ConverterLibrary

Field Summary

static String
BORDER_LAYOUT
static String
CARD_LAYOUT
static String
FLOW_LAYOUT
static String
GRIDBAG_LAYOUT
static String
GRID_LAYOUT
static Class
TEMPLATE
converter's return type

Method Summary

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

Field Details

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

Method Details

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)
  • BoxLayout: see Box tag
  • 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()
Specified by:
convert in interface Converter
Parameters:
type - Class not used
attr - Attribute value is needed for conversion
Returns:
Object

convertsTo

public Class convertsTo()
A Converters conversTo method informs about the Class type the converter is returning when its convert method is called
Specified by:
convertsTo in interface Converter
Returns:
Class - the Class the converter is returning when its convert method is called

Copyright B) 2002 - 2005 - Wolf Paulus - CarlsbadCubes.com . All rights reserved.