summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/analysis/ClassInheritanceTreeNode.java
diff options
context:
space:
mode:
authorGravatar jeff2014-08-11 00:02:00 -0400
committerGravatar jeff2014-08-11 00:02:00 -0400
commitbba7c6a19c15bc82946176c79a4eba3612b25f17 (patch)
treef0b55befaa6e7e532e9728dfa6b1c9cb36660594 /src/cuchaz/enigma/analysis/ClassInheritanceTreeNode.java
parentadded backwards navigation (diff)
downloadenigma-fork-bba7c6a19c15bc82946176c79a4eba3612b25f17.tar.gz
enigma-fork-bba7c6a19c15bc82946176c79a4eba3612b25f17.tar.xz
enigma-fork-bba7c6a19c15bc82946176c79a4eba3612b25f17.zip
added method inheritance browsing
also finally fixed method renamer to rename all method implementations in the inheritance hierarchy.
Diffstat (limited to '')
-rw-r--r--src/cuchaz/enigma/analysis/ClassInheritanceTreeNode.java (renamed from src/cuchaz/enigma/gui/ClassInheritanceTreeNode.java)24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/cuchaz/enigma/gui/ClassInheritanceTreeNode.java b/src/cuchaz/enigma/analysis/ClassInheritanceTreeNode.java
index 295bebe..2ed141f 100644
--- a/src/cuchaz/enigma/gui/ClassInheritanceTreeNode.java
+++ b/src/cuchaz/enigma/analysis/ClassInheritanceTreeNode.java
@@ -8,7 +8,7 @@
8 * Contributors: 8 * Contributors:
9 * Jeff Martin - initial API and implementation 9 * Jeff Martin - initial API and implementation
10 ******************************************************************************/ 10 ******************************************************************************/
11package cuchaz.enigma.gui; 11package cuchaz.enigma.analysis;
12 12
13import java.util.List; 13import java.util.List;
14 14
@@ -16,7 +16,7 @@ import javax.swing.tree.DefaultMutableTreeNode;
16 16
17import com.google.common.collect.Lists; 17import com.google.common.collect.Lists;
18 18
19import cuchaz.enigma.mapping.Ancestries; 19import cuchaz.enigma.mapping.ClassEntry;
20import cuchaz.enigma.mapping.Translator; 20import cuchaz.enigma.mapping.Translator;
21 21
22public class ClassInheritanceTreeNode extends DefaultMutableTreeNode 22public class ClassInheritanceTreeNode extends DefaultMutableTreeNode
@@ -76,4 +76,24 @@ public class ClassInheritanceTreeNode extends DefaultMutableTreeNode
76 } 76 }
77 } 77 }
78 } 78 }
79
80 public static ClassInheritanceTreeNode findNode( ClassInheritanceTreeNode node, ClassEntry entry )
81 {
82 // is this the node?
83 if( node.getObfClassName().equals( entry.getName() ) )
84 {
85 return node;
86 }
87
88 // recurse
89 for( int i=0; i<node.getChildCount(); i++ )
90 {
91 ClassInheritanceTreeNode foundNode = findNode( (ClassInheritanceTreeNode)node.getChildAt( i ), entry );
92 if( foundNode != null )
93 {
94 return foundNode;
95 }
96 }
97 return null;
98 }
79} 99}