de.cau.cs.kieler.kiml.graphviz.layouter
Class GraphvizAPI

java.lang.Object
  extended by de.cau.cs.kieler.kiml.graphviz.layouter.GraphvizAPI

public final class GraphvizAPI
extends Object

Defines constants used in the Graphviz Dot language and static methods to access Graphviz via a separate process.

Rating proposed yellow
(2009-12-11) msp

Field Summary
static String ATTR_ARROWHEAD
          Style of arrowhead on the head node of an edge.
static String ATTR_ARROWTAIL
          Style of arrowhead on the tail node of an edge.
static String ATTR_BOUNDINGBOX
          Bounding box.
static String ATTR_COMMENT
          Comment.
static String ATTR_DPI
          This specifies the expected number of pixels per inch on a display device.
static String ATTR_EDGEDIR
          Set edge type for drawing arrowheads.
static String ATTR_EDGELEN
          Preferred edge length, in inches (fdp, neato only).
static String ATTR_FIXEDSIZE
          If true, the node size is specified by the values of the width and height attributes only and is not expanded to contain the text label.
static String ATTR_FONTNAME
          Font used for text.
static String ATTR_FONTSIZE
          Font size, in points, used for text.
static String ATTR_HEADLABEL
          Text label to be placed near head of edge.
static String ATTR_HEADLP
          Head label position, in points.
static String ATTR_HEIGHT
          Height of node, in inches.
static String ATTR_LABEL
          Text label attached to objects.
static String ATTR_LABELANGLE
          This, along with labeldistance, determine where the headlabel (taillabel) are placed with respect to the head (tail) in polar coordinates.
static String ATTR_LABELDISTANCE
          Multiplicative scaling factor adjusting the distance that the headlabel(taillabel) is from the head(tail) node.
static String ATTR_LABELFONTNAME
          Font used for headlabel and taillabel.
static String ATTR_LABELFONTSIZE
          Font size, in points, used for headlabel and taillabel.
static String ATTR_LABELJUST
          Justification for cluster labels.
static String ATTR_LABELLOC
          Top/bottom placement of graph and cluster labels.
static String ATTR_LABELPOS
          Label position, in points.
static String ATTR_MARGIN
          For graphs, this sets x and y margins of canvas, in inches.
static String ATTR_MINDIST
          Specifies the minimum separation between all nodes (circo only).
static String ATTR_OVERLAP
          Determines if and how node overlaps should be removed (not dot).
static String ATTR_PAD
          The pad attribute specifies how much, in inches, to extend the drawing area around the minimal area needed to draw the graph.
static String ATTR_POS
          Position of node, or spline control points.
static String ATTR_RANKDIR
          Sets direction of graph layout (dot only).
static String ATTR_RANKSEP
          In dot, this gives the desired rank separation, in inches.
static String ATTR_ROTATE
          If 90, set drawing orientation to landscape.
static String ATTR_SHAPE
          Set the shape of a node.
static String ATTR_SPLINES
          Controls how, and if, edges are represented.
static String ATTR_START
          Parameter used to determine the initial layout of nodes (fdp, neato only).
static String ATTR_TAILLABEL
          Text label to be placed near tail of edge.
static String ATTR_TAILLP
          Tail label position, in points.
static String ATTR_WEIGHT
          Weight of edge.
static String ATTR_WIDTH
          Width of node, in inches.
static String PREF_GRAPHVIZ_EXECUTABLE
          preference constant for Graphviz executable.
static String PREF_TIMEOUT
          preference constant for timeout.
static int PROCESS_DEF_TIMEOUT
          default timeout for waiting for Graphviz to give some output.
static int PROCESS_MIN_TIMEOUT
          minimal timeout for waiting for Graphviz to give some output.
 
Method Summary
static void endProcess()
          Closes the currently cached process instances so a new one is created for the next layout run.
static Process startProcess(String command)
          Starts a new Graphviz process with the given command.
static void waitForInput(InputStream inputStream, InputStream errorStream, IKielerProgressMonitor monitor)
          Waits until there is some input from the given input stream, with a customizable timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_ARROWHEAD

public static final String ATTR_ARROWHEAD
Style of arrowhead on the head node of an edge.

See Also:
Constant Field Values

ATTR_ARROWTAIL

public static final String ATTR_ARROWTAIL
Style of arrowhead on the tail node of an edge.

See Also:
Constant Field Values

ATTR_BOUNDINGBOX

public static final String ATTR_BOUNDINGBOX
Bounding box.

See Also:
Constant Field Values

ATTR_COMMENT

public static final String ATTR_COMMENT
Comment.

See Also:
Constant Field Values

ATTR_EDGEDIR

public static final String ATTR_EDGEDIR
Set edge type for drawing arrowheads.

See Also:
Constant Field Values

ATTR_EDGELEN

public static final String ATTR_EDGELEN
Preferred edge length, in inches (fdp, neato only).

See Also:
Constant Field Values

ATTR_DPI

public static final String ATTR_DPI
This specifies the expected number of pixels per inch on a display device.

See Also:
Constant Field Values

ATTR_FIXEDSIZE

public static final String ATTR_FIXEDSIZE
If true, the node size is specified by the values of the width and height attributes only and is not expanded to contain the text label.

See Also:
Constant Field Values

ATTR_FONTNAME

public static final String ATTR_FONTNAME
Font used for text.

See Also:
Constant Field Values

ATTR_FONTSIZE

public static final String ATTR_FONTSIZE
Font size, in points, used for text.

See Also:
Constant Field Values

ATTR_HEADLABEL

public static final String ATTR_HEADLABEL
Text label to be placed near head of edge.

See Also:
Constant Field Values

ATTR_HEADLP

public static final String ATTR_HEADLP
Head label position, in points.

See Also:
Constant Field Values

ATTR_HEIGHT

public static final String ATTR_HEIGHT
Height of node, in inches.

See Also:
Constant Field Values

ATTR_LABEL

public static final String ATTR_LABEL
Text label attached to objects.

See Also:
Constant Field Values

ATTR_LABELANGLE

public static final String ATTR_LABELANGLE
This, along with labeldistance, determine where the headlabel (taillabel) are placed with respect to the head (tail) in polar coordinates.

See Also:
Constant Field Values

ATTR_LABELDISTANCE

public static final String ATTR_LABELDISTANCE
Multiplicative scaling factor adjusting the distance that the headlabel(taillabel) is from the head(tail) node.

See Also:
Constant Field Values

ATTR_LABELFONTNAME

public static final String ATTR_LABELFONTNAME
Font used for headlabel and taillabel.

See Also:
Constant Field Values

ATTR_LABELFONTSIZE

public static final String ATTR_LABELFONTSIZE
Font size, in points, used for headlabel and taillabel.

See Also:
Constant Field Values

ATTR_LABELJUST

public static final String ATTR_LABELJUST
Justification for cluster labels.

See Also:
Constant Field Values

ATTR_LABELLOC

public static final String ATTR_LABELLOC
Top/bottom placement of graph and cluster labels.

See Also:
Constant Field Values

ATTR_LABELPOS

public static final String ATTR_LABELPOS
Label position, in points.

See Also:
Constant Field Values

ATTR_OVERLAP

public static final String ATTR_OVERLAP
Determines if and how node overlaps should be removed (not dot).

See Also:
Constant Field Values

ATTR_PAD

public static final String ATTR_PAD
The pad attribute specifies how much, in inches, to extend the drawing area around the minimal area needed to draw the graph.

See Also:
Constant Field Values

ATTR_POS

public static final String ATTR_POS
Position of node, or spline control points.

See Also:
Constant Field Values

ATTR_MARGIN

public static final String ATTR_MARGIN
For graphs, this sets x and y margins of canvas, in inches.

See Also:
Constant Field Values

ATTR_MINDIST

public static final String ATTR_MINDIST
Specifies the minimum separation between all nodes (circo only).

See Also:
Constant Field Values

ATTR_RANKDIR

public static final String ATTR_RANKDIR
Sets direction of graph layout (dot only).

See Also:
Constant Field Values

ATTR_RANKSEP

public static final String ATTR_RANKSEP
In dot, this gives the desired rank separation, in inches. In twopi, specifies radial separation of concentric circles. (twopi, dot only)

See Also:
Constant Field Values

ATTR_ROTATE

public static final String ATTR_ROTATE
If 90, set drawing orientation to landscape.

See Also:
Constant Field Values

ATTR_SHAPE

public static final String ATTR_SHAPE
Set the shape of a node.

See Also:
Constant Field Values

ATTR_SPLINES

public static final String ATTR_SPLINES
Controls how, and if, edges are represented. If true, edges are drawn as splines routed around nodes; if false, edges are drawn as line segments.

See Also:
Constant Field Values

ATTR_START

public static final String ATTR_START
Parameter used to determine the initial layout of nodes (fdp, neato only).

See Also:
Constant Field Values

ATTR_TAILLABEL

public static final String ATTR_TAILLABEL
Text label to be placed near tail of edge.

See Also:
Constant Field Values

ATTR_TAILLP

public static final String ATTR_TAILLP
Tail label position, in points.

See Also:
Constant Field Values

ATTR_WEIGHT

public static final String ATTR_WEIGHT
Weight of edge.

See Also:
Constant Field Values

ATTR_WIDTH

public static final String ATTR_WIDTH
Width of node, in inches.

See Also:
Constant Field Values

PREF_GRAPHVIZ_EXECUTABLE

public static final String PREF_GRAPHVIZ_EXECUTABLE
preference constant for Graphviz executable.

See Also:
Constant Field Values

PREF_TIMEOUT

public static final String PREF_TIMEOUT
preference constant for timeout.

See Also:
Constant Field Values

PROCESS_DEF_TIMEOUT

public static final int PROCESS_DEF_TIMEOUT
default timeout for waiting for Graphviz to give some output.

See Also:
Constant Field Values

PROCESS_MIN_TIMEOUT

public static final int PROCESS_MIN_TIMEOUT
minimal timeout for waiting for Graphviz to give some output.

See Also:
Constant Field Values
Method Detail

startProcess

public static Process startProcess(String command)
                            throws KielerException
Starts a new Graphviz process with the given command. If a process instance was already created, that instance is returned.

Parameters:
command - the graphviz command to use
Returns:
an instance of the graphviz process
Throws:
KielerException - if creating the process fails

endProcess

public static void endProcess()
Closes the currently cached process instances so a new one is created for the next layout run.


waitForInput

public static void waitForInput(InputStream inputStream,
                                InputStream errorStream,
                                IKielerProgressMonitor monitor)
                         throws KielerException
Waits until there is some input from the given input stream, with a customizable timeout.

Parameters:
inputStream - input stream from which input is expected
errorStream - error stream that is queried if there is no input
monitor - monitor to which progress is reported
Throws:
KielerException - if the timeout is exceeded while waiting