UndoRedo V1.2
by Matthew Ford
2005/06/27

au.com.forward.undoRedo
Class UndoRedoTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by au.com.forward.undoRedo.UndoRedoTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
BranchDefaultMutableTreeNode

public class UndoRedoTreeNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.lang.Cloneable

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
UndoRedoTreeNode()
          Creates a new instance of UndoRedoTreeNode
UndoRedoTreeNode(java.lang.Object userObject)
          Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.
 
Method Summary
 java.lang.Object clone()
          Clone the undo/redo tree structure.
 javax.swing.undo.UndoableEdit getUndoableEdit()
          Get the undoableEdit held by this node
 java.lang.String toFullString()
          The string representation of this node and the tree rooted on it.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, 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
 

Constructor Detail

UndoRedoTreeNode

public UndoRedoTreeNode()
Creates a new instance of UndoRedoTreeNode


UndoRedoTreeNode

public UndoRedoTreeNode(java.lang.Object userObject)
Creates a tree node with no parent, no children, but which allows children, and initializes it with the specified user object.

Parameters:
userObject - an Object provided by the user that constitutes the node's data
Method Detail

getUndoableEdit

public javax.swing.undo.UndoableEdit getUndoableEdit()
Get the undoableEdit held by this node

Returns:
the undoableEdit for this node or null if this node does not hold one, i.e. the rootNode.

toFullString

public java.lang.String toFullString()
The string representation of this node and the tree rooted on it.

Returns:
a string representation of the tree starting at this node

clone

public java.lang.Object clone()
Clone the undo/redo tree structure.

Overrides:
clone in class javax.swing.tree.DefaultMutableTreeNode
Returns:
deep clone of the undo/redo tree structure, but without cloning the nodes themselves

©2005, Forward Computing and Control Pty. Ltd
ACN 003 669 994   NSW Australia
All Rights Reserved.