graph
Class GraphUtils

java.lang.Object
  extended by graph.GraphUtils

public class GraphUtils
extends java.lang.Object

Utilities for printing and displaying graphs.

Author:
pearce

Constructor Summary
GraphUtils()
           
 
Method Summary
static void display(Graph model)
          Creates a JGraph component with a graph as its model.
static org.jgraph.JGraph makeJGraph(Graph model)
          Creates a JGraph component with a specified graph as its component.
static void print(Graph g)
          prints the nodes and links of a graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphUtils

public GraphUtils()
Method Detail

makeJGraph

public static org.jgraph.JGraph makeJGraph(Graph model)
Creates a JGraph component with a specified graph as its component. This method hides an ugly hack involving the graph layout cache.

Parameters:
model - the graph model of this component.

display

public static void display(Graph model)
Creates a JGraph component with a graph as its model. The component is placed in a scroll pane which is added to the content pane of a JFrame. The JFrame is then displayed. This code can be used as a guide for how to draw graphs.

Parameters:
model - the graph to be displayed.

print

public static void print(Graph g)
prints the nodes and links of a graph. This code can be used as a guide for how to do graph analysis.

Parameters:
g - the graph to be printed.