bibliothek.gui.dock.layout
Class DockLayoutInfo

java.lang.Object
  extended by bibliothek.gui.dock.layout.DockLayoutInfo

public class DockLayoutInfo
extends Object

A DockLayoutInfo is a wrapper around a DockLayout. The DockLayout can either be stored as real object, as byte-stream or as part of an xml tree. This information is normally used by a DockConverter to create or store DockElements.

Author:
Benjamin Sigg

Nested Class Summary
static class DockLayoutInfo.Data
          The kind of information a DockLayoutInfo contains.
 
Constructor Summary
DockLayoutInfo()
          Creates a new info.
DockLayoutInfo(byte[] data)
          Creates a new info.
DockLayoutInfo(DockLayout<?> data)
          Creates a new info
DockLayoutInfo(XElement data)
          Creates a new info.
 
Method Summary
 byte[] getDataByte()
          Gets the data of this info as byte array.
 DockLayout<?> getDataLayout()
          Gets the data of this info as DockLayout.
 XElement getDataXML()
          Gets the data of this info formated as xml.
 DockLayoutInfo.Data getKind()
          Tells what kind of information can be found in this info.
 DockableProperty getLocation()
          Gets the location of of the Dockable on its parent station.
 Path getPlaceholder()
          Gets the representation of this element as placeholder.
 void setData(Object data)
          Sets the information of this info.
 void setLocation(DockableProperty location)
          Sets the location of the Dockable ,represented by this info, on its parent station.
 void setPlaceholder(Path placeholder)
          Sets a placeholder which represents this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockLayoutInfo

public DockLayoutInfo()
Creates a new info.


DockLayoutInfo

public DockLayoutInfo(byte[] data)
Creates a new info.

Parameters:
data - the data of this info

DockLayoutInfo

public DockLayoutInfo(XElement data)
Creates a new info.

Parameters:
data - the data of this info

DockLayoutInfo

public DockLayoutInfo(DockLayout<?> data)
Creates a new info

Parameters:
data - the data of this info
Method Detail

getKind

public DockLayoutInfo.Data getKind()
Tells what kind of information can be found in this info.

Returns:
the kind of information, not null

setLocation

public void setLocation(DockableProperty location)
Sets the location of the Dockable ,represented by this info, on its parent station.

Parameters:
location - the location, can be null

getLocation

public DockableProperty getLocation()
Gets the location of of the Dockable on its parent station.

Returns:
the location, may be null

setPlaceholder

public void setPlaceholder(Path placeholder)
Sets a placeholder which represents this element.

Parameters:
placeholder - the placeholder, can be null

getPlaceholder

public Path getPlaceholder()
Gets the representation of this element as placeholder.

Returns:
the placeholder, can be null

setData

public void setData(Object data)
Sets the information of this info. The object data must either be null, or an instance of XElement, byte[] or DockLayout

Parameters:
data - the new data
Throws:
IllegalArgumentException - if data has not one of the specified types

getDataXML

public XElement getDataXML()
Gets the data of this info formated as xml.

Returns:
the xml data or null if it cannot be converted

getDataByte

public byte[] getDataByte()
Gets the data of this info as byte array.

Returns:
the byte data or null if it cannot be converted

getDataLayout

public DockLayout<?> getDataLayout()
Gets the data of this info as DockLayout.

Returns:
the DockLayout data or null