Class CompareTreesController

java.lang.Object
introspector.controller.CompareTreesController

public class CompareTreesController extends Object
This controller implements the comparison of two trees selected by the user.
  • Field Details

    • statusLabel

      private final JLabel statusLabel
      The label where the status message is written
  • Constructor Details

    • CompareTreesController

      public CompareTreesController(JLabel statusLabel)
      Constructor
      Parameters:
      statusLabel - the label where the status message is written
  • Method Details

    • compareTrees

      public void compareTrees(List<JTree> trees)
      Expands all the nodes that are descendants of the root node in a tree view.
      Parameters:
      trees - all the trees in the view
    • showSelectedNodes

      private static void showSelectedNodes(List<JTree> trees, Set<Node> modifiedNodes)
      Shows the nodes that are different in the trees
      Parameters:
      trees - the trees
      modifiedNodes - the nodes that are different
    • getSelectedNodes

      private Pair[] getSelectedNodes(List<JTree> trees)
      Gets the two selected nodes in the trees
      Parameters:
      trees - the trees
      Returns:
      the two selected nodes as TreePaths
    • twoNodesSelected

      private boolean twoNodesSelected(List<JTree> trees)
      Checks if exactly two nodes are selected in the trees
      Parameters:
      trees - the trees
      Returns:
      true if exactly two nodes are selected