Class TreeLayoutObserver

java.lang.Object
org.eclipse.zest.layouts.algorithms.TreeLayoutObserver

public class TreeLayoutObserver extends Object
A helper class for layout algorithms that are based on tree structure. It keeps track of changes in observed layout context and stores current information about the tree structure - children of each node and several other parameters.
Since:
2.0
  • Constructor Details

  • Method Details

    • recomputeTree

      public void recomputeTree()
      Recomputes all the information about the tree structure (the same effect as creating new TreeLayoutObserver).
    • stop

      public void stop()
      Stops this observer from listening to changes in observed layout context. After calling this method the information about tree structure can be updated only when recomputeTree() is called.
    • getSuperRoot

      public TreeLayoutObserver.TreeNode getSuperRoot()
      Returns Super Root, that is an artificial node being a common parent for all nodes in observed tree structure.
      Returns:
      Super Root
    • getTreeNode

      public TreeLayoutObserver.TreeNode getTreeNode(NodeLayout node)
      Returns a TreeLayoutObserver.TreeNode related to given node layout. If such a TreeNode doesn't exist, it's created.
      Parameters:
      node -
    • addTreeListener

      public void addTreeListener(TreeLayoutObserver.TreeListener listener)
      Adds a listener that will be informed about changes in tree structure.
      Parameters:
      listener - listener to add
    • removeTreeListener

      public void removeTreeListener(TreeLayoutObserver.TreeListener listener)
      Removes a listener from list of listener to be informed about changes in tree structure.
      Parameters:
      listener - listener to remove