net.dontdrinkandroot.visualization.graphviz

## Class GraphvizVisualization<V,E>

- java.lang.Object
- - net.dontdrinkandroot.visualization.graphviz.GraphvizVisualization<V,E>

Type Parameters:
  `V` - Type of the vertices of the graph.
  `E` - Type of the edges of the graph.

    public class GraphvizVisualization<V,E>
    extends Object

Wrapper class to render graphs through GraphViz.

Author:
  Philip W. Sorst

### Constructor Summary

Constructors
Constructor and Description
`GraphvizVisualization(edu.uci.ics.jung.graph.Graph<V,E> g)` Create a new Graphviz visualization.

### Method Summary

Methods
`void` `addSameRankCluster(Set<V> cluster)` Make a Set of Vertices appear on the same rank if supported by the layout engine.
`Map<String,String>` `getEdgeAttributes()`
`Map<String,String>` `getGraphAttributes()`
`Map<String,String>` `getNodeAttributes()`
`static void` `render(File inFile, File outFile, LayoutEngine layoutEngine)` Render a dot file using Graphviz.
`static void` `render(File inFile, File outFile, LayoutEngine layoutEngine, long generationTimeout)` Render a dot file using Graphviz.
`void` `render(File outFile, LayoutEngine layoutEngine)` Perform the actual graph rendering.
`void` `render(File outFile, LayoutEngine layoutEngine, long generationTimeout)` Perform the graph rendering with limited maximal time.
`void` `setEdgeAttributes(Map<String,String> edgeAttributes)`
`void` `setEdgeRenderer(EdgeRenderer<E> edgeRenderer)`
`void` `setGraphAttributes(Map<String,String> graphAttributes)`
`void` `setNodeAttributes(Map<String,String> nodeAttributes)`
`void` `setNodeRenderer(NodeRenderer<V> nodeRenderer)`
`void` `writeDotFile(File outFile)` Write the dot file for the graph to render, this is the Graphviz notation for graphs.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GraphvizVisualization

    public GraphvizVisualization(edu.uci.ics.jung.graph.Graph<V,E> g)

Create a new Graphviz visualization.

Parameters:
  `g` - The graph to render.

### Method Detail

#### writeDotFile

    public final void writeDotFile(File outFile)
                            throws IOException

Write the dot file for the graph to render, this is the Graphviz notation for graphs.

Parameters:
  `outFile` - The file to write the dot file to.
Throws:
  `IOException` - Thrown if the file can't be written.

#### render

    public static void render(File inFile,
              File outFile,
              LayoutEngine layoutEngine)
                       throws IOException

Render a dot file using Graphviz.

Parameters:
  `inFile` - The dot file to render.
  `outFile` - The file to render the graph to, the format is determined by the extension.
  `layoutEngine` - The Graphviz layout engine to use.
Throws:
  `IOException` - Thrown if the graph can't be rendered.

#### render

    public static void render(File inFile,
              File outFile,
              LayoutEngine layoutEngine,
              long generationTimeout)
                       throws IOException

Render a dot file using Graphviz.

Parameters:
  `inFile` - The dot file to render.
  `outFile` - The file to render the graph to, the format is determined by the extension.
  `layoutEngine` - The Graphviz layout engine to use.
  `generationTimeout` - The maximum number of milliseconds to wait for the graph generation to finish, abort otherwise.
Throws:
  `IOException` - Thrown if the graph can't be rendered.

#### render

    public final void render(File outFile,
              LayoutEngine layoutEngine)
                      throws IOException

Perform the actual graph rendering.

Parameters:
  `outFile` - The file to render the graph to, the format is determined by the extension.
Throws:
  `IOException` - Thrown if the graph generation fails.

#### render

    public final void render(File outFile,
              LayoutEngine layoutEngine,
              long generationTimeout)
                      throws IOException

Perform the graph rendering with limited maximal time.

Parameters:
  `outFile` - The file to render the graph to, the format is determined by the extension.
  `generationTimeout` - The maximum number of milliseconds to wait for the graph generation to finish, abort otherwise.
Throws:
  `IOException` - Thrown if the graph generation fails.

#### setEdgeRenderer

    public final void setEdgeRenderer(EdgeRenderer<E> edgeRenderer)

#### setNodeRenderer

    public final void setNodeRenderer(NodeRenderer<V> nodeRenderer)

#### setGraphAttributes

    public final void setGraphAttributes(Map<String,String> graphAttributes)

#### getGraphAttributes

    public final Map<String,String> getGraphAttributes()

#### setEdgeAttributes

    public final void setEdgeAttributes(Map<String,String> edgeAttributes)

#### getEdgeAttributes

    public final Map<String,String> getEdgeAttributes()

#### setNodeAttributes

    public final void setNodeAttributes(Map<String,String> nodeAttributes)

#### getNodeAttributes

    public final Map<String,String> getNodeAttributes()

#### addSameRankCluster

    public final void addSameRankCluster(Set<V> cluster)

Make a Set of Vertices appear on the same rank if supported by the layout engine.

Parameters:
  `cluster` - The set of vertices to appear on the same node.