bibliothek.gui.dock.facile.station.split
Class ResizeNode<T>

java.lang.Object
  extended by bibliothek.gui.dock.facile.station.split.ResizeElement<T>
      extended by bibliothek.gui.dock.facile.station.split.ResizeNode<T>

public class ResizeNode<T>
extends ResizeElement<T>

Represents a Node.

Author:
Benjamin Sigg

Constructor Summary
ResizeNode(LockedResizeLayoutManager<T> layout, ResizeElement<T> parent, Node node)
          Creates a new node-element.
 
Method Summary
 void adapt(double deltaWidth, double deltaHeight)
          Adapts the size of the children of this element given the size change the parent could provide.
protected  ResizeRequest createRequest()
          Creates the initial request of changed sizes.
protected  ResizeElement<T>[] getChildren()
          Gets the children of this element.
 double getDividerHeight()
          Gets the space that a divider needs in the height.
 double getDividerWidth()
          Gets the space that a divider needs in the width.
 ResizeElement<T> getLeft()
          Gets the left or top child of this node
 double getNewDividerSize()
          Gets the space the divider needs right now.
 Node getNode()
          Gets the node that is represented by this element
 double getOldDividerSize()
          Gets the space the divider needed before the resize.
 ResizeElement<T> getRight()
          Gets the right or bottom child of this node
 void prepareResize()
          Called before the bounds of a tree are updated, can be used to store some properties that are later needed to create the ResizeRequest.
 
Methods inherited from class bibliothek.gui.dock.facile.station.split.ResizeElement
getLayout, getParent, getRequest, getResizeRoot, isValid, prepareRequests
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResizeNode

public ResizeNode(LockedResizeLayoutManager<T> layout,
                  ResizeElement<T> parent,
                  Node node)
Creates a new node-element.

Parameters:
layout - the layout that uses this node
parent - the parent of this node
node - the node that is represented by this node-element
Method Detail

getNode

public Node getNode()
Gets the node that is represented by this element

Returns:
the node

getLeft

public ResizeElement<T> getLeft()
Gets the left or top child of this node

Returns:
the left or top child

getRight

public ResizeElement<T> getRight()
Gets the right or bottom child of this node

Returns:
the left or bottom child

getChildren

protected ResizeElement<T>[] getChildren()
Description copied from class: ResizeElement
Gets the children of this element.

Specified by:
getChildren in class ResizeElement<T>
Returns:
the children or null

prepareResize

public void prepareResize()
Description copied from class: ResizeElement
Called before the bounds of a tree are updated, can be used to store some properties that are later needed to create the ResizeRequest.

Overrides:
prepareResize in class ResizeElement<T>

getDividerWidth

public double getDividerWidth()
Gets the space that a divider needs in the width.

Returns:
the width of a divider

getDividerHeight

public double getDividerHeight()
Gets the space that a divider needs in the height.

Returns:
the height of a divider

getNewDividerSize

public double getNewDividerSize()
Gets the space the divider needs right now.

Returns:
the space the divider occupies now

getOldDividerSize

public double getOldDividerSize()
Gets the space the divider needed before the resize.

Returns:
the old size needed by the divider

createRequest

protected ResizeRequest createRequest()
Description copied from class: ResizeElement
Creates the initial request of changed sizes.

Specified by:
createRequest in class ResizeElement<T>
Returns:
the initial request or null

adapt

public void adapt(double deltaWidth,
                  double deltaHeight)
Description copied from class: ResizeElement
Adapts the size of the children of this element given the size change the parent could provide.

Specified by:
adapt in class ResizeElement<T>
Parameters:
deltaWidth - the change of this elements width
deltaHeight - the change of this elements height