Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/main/java/WordNet/Annotation/WordNetEditorFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import java.awt.*;
Expand Down Expand Up @@ -576,27 +577,29 @@ public void actionPerformed(ActionEvent e) {
* @param node Parent node
*/
private void expandAll(DefaultMutableTreeNode node) {
ArrayList<DefaultMutableTreeNode> list = Collections.list(node.children());
for (DefaultMutableTreeNode treeNode : list) {
expandAll(treeNode);
ArrayList<TreeNode> list = Collections.list(node.children());
for (TreeNode treeNode : list) {
expandAll((DefaultMutableTreeNode) treeNode);
}
TreePath path = new TreePath(node.getPath());
noun.tree.expandPath(path);
}


/**
* Collapses all child nodes of the selected parent node
* @param node Parent node
*/
private void collapseAll(DefaultMutableTreeNode node) {
ArrayList<DefaultMutableTreeNode> list = Collections.list(node.children());
for (DefaultMutableTreeNode treeNode : list) {
collapseAll(treeNode);
ArrayList<TreeNode> list = Collections.list(node.children());
for (TreeNode treeNode : list) {
collapseAll((DefaultMutableTreeNode) treeNode);
}
TreePath path = new TreePath(node.getPath());
noun.tree.collapsePath(path);
}


/**
* Adds the given synset with the given pos to the part of speech tree.
* @param newSynSet New synset to be added.
Expand Down