soot.util.dot
Class DotGraph

java.lang.Object
  |
  +--soot.util.dot.DotGraph

public class DotGraph
extends java.lang.Object
implements Renderable


Constructor Summary
DotGraph(java.lang.String graphname)
          Creates a new graph for drawing.
 
Method Summary
 DotGraph createSubGraph(java.lang.String label)
          creates a sub graph.
 DotGraphEdge drawEdge(java.lang.String from, java.lang.String to)
          Draws a directed edge (including the source and end nodes, if they have not already been drawn).
 DotGraphNode drawNode(java.lang.String name)
          Draws a node.
 void drawUndirectedEdge(java.lang.String label1, java.lang.String label2)
          draws an undirected edge
 DotGraphNode getNode(java.lang.String name)
          Gets the graph node by name.
 void plot()
          Generates the drawing on canvas to the dot file.
 void render(java.io.OutputStream out, int indent)
           
 void setGraphAttribute(java.lang.String id, java.lang.String value)
          sets any general attributes
 void setGraphLabel(java.lang.String label)
          sets the graph label
 void setGraphSize(double width, double height)
          sets the size of drawing area, in inches
 void setNodeShape(java.lang.String shape)
          Sets all node shapes, see the list of node shapes in DotGraphConstants.
 void setNodeStyle(java.lang.String style)
          Sets all node styles
 void setOrientation(java.lang.String orientation)
          sets the graph rotation angles
 void setPageSize(double width, double height)
          sets the pages size, once this is set, the generated graph will be broken into several pages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotGraph

public DotGraph(java.lang.String graphname)
Creates a new graph for drawing.
Parameters:
graphname, - the file name with dot format will be generated
Method Detail

plot

public void plot()
Generates the drawing on canvas to the dot file.

drawEdge

public DotGraphEdge drawEdge(java.lang.String from,
                             java.lang.String to)
Draws a directed edge (including the source and end nodes, if they have not already been drawn).
Parameters:
from, - the source node
to, - the end node
Returns:
a graph edge

drawNode

public DotGraphNode drawNode(java.lang.String name)
Draws a node.
Parameters:
name, - the node to draw.
Returns:
the DotGraphNode corresponding to the specified name.

getNode

public DotGraphNode getNode(java.lang.String name)
Gets the graph node by name.
Parameters:
name, - unique name of the node.
Returns:
the node with the specified name, or null if there is no such node.

setNodeShape

public void setNodeShape(java.lang.String shape)
Sets all node shapes, see the list of node shapes in DotGraphConstants.
Parameters:
shape, - the node shape

setNodeStyle

public void setNodeStyle(java.lang.String style)
Sets all node styles
Parameters:
style, - the node style

setGraphSize

public void setGraphSize(double width,
                         double height)
sets the size of drawing area, in inches

setPageSize

public void setPageSize(double width,
                        double height)
sets the pages size, once this is set, the generated graph will be broken into several pages.

setOrientation

public void setOrientation(java.lang.String orientation)
sets the graph rotation angles

setGraphLabel

public void setGraphLabel(java.lang.String label)
sets the graph label

setGraphAttribute

public void setGraphAttribute(java.lang.String id,
                              java.lang.String value)
sets any general attributes

drawUndirectedEdge

public void drawUndirectedEdge(java.lang.String label1,
                               java.lang.String label2)
draws an undirected edge
Parameters:
label1, - label2

createSubGraph

public DotGraph createSubGraph(java.lang.String label)
creates a sub graph.
Returns:
the newly created sub graph.

render

public void render(java.io.OutputStream out,
                   int indent)
            throws java.io.IOException
Specified by:
render in interface Renderable