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

java.lang.Object
  extended by bibliothek.gui.dock.facile.station.split.ResizeElement<T>
Direct Known Subclasses:
ResizeLeaf, ResizeNode, ResizeRoot

public abstract class ResizeElement<T>
extends Object

Represents one node of the tree which represents the split-tree of a SplitDockStation.

Author:
Benjamin Sigg

Constructor Summary
ResizeElement(ResizeElement<T> parent, LockedResizeLayoutManager<T> layout)
          Creates a new element.
 
Method Summary
abstract  void adapt(double deltaWidth, double deltaHeight)
          Adapts the size of the children of this element given the size change the parent could provide.
protected abstract  ResizeRequest createRequest()
          Creates the initial request of changed sizes.
protected abstract  ResizeElement<T>[] getChildren()
          Gets the children of this element.
 LockedResizeLayoutManager<T> getLayout()
          Gets the layout that created this element.
 ResizeElement<T> getParent()
          Gets the parent of this node
 ResizeRequest getRequest()
          Gets the initial request for the size change.
 ResizeRoot<T> getResizeRoot()
          Gets the root of this tree.
 void prepareRequests()
          Calls createRequest() on this and recursively on all children.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResizeElement

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

Parameters:
parent - the parent of this
layout - the origin of this element
Method Detail

getParent

public ResizeElement<T> getParent()
Gets the parent of this node

Returns:
the parent or null if this is a root

getLayout

public LockedResizeLayoutManager<T> getLayout()
Gets the layout that created this element.

Returns:
the origin of this element

createRequest

protected abstract ResizeRequest createRequest()
Creates the initial request of changed sizes.

Returns:
the initial request or null

getRequest

public ResizeRequest getRequest()
Gets the initial request for the size change.

Returns:
the initial request or null

getChildren

protected abstract ResizeElement<T>[] getChildren()
Gets the children of this element.

Returns:
the children or null

prepareResize

public 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.


prepareRequests

public void prepareRequests()
Calls createRequest() on this and recursively on all children. Stores the result for later analysis.


adapt

public abstract void adapt(double deltaWidth,
                           double deltaHeight)
Adapts the size of the children of this element given the size change the parent could provide.

Parameters:
deltaWidth - the change of this elements width
deltaHeight - the change of this elements height

getResizeRoot

public ResizeRoot<T> getResizeRoot()
Gets the root of this tree.

Returns:
the root