Package introspector.controller
Class CompareTreesController
java.lang.Object
introspector.controller.CompareTreesController
This controller implements the comparison of two trees selected by the user.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JLabelThe label where the status message is written -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompareTrees(List<JTree> trees) Expands all the nodes that are descendants of the root node in a tree view.private Pair[]getSelectedNodes(List<JTree> trees) Gets the two selected nodes in the treesprivate static voidshowSelectedNodes(List<JTree> trees, Set<Node> modifiedNodes) Shows the nodes that are different in the treesprivate booleantwoNodesSelected(List<JTree> trees) Checks if exactly two nodes are selected in the trees
-
Field Details
-
statusLabel
The label where the status message is written
-
-
Constructor Details
-
CompareTreesController
Constructor- Parameters:
statusLabel- the label where the status message is written
-
-
Method Details
-
compareTrees
Expands all the nodes that are descendants of the root node in a tree view.- Parameters:
trees- all the trees in the view
-
showSelectedNodes
Shows the nodes that are different in the trees- Parameters:
trees- the treesmodifiedNodes- the nodes that are different
-
getSelectedNodes
Gets the two selected nodes in the trees- Parameters:
trees- the trees- Returns:
- the two selected nodes as TreePaths
-
twoNodesSelected
Checks if exactly two nodes are selected in the trees- Parameters:
trees- the trees- Returns:
- true if exactly two nodes are selected
-