Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| SWIXML 1.5 (#144)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.swixml.converters
Class LayoutConverter

    java.lang.Object
      org.swixml.converters.LayoutConverter

All Implemented Interfaces:
  Converter

public class LayoutConverter
extends 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:

     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))

Version:
  $Revision: 1.1 $
Author:
  Wolf Paulus
See Also:
  `LayoutManager`, `ConverterLibrary`

Field Summary
`static String` | `BORDER_LAYOUT`
`static String` | `CARD_LAYOUT`
`static String` | `FLOW_LAYOUT`
`static String` | `GRID_LAYOUT`
`static String` | `GRIDBAG_LAYOUT`
`static Class` | `TEMPLATE` converter's return type

Constructor Summary
`LayoutConverter()`

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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TEMPLATE

    public static final Class TEMPLATE

  converter's return type

### FLOW_LAYOUT

    public static final String FLOW_LAYOUT

See Also:
  Constant Field Values

### BORDER_LAYOUT

    public static final String BORDER_LAYOUT

See Also:
  Constant Field Values

### GRID_LAYOUT

    public static final String GRID_LAYOUT

See Also:
  Constant Field Values

### GRIDBAG_LAYOUT

    public static final String GRIDBAG_LAYOUT

See Also:
  Constant Field Values

### CARD_LAYOUT

    public static final String CARD_LAYOUT

See Also:
  Constant Field Values

Constructor Detail

### LayoutConverter

    public LayoutConverter()

Method Detail

### 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| SWIXML 1.5 (#144)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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