org.geotools.gui.swing.tree
Class Trees

java.lang.Object
  extended byorg.geotools.gui.swing.tree.Trees

public final class Trees
extends java.lang.Object

Convenience static methods for trees operations.

Since:
2.0
Version:
$Id: Trees.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Method Summary
static javax.swing.tree.TreePath[] getPathsToUserObject(javax.swing.tree.TreeModel model, java.lang.Object value)
          Returns the path to the specified user object.
static java.lang.String toString(javax.swing.tree.TreeModel tree)
          Returns a graphical representation of the specified tree model.
static java.lang.String toString(javax.swing.tree.TreeNode node)
          Returns a graphical representation of the specified tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPathsToUserObject

public static javax.swing.tree.TreePath[] getPathsToUserObject(javax.swing.tree.TreeModel model,
                                                               java.lang.Object value)
Returns the path to the specified user object. For each tree node which are actually instance of Geotools TreeNode, this method compares the specified against the user object returned by the TreeNode.getUserObject() method.

Parameters:
model - The tree model to inspect.
value - User object to compare to TreeNode.getUserObject().
Returns:
The paths to the specified value, or an empty array if none.

toString

public static java.lang.String toString(javax.swing.tree.TreeModel tree)
Returns a graphical representation of the specified tree model. This representation can be printed to the standard output stream (for example) if it uses a monospaced font and supports unicode.

Parameters:
tree - The tree to format.
Returns:
A string representation of the tree, or if it doesn't contain any node.

toString

public static java.lang.String toString(javax.swing.tree.TreeNode node)
Returns a graphical representation of the specified tree. This representation can be printed to the standard output stream (for example) if it uses a monospaced font and supports unicode.

Parameters:
node - The root node of the tree to format.
Returns:
A string representation of the tree, or if it doesn't contain any node.


Copyright © GeoTools. All Rights Reserved.