Package introspector.controller
Class ExpandTreeController
java.lang.Object
introspector.controller.ExpandTreeController
This controller implements different ways of expanding tree views (JTrees).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpandAllFromNode(JTree tree, Node node, TreePath treePath) Expands all the nodes that are descendants of a given node in a tree viewExpands all the nodes that are descendants of a given node in a tree viewexpandAllFromRootNode(List<JTree> trees) Expands all the nodes that are descendants of the root node in a tree view.Expands all the nodes that are descendants of the selected node in a tree view.
-
Constructor Details
-
ExpandTreeController
public ExpandTreeController()
-
-
Method Details
-
expandAllFromNode
private List<Node> expandAllFromNode(JTree tree, Node node, TreePath treePath, List<Node> alreadyVisited) Expands all the nodes that are descendants of a given node in a tree view- Parameters:
tree- the JTree to be expandednode- the node we want al the children to be expanded transitivelytreePath- the path describing when the node is placed in the treealreadyVisited- the list of nodes visited to avoid infinite loops in graphs- Returns:
- the nodes visited in the traversal
-
expandAllFromNode
Expands all the nodes that are descendants of a given node in a tree view- Parameters:
tree- the JTree to be expandednode- the node we want al the children to be expanded transitivelytreePath- the path describing when the node is placed in the tree- Returns:
- the nodes visited in the traversal
-
expandAllFromSelectedNode
Expands all the nodes that are descendants of the selected node in a tree view. If no node is selected, then all the tree will be expanded.- Parameters:
tree- the JTree to be expanded- Returns:
- the nodes visited in the traversal
-
expandAllFromRootNode
Expands all the nodes that are descendants of the root node in a tree view.- Parameters:
trees- the JTrees to be expanded- Returns:
- the nodes visited in the traversal
-