diff options
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 | ******************************************************************************/ |
| 11 | package cuchaz.enigma.gui; | 11 | package cuchaz.enigma.analysis; |
| 12 | 12 | ||
| 13 | import java.util.List; | 13 | import java.util.List; |
| 14 | 14 | ||
| @@ -16,7 +16,7 @@ import javax.swing.tree.DefaultMutableTreeNode; | |||
| 16 | 16 | ||
| 17 | import com.google.common.collect.Lists; | 17 | import com.google.common.collect.Lists; |
| 18 | 18 | ||
| 19 | import cuchaz.enigma.mapping.Ancestries; | 19 | import cuchaz.enigma.mapping.ClassEntry; |
| 20 | import cuchaz.enigma.mapping.Translator; | 20 | import cuchaz.enigma.mapping.Translator; |
| 21 | 21 | ||
| 22 | public class ClassInheritanceTreeNode extends DefaultMutableTreeNode | 22 | public 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 | } |