net.ogdf.bin
Class OgdfServer

java.lang.Object
  extended by net.ogdf.bin.OgdfServer

public class OgdfServer
extends Object

A utility class to handle the communication with the OGDF server.

Rating red

Nested Class Summary
static interface OgdfServer.Aborter
          Interface for aborter classes, which can be used to abort the process.
 
Field Summary
static int ATTRACTION_FORMULA_FR
          the 'Fruchterman-Reingold' attraction formula.
static int ATTRACTION_FORMULA_GEM
          the 'GEM' attraction formula.
static int BEAUTIFUL_AND_FAST
          the 'beautiful-and-fast' qvs.
static int BUFFER_SIZE
          the size for file transfer buffers.
static int COSTS_PLANAR
          the 'planar' costs.
static int COSTS_REPULSE
          the 'repulse' costs.
static int COSTS_STANDARD
          the 'standard' costs.
static int DIRECTION_EAST
          the 'east' direction.
static int DIRECTION_NORTH
          the 'north' direction.
static int DIRECTION_SOUTH
          the 'south' direction.
static int DIRECTION_WEST
          the 'west' direction.
static String EDGE_LABEL_SUFFIX
          the edge label suffix.
static int EDGE_TYPE_ASSOCIATION
          the association edge type.
static int EDGE_TYPE_DEPENDENCY
          the dependency edge type.
static int EDGE_TYPE_GENERALIZATION
          the generalization edge type.
static String EDGE_TYPE_SUFFIX
          the edge type suffix.
static String EXECUTABLE_PATH_BIN
          the path for the executable bin directory.
static String EXECUTABLE_PATH_LINUX32
          the relative path for the linux32 executable.
static String EXECUTABLE_PATH_LINUX64
          the relative path for the linux64 executable.
static String EXECUTABLE_PATH_OSX32
          the relative path for the osx32 executable.
static String EXECUTABLE_PATH_OSX64
          the relative path for the osx64 executable.
static String EXECUTABLE_PATH_SOLARIS
          the relative path for the solaris executable.
static String EXECUTABLE_PATH_WIN32
          the relative path for the win32 executable.
static String EXECUTABLE_PATH_WIN64
          the relative path for the win64 executable.
static int GORGEOUS_AND_EFFICIENT
          the 'gorgeous-and-efficient' qvs.
static String INFO_UML_GRAPH
          the information indicating an UML graph.
static int LABEL_TYPE_END1
          the first end label type.
static int LABEL_TYPE_END2
          the second end label type.
static int LABEL_TYPE_MULT1
          the first multiplicity label type.
static int LABEL_TYPE_MULT2
          the second multiplicity label type.
static int LABEL_TYPE_NAME
          the name label type.
static int NICE_AND_INCREDIBLE_SPEED
          the 'nice-and-incredible-speed' qvs.
static String OPTION_ARRANGE_CC
          the option for arranging connected components.
static String OPTION_ATTRACTION_FORMULA
          the option for the attraction formula.
static String OPTION_CC_DISTANCE
          the option for the connected component distance.
static String OPTION_COST_ASSOC
          the option for association edge costs.
static String OPTION_COST_GEN
          the option for the generalization edge costs.
static String OPTION_COSTS
          the option for costs.
static String OPTION_DESIRED_LENGTH
          the option for the desired edge length.
static String OPTION_EDGE_LENGTH
          the option for the edge length.
static String OPTION_FAILS
          the option for the number of fail runs.
static String OPTION_FINENESS
          the option for the fineness.
static String OPTION_GRAVITATIONAL_CONSTANT
          the option for the gravitational constant.
static String OPTION_INITIAL_TEMPERATURE
          the option for the initial temperature.
static String OPTION_ITERATIONS
          the option for the number of iterations.
static String OPTION_LABEL_EDGE_DISTANCE
          the option for the label-to-edge distance.
static String OPTION_LABEL_MARGIN_DISTANCE
          the option for the label margin.
static String OPTION_LAYER_DISTANCE
          the option for the layer distance.
static String OPTION_LAYOUT_DIRECTION
          the option for the layout direction.
static String OPTION_LAYOUTER
          the option for the selection of the layout algorithm.
static String OPTION_LEVEL_DISTANCE
          the option for the level distance.
static String OPTION_MAXIMAL_DISTURBANCE
          the option for the maximal disturbance.
static String OPTION_MIN_CLIQUE_SIZE
          the option for the minimal clique size.
static String OPTION_MIN_DIST_CC
          the option for the minimal distance between connected components.
static String OPTION_MIN_DIST_CIRCLE
          the option for the minimal distance between circles.
static String OPTION_MIN_DIST_LEVEL
          the option for the minimal distance between levels.
static String OPTION_MIN_DIST_SIBLING
          the option for the minimal distance between siblings.
static String OPTION_MINIMAL_TEMPERATURE
          the option for the minimal temperature.
static String OPTION_NEW_INITIAL_PLACEMENT
          the option for a new initial node placement.
static String OPTION_NODE_DISTANCE
          the option for the node distance.
static String OPTION_NOISE
          the option for the noise.
static String OPTION_NUMBER_OF_ROUNDS
          the option for the number of rounds.
static String OPTION_ORIENTATION
          the option for the orientation.
static String OPTION_ORTHOGONAL
          the option for the usage of an orthogonal routing.
static String OPTION_OSCILLATION_ANGLE
          the option for the oscillation angle.
static String OPTION_OSCILLATION_SENSITIVITY
          the option for the oscillation sensitivity.
static String OPTION_PAGE_RATIO
          the option for the page ratio.
static String OPTION_PREPROCESS_CLIQUES
          the option for the preprocessing of cliques.
static String OPTION_QUALITY_VS_SPEED
          the option for the quality-vs-speed option set.
static String OPTION_RANDOM_SEED
          the option for the random seed.
static String OPTION_ROTATION_ANGLE
          the option for the rotation angle.
static String OPTION_ROTATION_SENSITIVITY
          the option for the rotation sensitivity.
static String OPTION_RUNS
          the option for the number of runs.
static String OPTION_SEPARATION
          the option for the separation.
static String OPTION_SIBLING_DISTANCE
          the option for the sibling distance.
static String OPTION_SPEED
          the option for the speed option set.
static String OPTION_SUBTREE_DISTANCE
          the option for the subtree distance.
static String OPTION_TRANSPOSE
          the option for the transposition.
static String OPTION_TREE_DISTANCE
          the option for the tree distance.
static int ORIENTATION_BOTTOM_TO_TOP
          the 'bottom-to-top' orientation.
static int ORIENTATION_LEFT_TO_RIGHT
          the 'left-to-right' orientation.
static int ORIENTATION_RIGHT_TO_LEFT
          the 'right-to-left' orientation.
static int ORIENTATION_TOP_TO_BOTTOM
          the 'top-to-bottom' orientation.
static String PREF_TIMEOUT
          preference constant for timeout.
static int PROCESS_DEF_TIMEOUT
          default timeout for waiting for the server to give some output.
static int PROCESS_MIN_TIMEOUT
          minimal timeout for waiting for the server to give some output.
static int SPEED_FAST
          the 'fast' speed.
static int SPEED_HQ
          the 'hq' speed.
static int SPEED_MEDIUM
          the 'medium' speed.
 
Method Summary
 void endProcess()
          Closes the currently cached process instance so a new one is created for the next start process call.
 Process startProcess(String inputFormat)
          Starts a new ogdf server process or returns an existing one.
 boolean waitForInput(InputStream inputStream)
          Waits until there is some input from the given input stream.
 boolean waitForInput(InputStream inputStream, OgdfServer.Aborter aborter)
          Waits until there is some input from the given input stream, with a custom aborter.
 boolean waitForInput(InputStream inputStream, OgdfServer.Aborter aborter, int timeout)
          Waits until there is some input from the given input stream, with a custom aborter and timeout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFO_UML_GRAPH

public static final String INFO_UML_GRAPH
the information indicating an UML graph.

See Also:
Constant Field Values

EDGE_TYPE_SUFFIX

public static final String EDGE_TYPE_SUFFIX
the edge type suffix.

See Also:
Constant Field Values

EDGE_TYPE_ASSOCIATION

public static final int EDGE_TYPE_ASSOCIATION
the association edge type.

See Also:
Constant Field Values

EDGE_TYPE_DEPENDENCY

public static final int EDGE_TYPE_DEPENDENCY
the dependency edge type.

See Also:
Constant Field Values

EDGE_TYPE_GENERALIZATION

public static final int EDGE_TYPE_GENERALIZATION
the generalization edge type.

See Also:
Constant Field Values

EDGE_LABEL_SUFFIX

public static final String EDGE_LABEL_SUFFIX
the edge label suffix.

See Also:
Constant Field Values

LABEL_TYPE_END1

public static final int LABEL_TYPE_END1
the first end label type.

See Also:
Constant Field Values

LABEL_TYPE_MULT1

public static final int LABEL_TYPE_MULT1
the first multiplicity label type.

See Also:
Constant Field Values

LABEL_TYPE_NAME

public static final int LABEL_TYPE_NAME
the name label type.

See Also:
Constant Field Values

LABEL_TYPE_END2

public static final int LABEL_TYPE_END2
the second end label type.

See Also:
Constant Field Values

LABEL_TYPE_MULT2

public static final int LABEL_TYPE_MULT2
the second multiplicity label type.

See Also:
Constant Field Values

OPTION_ARRANGE_CC

public static final String OPTION_ARRANGE_CC
the option for arranging connected components.

See Also:
Constant Field Values

OPTION_ATTRACTION_FORMULA

public static final String OPTION_ATTRACTION_FORMULA
the option for the attraction formula.

See Also:
Constant Field Values

OPTION_CC_DISTANCE

public static final String OPTION_CC_DISTANCE
the option for the connected component distance.

See Also:
Constant Field Values

OPTION_COST_ASSOC

public static final String OPTION_COST_ASSOC
the option for association edge costs.

See Also:
Constant Field Values

OPTION_COST_GEN

public static final String OPTION_COST_GEN
the option for the generalization edge costs.

See Also:
Constant Field Values

OPTION_COSTS

public static final String OPTION_COSTS
the option for costs.

See Also:
Constant Field Values

OPTION_DESIRED_LENGTH

public static final String OPTION_DESIRED_LENGTH
the option for the desired edge length.

See Also:
Constant Field Values

OPTION_EDGE_LENGTH

public static final String OPTION_EDGE_LENGTH
the option for the edge length.

See Also:
Constant Field Values

OPTION_FAILS

public static final String OPTION_FAILS
the option for the number of fail runs.

See Also:
Constant Field Values

OPTION_FINENESS

public static final String OPTION_FINENESS
the option for the fineness.

See Also:
Constant Field Values

OPTION_GRAVITATIONAL_CONSTANT

public static final String OPTION_GRAVITATIONAL_CONSTANT
the option for the gravitational constant.

See Also:
Constant Field Values

OPTION_INITIAL_TEMPERATURE

public static final String OPTION_INITIAL_TEMPERATURE
the option for the initial temperature.

See Also:
Constant Field Values

OPTION_ITERATIONS

public static final String OPTION_ITERATIONS
the option for the number of iterations.

See Also:
Constant Field Values

OPTION_LABEL_EDGE_DISTANCE

public static final String OPTION_LABEL_EDGE_DISTANCE
the option for the label-to-edge distance.

See Also:
Constant Field Values

OPTION_LABEL_MARGIN_DISTANCE

public static final String OPTION_LABEL_MARGIN_DISTANCE
the option for the label margin.

See Also:
Constant Field Values

OPTION_LAYER_DISTANCE

public static final String OPTION_LAYER_DISTANCE
the option for the layer distance.

See Also:
Constant Field Values

OPTION_LAYOUT_DIRECTION

public static final String OPTION_LAYOUT_DIRECTION
the option for the layout direction.

See Also:
Constant Field Values

OPTION_LAYOUTER

public static final String OPTION_LAYOUTER
the option for the selection of the layout algorithm.

See Also:
Constant Field Values

OPTION_LEVEL_DISTANCE

public static final String OPTION_LEVEL_DISTANCE
the option for the level distance.

See Also:
Constant Field Values

OPTION_MAXIMAL_DISTURBANCE

public static final String OPTION_MAXIMAL_DISTURBANCE
the option for the maximal disturbance.

See Also:
Constant Field Values

OPTION_MIN_CLIQUE_SIZE

public static final String OPTION_MIN_CLIQUE_SIZE
the option for the minimal clique size.

See Also:
Constant Field Values

OPTION_MIN_DIST_CC

public static final String OPTION_MIN_DIST_CC
the option for the minimal distance between connected components.

See Also:
Constant Field Values

OPTION_MIN_DIST_CIRCLE

public static final String OPTION_MIN_DIST_CIRCLE
the option for the minimal distance between circles.

See Also:
Constant Field Values

OPTION_MIN_DIST_LEVEL

public static final String OPTION_MIN_DIST_LEVEL
the option for the minimal distance between levels.

See Also:
Constant Field Values

OPTION_MIN_DIST_SIBLING

public static final String OPTION_MIN_DIST_SIBLING
the option for the minimal distance between siblings.

See Also:
Constant Field Values

OPTION_MINIMAL_TEMPERATURE

public static final String OPTION_MINIMAL_TEMPERATURE
the option for the minimal temperature.

See Also:
Constant Field Values

OPTION_NEW_INITIAL_PLACEMENT

public static final String OPTION_NEW_INITIAL_PLACEMENT
the option for a new initial node placement.

See Also:
Constant Field Values

OPTION_NODE_DISTANCE

public static final String OPTION_NODE_DISTANCE
the option for the node distance.

See Also:
Constant Field Values

OPTION_NOISE

public static final String OPTION_NOISE
the option for the noise.

See Also:
Constant Field Values

OPTION_NUMBER_OF_ROUNDS

public static final String OPTION_NUMBER_OF_ROUNDS
the option for the number of rounds.

See Also:
Constant Field Values

OPTION_ORIENTATION

public static final String OPTION_ORIENTATION
the option for the orientation.

See Also:
Constant Field Values

OPTION_ORTHOGONAL

public static final String OPTION_ORTHOGONAL
the option for the usage of an orthogonal routing.

See Also:
Constant Field Values

OPTION_OSCILLATION_ANGLE

public static final String OPTION_OSCILLATION_ANGLE
the option for the oscillation angle.

See Also:
Constant Field Values

OPTION_OSCILLATION_SENSITIVITY

public static final String OPTION_OSCILLATION_SENSITIVITY
the option for the oscillation sensitivity.

See Also:
Constant Field Values

OPTION_PAGE_RATIO

public static final String OPTION_PAGE_RATIO
the option for the page ratio.

See Also:
Constant Field Values

OPTION_PREPROCESS_CLIQUES

public static final String OPTION_PREPROCESS_CLIQUES
the option for the preprocessing of cliques.

See Also:
Constant Field Values

OPTION_QUALITY_VS_SPEED

public static final String OPTION_QUALITY_VS_SPEED
the option for the quality-vs-speed option set.

See Also:
Constant Field Values

OPTION_RANDOM_SEED

public static final String OPTION_RANDOM_SEED
the option for the random seed.

See Also:
Constant Field Values

OPTION_ROTATION_ANGLE

public static final String OPTION_ROTATION_ANGLE
the option for the rotation angle.

See Also:
Constant Field Values

OPTION_ROTATION_SENSITIVITY

public static final String OPTION_ROTATION_SENSITIVITY
the option for the rotation sensitivity.

See Also:
Constant Field Values

OPTION_RUNS

public static final String OPTION_RUNS
the option for the number of runs.

See Also:
Constant Field Values

OPTION_SEPARATION

public static final String OPTION_SEPARATION
the option for the separation.

See Also:
Constant Field Values

OPTION_SIBLING_DISTANCE

public static final String OPTION_SIBLING_DISTANCE
the option for the sibling distance.

See Also:
Constant Field Values

OPTION_SPEED

public static final String OPTION_SPEED
the option for the speed option set.

See Also:
Constant Field Values

OPTION_SUBTREE_DISTANCE

public static final String OPTION_SUBTREE_DISTANCE
the option for the subtree distance.

See Also:
Constant Field Values

OPTION_TRANSPOSE

public static final String OPTION_TRANSPOSE
the option for the transposition.

See Also:
Constant Field Values

OPTION_TREE_DISTANCE

public static final String OPTION_TREE_DISTANCE
the option for the tree distance.

See Also:
Constant Field Values

DIRECTION_NORTH

public static final int DIRECTION_NORTH
the 'north' direction.

See Also:
Constant Field Values

DIRECTION_SOUTH

public static final int DIRECTION_SOUTH
the 'south' direction.

See Also:
Constant Field Values

DIRECTION_WEST

public static final int DIRECTION_WEST
the 'west' direction.

See Also:
Constant Field Values

DIRECTION_EAST

public static final int DIRECTION_EAST
the 'east' direction.

See Also:
Constant Field Values

GORGEOUS_AND_EFFICIENT

public static final int GORGEOUS_AND_EFFICIENT
the 'gorgeous-and-efficient' qvs.

See Also:
Constant Field Values

BEAUTIFUL_AND_FAST

public static final int BEAUTIFUL_AND_FAST
the 'beautiful-and-fast' qvs.

See Also:
Constant Field Values

NICE_AND_INCREDIBLE_SPEED

public static final int NICE_AND_INCREDIBLE_SPEED
the 'nice-and-incredible-speed' qvs.

See Also:
Constant Field Values

COSTS_STANDARD

public static final int COSTS_STANDARD
the 'standard' costs.

See Also:
Constant Field Values

COSTS_REPULSE

public static final int COSTS_REPULSE
the 'repulse' costs.

See Also:
Constant Field Values

COSTS_PLANAR

public static final int COSTS_PLANAR
the 'planar' costs.

See Also:
Constant Field Values

SPEED_FAST

public static final int SPEED_FAST
the 'fast' speed.

See Also:
Constant Field Values

SPEED_MEDIUM

public static final int SPEED_MEDIUM
the 'medium' speed.

See Also:
Constant Field Values

SPEED_HQ

public static final int SPEED_HQ
the 'hq' speed.

See Also:
Constant Field Values

ORIENTATION_TOP_TO_BOTTOM

public static final int ORIENTATION_TOP_TO_BOTTOM
the 'top-to-bottom' orientation.

See Also:
Constant Field Values

ORIENTATION_BOTTOM_TO_TOP

public static final int ORIENTATION_BOTTOM_TO_TOP
the 'bottom-to-top' orientation.

See Also:
Constant Field Values

ORIENTATION_LEFT_TO_RIGHT

public static final int ORIENTATION_LEFT_TO_RIGHT
the 'left-to-right' orientation.

See Also:
Constant Field Values

ORIENTATION_RIGHT_TO_LEFT

public static final int ORIENTATION_RIGHT_TO_LEFT
the 'right-to-left' orientation.

See Also:
Constant Field Values

ATTRACTION_FORMULA_FR

public static final int ATTRACTION_FORMULA_FR
the 'Fruchterman-Reingold' attraction formula.

See Also:
Constant Field Values

ATTRACTION_FORMULA_GEM

public static final int ATTRACTION_FORMULA_GEM
the 'GEM' attraction formula.

See Also:
Constant Field Values

EXECUTABLE_PATH_BIN

public static final String EXECUTABLE_PATH_BIN
the path for the executable bin directory.

See Also:
Constant Field Values

EXECUTABLE_PATH_LINUX32

public static final String EXECUTABLE_PATH_LINUX32
the relative path for the linux32 executable.

See Also:
Constant Field Values

EXECUTABLE_PATH_LINUX64

public static final String EXECUTABLE_PATH_LINUX64
the relative path for the linux64 executable.

See Also:
Constant Field Values

EXECUTABLE_PATH_WIN32

public static final String EXECUTABLE_PATH_WIN32
the relative path for the win32 executable.

See Also:
Constant Field Values

EXECUTABLE_PATH_WIN64

public static final String EXECUTABLE_PATH_WIN64
the relative path for the win64 executable.

See Also:
Constant Field Values

EXECUTABLE_PATH_OSX32

public static final String EXECUTABLE_PATH_OSX32
the relative path for the osx32 executable.

See Also:
Constant Field Values

EXECUTABLE_PATH_OSX64

public static final String EXECUTABLE_PATH_OSX64
the relative path for the osx64 executable.

See Also:
Constant Field Values

EXECUTABLE_PATH_SOLARIS

public static final String EXECUTABLE_PATH_SOLARIS
the relative path for the solaris executable.

See Also:
Constant Field Values

BUFFER_SIZE

public static final int BUFFER_SIZE
the size for file transfer buffers.

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 the server to give some output.

See Also:
Constant Field Values

PROCESS_MIN_TIMEOUT

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

See Also:
Constant Field Values
Method Detail

startProcess

public Process startProcess(String inputFormat)
Starts a new ogdf server process or returns an existing one.

Parameters:
inputFormat - the graph input format for the ogdf server
Returns:
an instance of the ogdf server process

endProcess

public void endProcess()
Closes the currently cached process instance so a new one is created for the next start process call.


waitForInput

public boolean waitForInput(InputStream inputStream)
Waits until there is some input from the given input stream.

Parameters:
inputStream - input stream from which input is expected
Returns:
returns whether input arrived

waitForInput

public boolean waitForInput(InputStream inputStream,
                            OgdfServer.Aborter aborter)
Waits until there is some input from the given input stream, with a custom aborter.

Parameters:
inputStream - input stream from which input is expected
aborter - aborter used to abort the process
Returns:
returns whether input arrived

waitForInput

public boolean waitForInput(InputStream inputStream,
                            OgdfServer.Aborter aborter,
                            int timeout)
Waits until there is some input from the given input stream, with a custom aborter and timeout.

Parameters:
inputStream - input stream from which input is expected
aborter - aborter used to abort the process
timeout - the number of milliseconds to wait for an answer from the OGDF server process
Returns:
returns whether input arrived