dsto.dfc.swing.tree
Class Trees

java.lang.Object
  extended by dsto.dfc.swing.tree.Trees

public class Trees
extends Object

General utility methods for trees.

Version:
$Revision$
Author:
Matthew Phillips

Nested Class Summary
static class Trees.TreeTracer
          A debugging TreeModelListener that prints events from a tree model to System.out.
 
Method Summary
static MutableTreeNode cloneNodes(TreeNode root)
          Clone a tree of nodes.
static void disposeNodes(TreeNode root)
          Calls dispose on all Disposable nodes starting from a given root node.
static void dumpTree(TreeModel tree)
           
static void dumpTree(TreeModel tree, PrintStream str)
          Dump a debug print of a tree model.
static Object[] getPathForEntry(TreeModel model, Object entry)
          Get the path to a given entry in the tree model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPathForEntry

public static Object[] getPathForEntry(TreeModel model,
                                       Object entry)
Get the path to a given entry in the tree model. If model is a DfcTreeModel, its getPathForEntry () method is used, otherwise uses inefficient generic algorithm.


cloneNodes

public static MutableTreeNode cloneNodes(TreeNode root)
                                  throws CloneNotSupportedException
Clone a tree of nodes.

Parameters:
root - The tree node to copy from.
Returns:
The root of the cloned node tree.
Throws:
CloneNotSupportedException

disposeNodes

public static void disposeNodes(TreeNode root)
Calls dispose on all Disposable nodes starting from a given root node.


dumpTree

public static void dumpTree(TreeModel tree)
See Also:
dumpTree(TreeModel,PrintStream)

dumpTree

public static void dumpTree(TreeModel tree,
                            PrintStream str)
Dump a debug print of a tree model.

Parameters:
tree - The tree model to dump.
str - The stream to dump to.


Copyright © 2008 Commonwealth of Australia