org.lyra.Widgets
Class LyraMutableTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by org.lyra.Widgets.LyraMutableTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class LyraMutableTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

A slight variant of the DefaultMutableTreeNode class that also aims to add in two identifiers into the mix. These identifiers permit the application to quickly determine type and name in order to process.

Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster
See Also:
Serialized Form

Field Summary
private  java.lang.String myGroup
           
private  java.lang.String myName
           
private static long serialVersionUID
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
LyraMutableTreeNode()
          Creates a tree node that has no parent and no children, but which allows children.
LyraMutableTreeNode(java.lang.Object userObject, java.lang.String nodeGroup)
          Creates a tree node with no parent, no children, but which allows children, and initialises it with the specified user object.
LyraMutableTreeNode(java.lang.Object userObject, java.lang.String nodeGroup, java.lang.String nodeName)
          Creates a tree node with no parent, no children, but which allows children, and initialises it with the specified user object.
 
Method Summary
 java.lang.String getGroup()
          Get the group identifier.
 java.lang.String getName()
          Get the name identifier.
 void setGroup(java.lang.String nodeGroup)
          Set the group identifier.
 void setName(java.lang.String nodeName)
          Set the name identifier.
 
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

myGroup

private java.lang.String myGroup

myName

private java.lang.String myName
Constructor Detail

LyraMutableTreeNode

public LyraMutableTreeNode()
Creates a tree node that has no parent and no children, but which allows children. There are also no identifier elements installed.


LyraMutableTreeNode

public LyraMutableTreeNode(java.lang.Object userObject,
                           java.lang.String nodeGroup)
Creates a tree node with no parent, no children, but which allows children, and initialises it with the specified user object. The lack of nodeName element will create this to support children.

Parameters:
userObject - An Object provided by the user that constitutes the node's data
nodeGroup - A string containing which group this item will be a part of.

LyraMutableTreeNode

public LyraMutableTreeNode(java.lang.Object userObject,
                           java.lang.String nodeGroup,
                           java.lang.String nodeName)
Creates a tree node with no parent, no children, but which allows children, and initialises it with the specified user object. With nodeName specified children will not be permitted.

Parameters:
userObject - An Object provided by the user that constitutes the node's data
nodeGroup - A string containing which group this item will be a part of.
nodeName - A string indicating the name identifier of this tree.
Method Detail

setGroup

public void setGroup(java.lang.String nodeGroup)
Set the group identifier.

Parameters:
nodeGroup - String containing group identifier.

getGroup

public java.lang.String getGroup()
Get the group identifier.

Returns:
String containing group identifier.

setName

public void setName(java.lang.String nodeName)
Set the name identifier.

Parameters:
nodeName - String containing name identifier.

getName

public java.lang.String getName()
Get the name identifier.

Returns:
String containing name identifier.