Class TreeLayoutObserver
java.lang.Object
org.eclipse.zest.layouts.algorithms.TreeLayoutObserver
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
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classA superclass for listeners that can be added to this observer to get notification whenever the tree structure changes.static classRepresents a node in a tree structure and stores all information related to it.static classTreeLayoutObserveruses instance of this class to create instances ofTreeLayoutObserver.TreeNode.
- 
Constructor SummaryConstructorsConstructorDescriptionTreeLayoutObserver(LayoutContext context, TreeLayoutObserver.TreeNodeFactory nodeFactory) Creates a
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a listener that will be informed about changes in tree structure.Returns Super Root, that is an artificial node being a common parent for all nodes in observed tree structure.getTreeNode(NodeLayout node) Returns aTreeLayoutObserver.TreeNoderelated to given node layout.voidRecomputes all the information about the tree structure (the same effect as creating newTreeLayoutObserver).voidRemoves a listener from list of listener to be informed about changes in tree structure.voidstop()Stops this observer from listening to changes in observed layout context.
- 
Constructor Details- 
TreeLayoutObserverCreates a- Parameters:
- context-
- nodeFactory-
 
 
- 
- 
Method Details- 
recomputeTreepublic void recomputeTree()Recomputes all the information about the tree structure (the same effect as creating newTreeLayoutObserver).
- 
stoppublic 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 whenrecomputeTree()is called.
- 
getSuperRootReturns Super Root, that is an artificial node being a common parent for all nodes in observed tree structure.- Returns:
- Super Root
 
- 
getTreeNodeReturns aTreeLayoutObserver.TreeNoderelated to given node layout. If such aTreeNodedoesn't exist, it's created.- Parameters:
- node-
 
- 
addTreeListenerAdds a listener that will be informed about changes in tree structure.- Parameters:
- listener- listener to add
 
- 
removeTreeListenerRemoves a listener from list of listener to be informed about changes in tree structure.- Parameters:
- listener- listener to remove
 
 
-