org.deegree.commons.utils
Class GraphvizDot

java.lang.Object
  extended by org.deegree.commons.utils.GraphvizDot

public class GraphvizDot
extends Object

The GraphvizDot class provides a few methods to create a graphviz 'dot' file. For more information on dot files please see http://www.graphviz.org

Version:
$Revision: 23625 $, $Date: 2010-04-15 14:06:39 +0200 (Thu, 15 Apr 2010) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Constructor Summary
GraphvizDot()
           
 
Method Summary
static void addRankDirLeftToRight(List<String> attribs)
           
static void endGraph(Writer writer)
          Writes the last closing bracket.
static String getFillColorDef(String color)
          http://www.graphviz.org/doc/info/colors.html
static String getLabelDef(String label)
           
static String getShapeDef(String shape)
          http://www.graphviz.org/doc/info/shapes.html
static String getStyleDef(String style)
           
static void startDiGraph(Writer writer)
          Writes the starting directed graph definition.
static void startDiGraph(Writer writer, List<String> attribs)
          Writes the starting directed graph definition. and adds the given attributes to the graph start.
static void writeEdge(String from, String to, List<String> attr_List, Writer writer)
          Writes a vertex.
static void writeVertex(String id, List<String> attr_List, Writer writer)
          Writes a vertex.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphvizDot

public GraphvizDot()
Method Detail

startDiGraph

public static void startDiGraph(Writer writer)
                         throws IOException
Writes the starting directed graph definition.

Parameters:
writer -
Throws:
IOException

startDiGraph

public static void startDiGraph(Writer writer,
                                List<String> attribs)
                         throws IOException
Writes the starting directed graph definition. and adds the given attributes to the graph start.

Parameters:
writer -
attribs - the attributes to write beneath the opening of the graph. For example use the addRankDirLeftToRight(List) to do left to right drawing of the graph
Throws:
IOException
IOException

endGraph

public static void endGraph(Writer writer)
                     throws IOException
Writes the last closing bracket.

Parameters:
writer -
Throws:
IOException

writeVertex

public static void writeVertex(String id,
                               List<String> attr_List,
                               Writer writer)
                        throws IOException
Writes a vertex.

Parameters:
id - of the vertex
attr_List - of attributes to write to the vertex definition
writer -
Throws:
IOException

writeEdge

public static void writeEdge(String from,
                             String to,
                             List<String> attr_List,
                             Writer writer)
                      throws IOException
Writes a vertex.

Parameters:
from - this vertex
to - this vertex
attr_List - of attributes to write to the edge definition
writer -
Throws:
IOException

getLabelDef

public static String getLabelDef(String label)
Parameters:
label - to set
Returns:
a label statement in the graphviz language

getFillColorDef

public static String getFillColorDef(String color)
http://www.graphviz.org/doc/info/colors.html

Parameters:
color - to set
Returns:
a fill color statement in the graphviz language

getShapeDef

public static String getShapeDef(String shape)
http://www.graphviz.org/doc/info/shapes.html

Parameters:
shape - to set
Returns:
a fill color statement in the graphviz language

addRankDirLeftToRight

public static void addRankDirLeftToRight(List<String> attribs)
Parameters:
attribs -

getStyleDef

public static String getStyleDef(String style)
Parameters:
style - one of 'solid dashed dotted bold invis'
Returns:
a style statement in the graphviz language.


Copyright © 2011. All Rights Reserved.