bibliothek.gui.dock.station.stack
Class StackDockProperty

java.lang.Object
  extended by bibliothek.gui.dock.layout.AbstractDockableProperty
      extended by bibliothek.gui.dock.station.stack.StackDockProperty
All Implemented Interfaces:
DockableProperty

public class StackDockProperty
extends AbstractDockableProperty

A StackDockProperty stores the location of a Dockable on a StackDockStation. The Dockables on a StackDockStation are ordered in some way, and the location is used to tell which Dockable is in front of another Dockable.

Author:
Benjamin Sigg

Field Summary
static StackDockProperty BACK
          The last location on a StackDockStation
static StackDockProperty FRONT
          The first location on a StackDockStation
 
Constructor Summary
StackDockProperty()
          Constructs a property with a location equal to 0.
StackDockProperty(int index)
          Constructs a property.
StackDockProperty(int index, Path placeholder)
          Constructs a property.
 
Method Summary
 DockableProperty copy()
          Gets a copy of this property, the successor must be copied as well.
 boolean equals(Object obj)
           
 String getFactoryID()
          Gets the unique name of the DockablePropertyFactory which can create this type of DockableProperty.
 int getIndex()
          Gets the location of this property.
 Path getPlaceholder()
          Gets the placeholder naming this location.
 int hashCode()
           
 void load(DataInputStream in)
          Reads the contents of this DockableProperty from a stream.
 void load(XElement element)
          Reads the contents of this DockableProperty from an xml element.
 void setIndex(int index)
          Sets the location which is determined by this property.
 void setPlaceholder(Path placeholder)
          Sets the placeholder name this location.
 void store(DataOutputStream out)
          Stores the contents of this DockableProperty in a stream.
 void store(XElement element)
          Stores the contents of this property as xml element.
 String toString()
           
 
Methods inherited from class bibliothek.gui.dock.layout.AbstractDockableProperty
copy, equalsNoSuccessor, getSuccessor, setSuccessor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FRONT

public static final StackDockProperty FRONT
The first location on a StackDockStation


BACK

public static final StackDockProperty BACK
The last location on a StackDockStation

Constructor Detail

StackDockProperty

public StackDockProperty(int index)
Constructs a property.

Parameters:
index - The location

StackDockProperty

public StackDockProperty(int index,
                         Path placeholder)
Constructs a property.

Parameters:
index - The location
placeholder - a name for this location

StackDockProperty

public StackDockProperty()
Constructs a property with a location equal to 0.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

copy

public DockableProperty copy()
Description copied from interface: DockableProperty
Gets a copy of this property, the successor must be copied as well.

Returns:
an independent copy of this

setIndex

public void setIndex(int index)
Sets the location which is determined by this property. The smallest location is 0.

Parameters:
index - the location

getIndex

public int getIndex()
Gets the location of this property.

Returns:
the location
See Also:
setIndex(int)

setPlaceholder

public void setPlaceholder(Path placeholder)
Sets the placeholder name this location.

Parameters:
placeholder - the placeholder, can be null

getPlaceholder

public Path getPlaceholder()
Gets the placeholder naming this location.

Returns:
the placeholder, can be null

getFactoryID

public String getFactoryID()
Description copied from interface: DockableProperty
Gets the unique name of the DockablePropertyFactory which can create this type of DockableProperty.

Returns:
the id
See Also:
DockablePropertyFactory

store

public void store(DataOutputStream out)
           throws IOException
Description copied from interface: DockableProperty
Stores the contents of this DockableProperty in a stream. The successor (if there is one) must not be saved.

Parameters:
out - the stream to write in
Throws:
IOException - if anything unexpected happens

store

public void store(XElement element)
Description copied from interface: DockableProperty
Stores the contents of this property as xml element.

Parameters:
element - the element into which to write, the attributes of this element should not be changed

load

public void load(DataInputStream in)
          throws IOException
Description copied from interface: DockableProperty
Reads the contents of this DockableProperty from a stream. The property can assume that a property with the same type has written into the stream.

Parameters:
in - the stream to read
Throws:
IOException - if anything unexpected happens

load

public void load(XElement element)
Description copied from interface: DockableProperty
Reads the contents of this DockableProperty from an xml element.

Parameters:
element - the element that was written earlier by this property

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractDockableProperty

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractDockableProperty