SWIXML
1.6 (#161)

org.swixml
Interface LayoutConverter

All Known Implementing Classes:
BorderLayoutConverter, CardLayoutConverter, FlowLayoutConverter, FormLayoutConverter, GridBagLayoutConverter, GridLayoutConverter

public interface LayoutConverter

The LayoutConverter interface defines a layout converter that creates LayoutManager objects and constraints objects based on a provided XML attributes or elements.

Author:
Karl Tauber
See Also:
LayoutConverterLibrary

Method Summary
 Object convertConstraintsAttribute(Attribute attr)
          Converts the given "constraints" attribute to a layout manager specific constraints instance.
 Object convertConstraintsElement(Element element)
          Converts the given "constraints" element to a layout manager specific constraints instance.
 LayoutManager convertLayoutAttribute(Attribute attr)
          Converts the given "layout" attribute to a LayoutManager instance.
 LayoutManager convertLayoutElement(Element element)
          Converts the given "layout" element to a LayoutManager instance.
 String getID()
          Returns the unique identifier of the layout converter.
 

Method Detail

getID

String getID()
Returns the unique identifier of the layout converter. E.g. "flowlayout". This identifier is used in "layout" attributes and elements to specify the layout manager.


convertLayoutAttribute

LayoutManager convertLayoutAttribute(Attribute attr)

Converts the given "layout" attribute to a LayoutManager instance. The attribute value always starts with the layout identifier (see getID()) followed by optional parameters.

If the layout converter does not use the "layout" attribute, this method should return null, but then convertLayoutElement(org.jdom.Element) must return a LayoutManager instance.

XML notation:

 <panel layout="mylayout"/>
 


convertLayoutElement

LayoutManager convertLayoutElement(Element element)

Converts the given "layout" element to a LayoutManager instance. The element may have any layout manager specific attributes or child elements. The "type" attribute is used to choose the layout converter.

If the layout converter does not use the "layout" element, this method should return null, but then convertLayoutAttribute(org.jdom.Attribute) must return a LayoutManager instance.

XML notation:

 <panel>
   <layout type="mylayout" attr1="value1"/>
 </panel>
 


convertConstraintsAttribute

Object convertConstraintsAttribute(Attribute attr)

Converts the given "constraints" attribute to a layout manager specific constraints instance.

If the layout converter does not use the "constraints" attribute, this method should return null.

XML notation:

 <label constraints="value" />
 


convertConstraintsElement

Object convertConstraintsElement(Element element)

Converts the given "constraints" element to a layout manager specific constraints instance. The element may have any layout manager specific attributes or child elements.

If the layout converter does not use the "constraints" element, this method should return null.

XML notation:

 <label>
   <constraints attr1="value1" />
 </label>
 


SWIXML
1.6 (#161)

Copyright � 2002 - 2011 - Wolf Paulus - wolfpaulus.com. All rights reserved.