SandMark version 3.0


sandmark.gui
Class ObfTree.ObfTreeNode

java.lang.Object
  |
  +--sandmark.gui.ObfTree.ObfTreeNode
All Implemented Interfaces:
javax.swing.tree.TreeNode
Enclosing class:
ObfTree

public abstract static class ObfTree.ObfTreeNode
extends java.lang.Object
implements javax.swing.tree.TreeNode

The nodes in an ObfTree's model are instances of classes that extend ObfTreeNode. Each node stores its name, a Vector of its children, a reference to its parent, and an ObfuscationConfigInfo object that represents the information currently chosen by the user for the node.


Field Summary
protected  ObfuscationConfigInfo m_info
          Stores the info chosen by the user for this node in the tree.
protected  java.util.Vector m_kids
          Stores this node's children.
protected  java.lang.String m_name
          The "name" of the node, returned by toString().
protected  ObfTree.ObfTreeNode m_parent
          The parent node, or null for the root.
 
Constructor Summary
ObfTree.ObfTreeNode()
           
 
Method Summary
 java.util.Enumeration children()
          Returns an Enumeration of this node's children.
 boolean getAllowsChildren()
          Since there's already isLeaf() and getChildCount(), I don't get why TreeNode has a getAllowsChildren()...
 javax.swing.tree.TreeNode getChildAt(int i)
          Return the ith child.
 int getChildCount()
          Get the number of children.
 int getIndex(javax.swing.tree.TreeNode node)
          Find a child.
 ObfuscationConfigInfo getInfo()
          Public accessor for m_info.
abstract  java.lang.String getKey()
          Returns the key on which the information for this node should be hashed in an ObfuscationConfigMap.
 javax.swing.tree.TreeNode getParent()
          Public accessor for m_parent.
 boolean isLeaf()
          Returns true or false depending on whether this node is a leaf.
protected  boolean loadCurrentSettings(ObfuscationConfigMap map)
          Retrieves the settings for this node from the current ObfuscationConfigMap, and initializes m_info to a deep (cloned) temporary copy.
 void storeCurrentSettings()
          Updates the current ObfuscationConfigMap with the latest information for this node.
 java.lang.String toString()
          Returns the string used to display this node in the tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_info

protected ObfuscationConfigInfo m_info
Stores the info chosen by the user for this node in the tree. Note that settings do not take effect until the user hits the OK button, so m_info is actually a clone of the instance mapped to by the current ObfuscationConfigMap.


m_kids

protected java.util.Vector m_kids
Stores this node's children. If this node has no children, m_kids is a Vector with zero elements.


m_parent

protected ObfTree.ObfTreeNode m_parent
The parent node, or null for the root.


m_name

protected java.lang.String m_name
The "name" of the node, returned by toString().

Constructor Detail

ObfTree.ObfTreeNode

public ObfTree.ObfTreeNode()
Method Detail

getInfo

public ObfuscationConfigInfo getInfo()
Public accessor for m_info.

Returns:
The ObfuscationConfigInfo for this node.

children

public java.util.Enumeration children()
Returns an Enumeration of this node's children.

Specified by:
children in interface javax.swing.tree.TreeNode
Returns:
The children.

getAllowsChildren

public boolean getAllowsChildren()
Since there's already isLeaf() and getChildCount(), I don't get why TreeNode has a getAllowsChildren()...

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Returns:
true

getChildAt

public javax.swing.tree.TreeNode getChildAt(int i)
Return the ith child.

Specified by:
getChildAt in interface javax.swing.tree.TreeNode
Parameters:
i - The index of the child to retrieve.
Returns:
The ith child.

getChildCount

public int getChildCount()
Get the number of children.

Specified by:
getChildCount in interface javax.swing.tree.TreeNode
Returns:
The number of kids.

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Find a child.

Specified by:
getIndex in interface javax.swing.tree.TreeNode
Parameters:
node - The child to locate.
Returns:
The index of the child in this node's child Vector.

getParent

public javax.swing.tree.TreeNode getParent()
Public accessor for m_parent.

Specified by:
getParent in interface javax.swing.tree.TreeNode
Returns:
The parent node.

isLeaf

public boolean isLeaf()
Returns true or false depending on whether this node is a leaf. The default implementation always returns false, but subclasses can override this method.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Returns:
false

getKey

public abstract java.lang.String getKey()
Returns the key on which the information for this node should be hashed in an ObfuscationConfigMap.

Returns:
Some String produced by a sandmark.util.Misc.getKeyFor***() method.

loadCurrentSettings

protected boolean loadCurrentSettings(ObfuscationConfigMap map)
Retrieves the settings for this node from the current ObfuscationConfigMap, and initializes m_info to a deep (cloned) temporary copy. If ObfuscationConfigInfo.clone() throws a CloneNotSupportedException (which shouldn't happen), loadCurrentSettings() prints an error and exits.


storeCurrentSettings

public void storeCurrentSettings()
Updates the current ObfuscationConfigMap with the latest information for this node.


toString

public java.lang.String toString()
Returns the string used to display this node in the tree.

Overrides:
toString in class java.lang.Object
Returns:
The name of the object represented by this node.

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003