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 static methods to access Graphviz via a separate process.

Rating proposed yellow
(2009-12-11) msp

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.
 
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(KGraphDotTransformation.Command command)
          Starts a new Graphviz process with the given command.
static void waitForInput(InputStream inputStream, InputStream errorStream, IKielerProgressMonitor monitor, boolean debugMode)
          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

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(KGraphDotTransformation.Command command)
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

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,
                                boolean debugMode)
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
debugMode - whether debug mode is active