bibliothek.gui.dock.station.split
Class SplitDockProperty

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

public class SplitDockProperty
extends AbstractDockableProperty

This property stores the location and the size of each child of a SplitDockStation. The property assumes that the station itself has a size of 1/1, and the top left edge is 0/0.

Author:
Benjamin Sigg

Field Summary
static SplitDockProperty EAST
          A property covering the right quarter of the station
static SplitDockProperty NORTH
          A property covering the top quarter of the station
static SplitDockProperty SOUTH
          A property covering the bottom quarter of the station
static SplitDockProperty WEST
          A property covering the left quarter of the station
 
Constructor Summary
SplitDockProperty()
          Constructs a new property with size and location equal to 0/0
SplitDockProperty(double x, double y, double width, double height)
          Creates a new property with the given values.
 
Method Summary
 DockableProperty copy()
          Gets a copy of this property, the successor must be copied as well.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getFactoryID()
          Gets the unique name of the DockablePropertyFactory which can create this type of DockableProperty.
 double getHeight()
          Gets the height of the child.
 double getWidth()
          Gets the width of the child.
 double getX()
          Gets the x-coordinate of the child.
 double getY()
          Gets the y-coordinate of the child.
 int hashCode()
           
 void load(java.io.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 setHeight(double height)
          Sets the height of the child.
 void setWidth(double width)
          Sets the width of the child.
 void setX(double x)
          Sets the x-coordinate of the child.
 void setY(double y)
          Sets the y-coordinate of the child.
 void store(java.io.DataOutputStream out)
          Stores the contents of this DockableProperty in a stream.
 void store(XElement element)
          Stores the contents of this property as xml element.
 java.lang.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

EAST

public static final SplitDockProperty EAST
A property covering the right quarter of the station


WEST

public static final SplitDockProperty WEST
A property covering the left quarter of the station


NORTH

public static final SplitDockProperty NORTH
A property covering the top quarter of the station


SOUTH

public static final SplitDockProperty SOUTH
A property covering the bottom quarter of the station

Constructor Detail

SplitDockProperty

public SplitDockProperty()
Constructs a new property with size and location equal to 0/0


SplitDockProperty

public SplitDockProperty(double x,
                         double y,
                         double width,
                         double height)
Creates a new property with the given values. The coordinates and the sizes should be in the range of 0 and 1, but the SplitDockStation can handle values that are out of bounds.

Parameters:
x - the x-coordinate
y - the y-coordinate
width - the width of the child
height - the height of the child
Method Detail

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

getFactoryID

public java.lang.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(java.io.DataOutputStream out)
           throws java.io.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:
java.io.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(java.io.DataInputStream in)
          throws java.io.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:
java.io.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

getHeight

public double getHeight()
Gets the height of the child.

Returns:
the height
See Also:
setHeight(double)

setHeight

public void setHeight(double height)
Sets the height of the child.

Parameters:
height - the height, should be between 0 and 1

getWidth

public double getWidth()
Gets the width of the child.

Returns:
the width
See Also:
setWidth(double)

setWidth

public void setWidth(double width)
Sets the width of the child.

Parameters:
width - the width, should be between 0 and 1

getX

public double getX()
Gets the x-coordinate of the child.

Returns:
the x-coordinate
See Also:
setX(double)

setX

public void setX(double x)
Sets the x-coordinate of the child.

Parameters:
x - the coordinate, should be between 0 and 1

getY

public double getY()
Gets the y-coordinate of the child.

Returns:
the coordinate
See Also:
setY(double)

setY

public void setY(double y)
Sets the y-coordinate of the child.

Parameters:
y - the coordinate, should be between 0 and 1

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractDockableProperty

equals

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