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

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

public class GraphvizTool
extends Object

Handler for accessing Graphviz via a separate process.

Rating proposed yellow
(2009-12-11) msp

Nested Class Summary
static class GraphvizTool.Cleanup
          Available cleanup modes.
 
Field Summary
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.
 
Constructor Summary
GraphvizTool(Command thecommand)
          Create a Graphviz tool instance for the given command.
 
Method Summary
 void cleanup(GraphvizTool.Cleanup c)
          Clean up, optionally preparing the tool for the next use.
 void initialize()
          Initialize the Graphviz tool instance by starting the dot process and the watcher thread as necessary.
 OutputStream input()
          Return the stream that is used to give input to Graphviz.
 InputStream output()
          Return the stream for reading the output of the Graphviz process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

GraphvizTool

public GraphvizTool(Command thecommand)
Create a Graphviz tool instance for the given command.

Parameters:
thecommand - a Graphviz command
Method Detail

initialize

public void initialize()
Initialize the Graphviz tool instance by starting the dot process and the watcher thread as necessary.


input

public OutputStream input()
Return the stream that is used to give input to Graphviz.

Returns:
an output stream for writing to the tool

output

public InputStream output()
Return the stream for reading the output of the Graphviz process.

Returns:
an input stream for reading from the tool

cleanup

public void cleanup(GraphvizTool.Cleanup c)
Clean up, optionally preparing the tool for the next use.

Parameters:
c - the cleanup option