public class DotGraph extends AbstractDotGraphElement implements Renderable
| Modifier and Type | Field and Description |
|---|---|
static String |
DOT_EXTENSION
The extension added to output files, exported so that clients can search for the filenames.
|
| Constructor and Description |
|---|
DotGraph(String graphname)
Creates a new graph for drawing.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsNode(DotGraphNode node)
Checks if the graph already contains the given
DotGraphNode. |
boolean |
containsNode(String name)
Checks if the graph already contains the node with the specified name.
|
DotGraph |
createSubGraph(String label)
creates a sub graph.
|
DotGraphEdge |
drawEdge(String from,
String to)
Draws a directed edge (including the source and end nodes, if they have not already been drawn).
|
DotGraphNode |
drawNode(String name)
Draws a node.
|
DotGraphEdge |
drawUndirectedEdge(String node1,
String node2)
Draws a undirected edge (including the nodes, if they have not already been drawn).
|
DotGraphNode |
getNode(String name)
Gets the graph node by name.
|
void |
plot(String filename)
Generates the drawing on canvas to the dot file.
|
void |
quoteNodeNames(boolean value)
NOTE: default is true
|
void |
render(OutputStream out,
int indent) |
void |
setGraphAttribute(DotGraphAttribute attr)
sets any general attributes
NOTE: Alias for
AbstractDotGraphElement.setAttribute(soot.util.dot.DotGraphAttribute). |
void |
setGraphAttribute(String id,
String value)
sets any general attributes
NOTE: Alias for
AbstractDotGraphElement.setAttribute(java.lang.String, java.lang.String). |
void |
setGraphLabel(String label)
NOTE: Alias for
AbstractDotGraphElement.setLabel(java.lang.String). |
void |
setGraphName(String name)
sets the graph name
|
void |
setGraphSize(double width,
double height)
sets the size of drawing area, in inches
|
void |
setNodeShape(String shape)
Sets all node shapes, see the list of node shapes in DotGraphConstants.
|
void |
setNodeStyle(String style)
Sets all node styles
|
void |
setOrientation(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.
|
getAttribute, getAttributes, getAttributeValue, getLabel, removeAllAttributes, removeAttribute, removeAttribute, setAttribute, setAttribute, setLabelpublic static final String DOT_EXTENSION
public DotGraph(String graphname)
graphname, - the name used to identify the graph in the dot source.public void plot(String filename)
filename - the name for the output file. By convention, it should end with DOT_EXTENSION, but this is not enforced.public DotGraphEdge drawEdge(String from, String to)
from, - the source nodeto, - the end nodefrom with topublic DotGraphEdge drawUndirectedEdge(String node1, String node2)
node1 - node2 - node1 with node2public DotGraphNode drawNode(String name)
name, - the node to draw.DotGraphNode corresponding to the specified name.public DotGraphNode getNode(String name)
name, - unique name of the node.public boolean containsNode(String name)
name, - unique name of the node.public boolean containsNode(DotGraphNode node)
DotGraphNode.node - public void quoteNodeNames(boolean value)
value - public void setNodeShape(String shape)
shape, - the node shapepublic void setNodeStyle(String style)
style, - the node stylepublic void setGraphSize(double width,
double height)
public void setPageSize(double width,
double height)
public void setOrientation(String orientation)
public void setGraphName(String name)
public void setGraphLabel(String label)
AbstractDotGraphElement.setLabel(java.lang.String).public void setGraphAttribute(String id, String value)
AbstractDotGraphElement.setAttribute(java.lang.String, java.lang.String).id - is the attribute name.value - is the attribute value.public void setGraphAttribute(DotGraphAttribute attr)
AbstractDotGraphElement.setAttribute(soot.util.dot.DotGraphAttribute).attr - a DotGraphAttribute specifying the attribute name and value.public DotGraph createSubGraph(String label)
public void render(OutputStream out, int indent) throws IOException
render in interface RenderableIOExceptionCopyright © 2024 Soot OSS. All rights reserved.