Kieker 1.7

kieker.tools.traceAnalysis.filter.visualization.util.dot
Class DotFactory

java.lang.Object
  extended by kieker.tools.traceAnalysis.filter.visualization.util.dot.DotFactory

public final class DotFactory
extends Object

This class provides a collection of static methods to compile Graphviz Dot elements from string attributes and properties. These elements may be compiled to complete Dot files externally.

Since:
1.1
Author:
Nina Marwede
See Also:
Graphviz - Graph Visualization Software, Graphviz - Wikipedia

Field Summary
static String DOT_ARROWHEAD_OPEN
          Determines to use an open arrow head for an edge.
static double DOT_DEFAULT_FONTSIZE
          Determines the default font size.
static String DOT_DOT_RANKDIR_LR
          Determines to use the rank direction left to right .
static String DOT_FILLCOLOR_GRAY
          A constant for the color "gray".
static String DOT_FILLCOLOR_WHITE
          A constant for the color "white".
static String DOT_SHAPE_BOX
          Determines to use the "box" shape.
static String DOT_SHAPE_BOX3D
          Determines to use the "3D box" shape.
static String DOT_SHAPE_NONE
          Determines to use no shape at all.
static String DOT_SHAPE_OVAL
          Determines to use the "oval" shape.
static String DOT_STYLE_DASHED
          Determines to use the "dashed" style for a line or a frame.
static String DOT_STYLE_FILLED
          Determines to the use the "filled" style for a component.
static String DOT_STYLE_SOLID
          Determines to use the "solid" style for a line or a frame.
 
Method Summary
static StringBuilder createCluster(String prefix, String name, String label, String shape, String style, String framecolor, String fillcolor, String fontcolor, double fontsize, String misc)
          Constructs dot code for a cluster from the specified elements.
static String createConnection(String prefix, String from, String to, double taillabel, double headlabel)
          This method creates dot code for a connection.
static String createConnection(String prefix, String from, String to, String style, String arrowhead, String color)
          Creates dot code for a connection.
static String createConnection(String prefix, String from, String to, String label, String style, String arrowhead, String color)
          Creates dot code for a connection.
static StringBuilder createEdgeDefaults(String style, String arrowhead, String labelfontname)
          Constructs dot code for the edge defaults.
static StringBuilder createHeader(String name, String label, String fontcolor, String fontname, double fontsize)
          This method constructs the neccesary dot code for a directed graph (digraph) file header (Should be called only once per dot file).
static StringBuilder createNode(String prefix, String nodeId, String label, String shape, String style, String framecolor, String fillcolor, String fontcolor, double fontsize, String imageFilename, String misc, String tooltip)
          Constructs dot code for a node from the specified elements.
static StringBuilder createNodeDefaults(String style, String shape, String framecolor, String fontcolor, String fontname, double fontsize, String imagescale)
          This method constructs the necessary dot code for the node defaults.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOT_SHAPE_BOX

public static final String DOT_SHAPE_BOX
Determines to use the "box" shape.

See Also:
Constant Field Values

DOT_SHAPE_BOX3D

public static final String DOT_SHAPE_BOX3D
Determines to use the "3D box" shape.

See Also:
Constant Field Values

DOT_SHAPE_NONE

public static final String DOT_SHAPE_NONE
Determines to use no shape at all.

See Also:
Constant Field Values

DOT_SHAPE_OVAL

public static final String DOT_SHAPE_OVAL
Determines to use the "oval" shape.

See Also:
Constant Field Values

DOT_STYLE_SOLID

public static final String DOT_STYLE_SOLID
Determines to use the "solid" style for a line or a frame.

See Also:
Constant Field Values

DOT_STYLE_DASHED

public static final String DOT_STYLE_DASHED
Determines to use the "dashed" style for a line or a frame.

See Also:
Constant Field Values

DOT_ARROWHEAD_OPEN

public static final String DOT_ARROWHEAD_OPEN
Determines to use an open arrow head for an edge.

See Also:
Constant Field Values

DOT_DEFAULT_FONTSIZE

public static final double DOT_DEFAULT_FONTSIZE
Determines the default font size.

See Also:
Constant Field Values

DOT_DOT_RANKDIR_LR

public static final String DOT_DOT_RANKDIR_LR
Determines to use the rank direction left to right .

See Also:
Constant Field Values

DOT_FILLCOLOR_WHITE

public static final String DOT_FILLCOLOR_WHITE
A constant for the color "white".

See Also:
Constant Field Values

DOT_FILLCOLOR_GRAY

public static final String DOT_FILLCOLOR_GRAY
A constant for the color "gray".

See Also:
Constant Field Values

DOT_STYLE_FILLED

public static final String DOT_STYLE_FILLED
Determines to the use the "filled" style for a component.

See Also:
Constant Field Values
Method Detail

createHeader

public static StringBuilder createHeader(String name,
                                         String label,
                                         String fontcolor,
                                         String fontname,
                                         double fontsize)
This method constructs the neccesary dot code for a directed graph (digraph) file header (Should be called only once per dot file).

Parameters:
name - The name of the digraph.
label - text to show at the label location (specified elsewhere) with HTML braces (<>)
fontcolor - The font color.
fontname - The name of the font.
fontsize - The size of the font.
Returns:
The digraph header as valid dot code.

createNodeDefaults

public static StringBuilder createNodeDefaults(String style,
                                               String shape,
                                               String framecolor,
                                               String fontcolor,
                                               String fontname,
                                               double fontsize,
                                               String imagescale)
This method constructs the necessary dot code for the node defaults. Those values will be used if a parameter within a call of the other methods is null (Should be called only once per dot file).

Parameters:
style - The default style of the nodes.
shape - The default shape of the nodes.
framecolor - The default frame color of the nodes.
fontcolor - The default font color of the nodes.
fontname - The default font names of the nodes.
fontsize - The default font size of the nodes.
imagescale - The image scale property. This attribute determines how an image fills the "parent" node.
Returns:
The graph node defaults as valid dot code.

createEdgeDefaults

public static StringBuilder createEdgeDefaults(String style,
                                               String arrowhead,
                                               String labelfontname)
Constructs dot code for the edge defaults. (Should be called only once per dot file.)

Parameters:
style - The default style for the edges.
arrowhead - The defualt arrow head for the edges.
labelfontname - label font nodeId, works only for headlabel and taillabel, not simple label
Returns:
graph edge defaults as dot code

createNode

public static StringBuilder createNode(String prefix,
                                       String nodeId,
                                       String label,
                                       String shape,
                                       String style,
                                       String framecolor,
                                       String fillcolor,
                                       String fontcolor,
                                       double fontsize,
                                       String imageFilename,
                                       String misc,
                                       String tooltip)
Constructs dot code for a node from the specified elements.

Parameters:
prefix - usually spaces, dependent on hierarchy - only for nice ascii formatting inside the dot code
nodeId - The id of the node.
label - The label to be used within the node. This parameter can be null.
shape - The shape of the node. This parameter can be null.
style - The style of the node. This parameter can be null.
framecolor - The color of the frame of the node. This parameter can be null.
fillcolor - The color which will be used to fill the node. This parameter can be null.
fontcolor - The color of the font. This parameter can be null.
fontsize - The size of the font. This parameter can be null.
imageFilename - The name of the image to be displayed inside the node.
misc - This parameter can be used to add miscellaneous data and dot code.
tooltip - The tooltip of this node. This parameter can be null.
Returns:
The graph node as valid dot code

createCluster

public static StringBuilder createCluster(String prefix,
                                          String name,
                                          String label,
                                          String shape,
                                          String style,
                                          String framecolor,
                                          String fillcolor,
                                          String fontcolor,
                                          double fontsize,
                                          String misc)
Constructs dot code for a cluster from the specified elements. ATTENTION: Without closing bracket! ( "}" has to be appended by calling method.)

Parameters:
prefix - usually spaces, dependent on hierarchy - only for nice ascii formatting inside the dot code
name - The name of the cluster.
label - The label to be used for the cluster.
shape - The shape of the cluster. This parameter can be null.
style - The style of the frame. This parameter can be null.
framecolor - The color of the frame. This parameter can be null.
fillcolor - The color which will be used to fill the frame. This parameter can be null.
fontcolor - The color of the font. This parameter can be null.
fontsize - The size of the font. This parameter can be null.
misc - This parameter can be used to add miscellaneous data and dot code (like further content). This parameter can be null.
Returns:
A graph cluster as valid dot code - but without the closing bracket.

createConnection

public static String createConnection(String prefix,
                                      String from,
                                      String to,
                                      String style,
                                      String arrowhead,
                                      String color)
Creates dot code for a connection. It is assumed that the typical properties (color etc) are already formatted for the usage within dot.

Parameters:
prefix - usually spaces, dependent on hierarchy - only for nice ascii formatting inside the dot code
from - The string representation of the start node.
to - The string representation of the destination node.
color - The color of the edge. This parameter can be null.
style - The style of the edge. This parameter can be null.
arrowhead - The type of the arrowhead of the edge. This parameter can be null.
Returns:
A graph connection as valid dot code.

createConnection

public static String createConnection(String prefix,
                                      String from,
                                      String to,
                                      String label,
                                      String style,
                                      String arrowhead,
                                      String color)
Creates dot code for a connection. It is the same as a call to createConnection(String, String, String, String, String, String) except that a label can be added.

Parameters:
prefix - usually spaces, dependent on hierarchy - only for nice ascii formatting inside the dot code
from - The string representation of the start node.
to - The string representation of the destination node.
label - The label of the edge.
color - The color of the edge. This parameter can be null.
style - The style of the edge. This parameter can be null.
arrowhead - The type of the arrowhead of the edge. This parameter can be null.
Returns:
A graph connection as valid dot code.

createConnection

public static String createConnection(String prefix,
                                      String from,
                                      String to,
                                      double taillabel,
                                      double headlabel)
This method creates dot code for a connection. It is the same as a call to createConnection(String, String, String, String, String, String) except that color, style and arrowhead cannot be modified and that a headlabel and a taillabel can be added.

Parameters:
prefix - usually spaces, dependent on hierarchy - only for nice ascii formatting inside the dot code
from - The string representation of the start node.
to - The string representation of the destination node.
taillabel - The label of the edge at the tail of the connection.
headlabel - The label of the edge at the head of the connection.
Returns:
A graph connection as valid dot code.

Kieker 1.7

Copyright 2013 Kieker Project, http://kieker-monitoring.net