bibliothek.gui.dock.facile.mode
Class LocationSettingConverter

java.lang.Object
  extended by bibliothek.gui.dock.facile.mode.LocationSettingConverter
All Implemented Interfaces:
ModeSettingsConverter<Location,Location>

public class LocationSettingConverter
extends java.lang.Object
implements ModeSettingsConverter<Location,Location>

A ModeSettingsConverter for the LocationModeManager.

Author:
Benjamin Sigg

Constructor Summary
LocationSettingConverter()
           
 
Method Summary
 void addFactory(DockablePropertyFactory factory)
          Adds an additional factory to this converter, needed to read and write DockablePropertys.
 Location convertToSetting(Location a)
          Converts a property from the inside world into the world outside.
 Location convertToWorld(Location b)
          Converts a property from the outside world into the world of this setting.
 Location readProperty(java.io.DataInputStream in)
          Reads a single property.
 Location readPropertyXML(XElement element)
          Reads a single property.
 void writeProperty(Location element, java.io.DataOutputStream out)
          Writes a single property of this setting.
 void writePropertyXML(Location b, XElement element)
          Writes a single property as xml element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationSettingConverter

public LocationSettingConverter()
Method Detail

addFactory

public void addFactory(DockablePropertyFactory factory)
Adds an additional factory to this converter, needed to read and write DockablePropertys.

Parameters:
factory - the additional factory

convertToSetting

public Location convertToSetting(Location a)
Description copied from interface: ModeSettingsConverter
Converts a property from the inside world into the world outside.

Specified by:
convertToSetting in interface ModeSettingsConverter<Location,Location>
Parameters:
a - the property from inside
Returns:
a property from outside

convertToWorld

public Location convertToWorld(Location b)
Description copied from interface: ModeSettingsConverter
Converts a property from the outside world into the world of this setting.

Specified by:
convertToWorld in interface ModeSettingsConverter<Location,Location>
Parameters:
b - a property from outside
Returns:
a property from inside

writeProperty

public void writeProperty(Location element,
                          java.io.DataOutputStream out)
                   throws java.io.IOException
Description copied from interface: ModeSettingsConverter
Writes a single property of this setting.

Specified by:
writeProperty in interface ModeSettingsConverter<Location,Location>
Parameters:
element - the property to write
out - the stream to write into
Throws:
java.io.IOException - if an I/O-error occurs

readProperty

public Location readProperty(java.io.DataInputStream in)
                      throws java.io.IOException
Description copied from interface: ModeSettingsConverter
Reads a single property.

Specified by:
readProperty in interface ModeSettingsConverter<Location,Location>
Parameters:
in - the stream to read from
Returns:
the property that has been read.
Throws:
java.io.IOException - if an I/O-error occurs

writePropertyXML

public void writePropertyXML(Location b,
                             XElement element)
Description copied from interface: ModeSettingsConverter
Writes a single property as xml element.

Specified by:
writePropertyXML in interface ModeSettingsConverter<Location,Location>
Parameters:
b - the property to write
element - the element to write into, the attributes of the element must not be changed

readPropertyXML

public Location readPropertyXML(XElement element)
Description copied from interface: ModeSettingsConverter
Reads a single property.

Specified by:
readPropertyXML in interface ModeSettingsConverter<Location,Location>
Parameters:
element - the element to read the property from
Returns:
the new property