org.peace_tools.generic
Class IconTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.peace_tools.generic.IconTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class IconTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

A simple tree node that also permits an icon to be set. This is an custom class that is used in the properties tree to create a tree node with a predefined icon. Setting the icon in the tree node makes developing a suitable cell renderer easier.

See Also:
PropertiesTreeMaker, Serialized Form

Field Summary
private  javax.swing.Icon icon
          The icon to be used for this mutable tree node.
private static long serialVersionUID
          A generated serialization UID (just to keep the compiler happy).
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
IconTreeNode(java.lang.Object object, javax.swing.Icon icon)
          Constructor to create a tree node with an icon.
 
Method Summary
 javax.swing.Icon getIcon()
          Obtain the icon set for this tree node.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

icon

private javax.swing.Icon icon
The icon to be used for this mutable tree node. This value is typically set in the constructor.


serialVersionUID

private static final long serialVersionUID
A generated serialization UID (just to keep the compiler happy).

See Also:
Constant Field Values
Constructor Detail

IconTreeNode

public IconTreeNode(java.lang.Object object,
                    javax.swing.Icon icon)
Constructor to create a tree node with an icon. This constructor permits the creation of a tree node with a suitable icon.

Parameters:
object - The object to be associated with this tree node. This value is the user object set in the DefaultMutableTreeNode class.
icon - The icon (if any) to be associated with this tree node. This value can be null.
Method Detail

getIcon

public javax.swing.Icon getIcon()
Obtain the icon set for this tree node. This method must be used to obtain the icon set for this tree node.

Returns:
The icon set for this tree node. If a valid icon has not been set then this method returns null.