diff options
| author | 2016-09-06 12:11:50 +0200 | |
|---|---|---|
| committer | 2016-09-06 12:11:50 +0200 | |
| commit | e0e3141619cecd54c087d964654e6c35511c48f9 (patch) | |
| tree | 9d7750f6abe26b4ca08cc9ffb516222569ebfd0b /src/main/java/cuchaz/enigma/gui/Gui.java | |
| parent | Avoid Engima converter detecting <init> and <clinit> as matchable token (diff) | |
| download | enigma-fork-e0e3141619cecd54c087d964654e6c35511c48f9.tar.gz enigma-fork-e0e3141619cecd54c087d964654e6c35511c48f9.tar.xz enigma-fork-e0e3141619cecd54c087d964654e6c35511c48f9.zip | |
A little bit of clean up
Diffstat (limited to 'src/main/java/cuchaz/enigma/gui/Gui.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/gui/Gui.java | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/main/java/cuchaz/enigma/gui/Gui.java b/src/main/java/cuchaz/enigma/gui/Gui.java index 46d3b5c..b523859 100644 --- a/src/main/java/cuchaz/enigma/gui/Gui.java +++ b/src/main/java/cuchaz/enigma/gui/Gui.java | |||
| @@ -639,26 +639,21 @@ public class Gui { | |||
| 639 | 639 | ||
| 640 | m_implementationsTree.setModel(null); | 640 | m_implementationsTree.setModel(null); |
| 641 | 641 | ||
| 642 | if (m_reference.entry instanceof ClassEntry) { | 642 | DefaultMutableTreeNode node = null; |
| 643 | // get the class implementations | 643 | |
| 644 | ClassImplementationsTreeNode node = this.controller.getClassImplementations((ClassEntry) m_reference.entry); | 644 | // get the class implementations |
| 645 | if (node != null) { | 645 | if (m_reference.entry instanceof ClassEntry) |
| 646 | // show the tree at the root | 646 | node = this.controller.getClassImplementations((ClassEntry) m_reference.entry); |
| 647 | TreePath path = getPathToRoot(node); | 647 | else // get the method implementations |
| 648 | m_implementationsTree.setModel(new DefaultTreeModel((TreeNode) path.getPathComponent(0))); | 648 | if (m_reference.entry instanceof MethodEntry) |
| 649 | m_implementationsTree.expandPath(path); | 649 | node = this.controller.getMethodImplementations((MethodEntry) m_reference.entry); |
| 650 | m_implementationsTree.setSelectionRow(m_implementationsTree.getRowForPath(path)); | 650 | |
| 651 | } | 651 | if (node != null) { |
| 652 | } else if (m_reference.entry instanceof MethodEntry) { | 652 | // show the tree at the root |
| 653 | // get the method implementations | 653 | TreePath path = getPathToRoot(node); |
| 654 | MethodImplementationsTreeNode node = this.controller.getMethodImplementations((MethodEntry) m_reference.entry); | 654 | m_implementationsTree.setModel(new DefaultTreeModel((TreeNode) path.getPathComponent(0))); |
| 655 | if (node != null) { | 655 | m_implementationsTree.expandPath(path); |
| 656 | // show the tree at the root | 656 | m_implementationsTree.setSelectionRow(m_implementationsTree.getRowForPath(path)); |
| 657 | TreePath path = getPathToRoot(node); | ||
| 658 | m_implementationsTree.setModel(new DefaultTreeModel((TreeNode) path.getPathComponent(0))); | ||
| 659 | m_implementationsTree.expandPath(path); | ||
| 660 | m_implementationsTree.setSelectionRow(m_implementationsTree.getRowForPath(path)); | ||
| 661 | } | ||
| 662 | } | 657 | } |
| 663 | 658 | ||
| 664 | m_tabs.setSelectedIndex(1); | 659 | m_tabs.setSelectedIndex(1); |