org.openswing.swing.tree.java
Class OpenSwingTreeNode

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byorg.openswing.swing.tree.java.OpenSwingTreeNode
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class OpenSwingTreeNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.io.Serializable

Title: OpenSwing Framework

Description: This class inherits from DefaultMutableTreeNode: it allows to store userObject too. In fact, serObject is not transient, so it cannot be send through the net using java 1.5/1.6 and Hessian.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
OpenSwingTreeNode()
          Creates a tree node that has no parent and no children, but which allows children.
OpenSwingTreeNode(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.
OpenSwingTreeNode(java.lang.Object userObject, boolean allowsChildren)
          Creates a tree node with no parent, no children, initialized with the specified user object, and that allows children only if specified.
 
Method Summary
 java.lang.Object getUserObject()
          Returns this node's user object.
 void setUserObject(java.lang.Object userObject)
          Sets the user object for this node to userObject.
 java.lang.String toString()
           
 
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, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenSwingTreeNode

public OpenSwingTreeNode()
Creates a tree node that has no parent and no children, but which allows children.


OpenSwingTreeNode

public OpenSwingTreeNode(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

OpenSwingTreeNode

public OpenSwingTreeNode(java.lang.Object userObject,
                         boolean allowsChildren)
Creates a tree node with no parent, no children, initialized with the specified user object, and that allows children only if specified.

Parameters:
userObject - an Object provided by the user that constitutes the node's data
allowsChildren - if true, the node is allowed to have child nodes -- otherwise, it is always a leaf node
Method Detail

setUserObject

public final void setUserObject(java.lang.Object userObject)
Sets the user object for this node to userObject.

Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode
Parameters:
userObject - the Object that constitutes this node's user-specified data
See Also:
getUserObject(), toString()

getUserObject

public final java.lang.Object getUserObject()
Returns this node's user object.

Returns:
the Object stored at this node by the user
See Also:
setUserObject(java.lang.Object), toString()

toString

public final java.lang.String toString()