Class ResizeElement<T>

java.lang.Object
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 Details

    • 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 Details

    • 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.
    • isValid

      public boolean isValid()
      Checks whether this ResizeElement is valid. A valid ResizeElement has no children that are null.
      Returns:
      true if this element can actually be used
    • 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