gumbo.visualize.data.impl.swing
Class SwingDataModels

java.lang.Object
  |
  +--gumbo.visualize.data.impl.swing.SwingDataModels

public class SwingDataModels
extends java.lang.Object

Constants and utilities related to Swing data models.

Version:
$Revision: 1.1 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Method Summary
static javax.swing.tree.DefaultTreeModel toTreeModel(VertexModel seedVertex, VertexModel pruneVertex, boolean traceForward, boolean traceBackward, java.util.Map retMap)
          Traces a Gumbo graph model to produce an equivalent Swing tree model, whose nodes reference their corresponding vertex models.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toTreeModel

public static javax.swing.tree.DefaultTreeModel toTreeModel(VertexModel seedVertex,
                                                            VertexModel pruneVertex,
                                                            boolean traceForward,
                                                            boolean traceBackward,
                                                            java.util.Map retMap)
Traces a Gumbo graph model to produce an equivalent Swing tree model, whose nodes reference their corresponding vertex models. Starts with a seed node and returns the graph nodes found, while blocking any cycles. Includes provisions for pruning a subgraph (such as the "far" subgraph of a cyclic graph), and for tracing forward and/or backward edges.

Parameters:
pruneVertex - A graph vertex whose subgraph will be pruned from the trace. The prune vertex is excluded from the trace. Null if none (prune nothing from the trace). If the seed, throws an exception.
traceForward - If true, forward connections (tail to head) are traced.
traceBackward - If true, backward connections (head to tail) are traced.
retMap - Return value object. A map from vertex models (VertexModel) to tree nodes (DefaultMutableTreeNode). Never null.
Returns:
A new tree model of tree nodes (DefaultMutableTreeNode), with each node's user object (getUserObject()) referencing the corresponding graph vertex (VertexModel). Never null. Empty if seed is null. Any previous data will be lost.