Class ExpandTreeController

java.lang.Object
introspector.controller.ExpandTreeController

public class ExpandTreeController extends Object
This controller implements different ways of expanding tree views (JTrees).
  • 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 expanded
      node - the node we want al the children to be expanded transitively
      treePath - the path describing when the node is placed in the tree
      alreadyVisited - the list of nodes visited to avoid infinite loops in graphs
      Returns:
      the nodes visited in the traversal
    • expandAllFromNode

      public List<Node> expandAllFromNode(JTree tree, Node node, TreePath treePath)
      Expands all the nodes that are descendants of a given node in a tree view
      Parameters:
      tree - the JTree to be expanded
      node - the node we want al the children to be expanded transitively
      treePath - the path describing when the node is placed in the tree
      Returns:
      the nodes visited in the traversal
    • expandAllFromSelectedNode

      public List<Node> expandAllFromSelectedNode(JTree tree)
      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

      public List<Node> expandAllFromRootNode(List<JTree> trees)
      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