bibliothek.gui.dock.station.flap
Class FlapDockProperty

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

public class FlapDockProperty
extends AbstractDockableProperty

FlapDockProperties are used on the FlapDockStation to determine the location of a Dockable.

Author:
Benjamin Sigg

Field Summary
static FlapDockProperty FIRST
          The location of the first Dockable.
static FlapDockProperty LAST
          The location of the last Dockable.
 
Constructor Summary
FlapDockProperty()
          Constructs a FlapDockProperty
FlapDockProperty(int index)
          Constructs a FlapDockProperty
FlapDockProperty(int index, boolean holding, int size)
          Constructs a FlapDockProperty
FlapDockProperty(int index, boolean holding, int size, Path placeholder)
          Constructs a FlapDockProperty
 
Method Summary
 FlapDockProperty 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 the Dockable on its FlapDockStation.
 Path getPlaceholder()
          Gets the name of this location.
 int getSize()
          Gets the size the window has in which the Dockable will be presented.
 int hashCode()
           
 boolean isHolding()
          Tells whether an element was pinned down or not.
 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 setHolding(boolean holding)
          Whether the element should be pinned down or not.
 void setIndex(int index)
          Sets the location of the Dockable on its FlapDockStation.
 void setPlaceholder(Path placeholder)
          Sets the name of this location.
 void setSize(int size)
          Sets the size the window has in which the Dockable will be presented.
 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

FIRST

public static final FlapDockProperty FIRST
The location of the first Dockable.


LAST

public static final FlapDockProperty LAST
The location of the last Dockable.

Constructor Detail

FlapDockProperty

public FlapDockProperty()
Constructs a FlapDockProperty


FlapDockProperty

public FlapDockProperty(int index)
Constructs a FlapDockProperty

Parameters:
index - the location of the Dockable
See Also:
setIndex(int)

FlapDockProperty

public FlapDockProperty(int index,
                        boolean holding,
                        int size)
Constructs a FlapDockProperty

Parameters:
index - the location of the Dockable
holding - whether the Dockable is pinned down or not
size - the size of the window, -1 if unknown
See Also:
setIndex(int), setHolding(boolean), setSize(int)

FlapDockProperty

public FlapDockProperty(int index,
                        boolean holding,
                        int size,
                        Path placeholder)
Constructs a FlapDockProperty

Parameters:
index - the location of the Dockable
holding - whether the Dockable is pinned down or not
size - the size of the window, -1 if unknown
placeholder - the name of this location
See Also:
setIndex(int), setHolding(boolean), setSize(int), setPlaceholder(Path)
Method Detail

copy

public FlapDockProperty 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 of the Dockable on its FlapDockStation.

Parameters:
index - the location

getIndex

public int getIndex()
Gets the location of the Dockable on its FlapDockStation.

Returns:
the location
See Also:
setIndex(int)

setHolding

public void setHolding(boolean holding)
Whether the element should be pinned down or not.

Parameters:
holding - true if it should be pinned, false if not

isHolding

public boolean isHolding()
Tells whether an element was pinned down or not.

Returns:
true if pinned down, false otherwise

setSize

public void setSize(int size)
Sets the size the window has in which the Dockable will be presented.

Parameters:
size - the size, -1 if unknown

getSize

public int getSize()
Gets the size the window has in which the Dockable will be presented.

Returns:
the size or -1 if unknown

setPlaceholder

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

Parameters:
placeholder - the placeholder, can be null

getPlaceholder

public Path getPlaceholder()
Gets the name of this location.

Returns:
the name, 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

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractDockableProperty

equals

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