de.cau.cs.kieler.kiml.graphviz.dot.transform
Class DotExporter

java.lang.Object
  extended by de.cau.cs.kieler.kiml.graphviz.dot.transform.DotExporter
All Implemented Interfaces:
IGraphTransformer<KNode,GraphvizModel>

public class DotExporter
extends Object
implements IGraphTransformer<KNode,GraphvizModel>

This class implements a transformation from the KGraph metamodel to the Dot metamodel. Furthermore it contains functionality to apply layout information attached to a Dot model to a KGraph model.

Rating red

Field Summary
static IProperty<Command> COMMAND
          the Graphviz command to use for transformation.
static float DEF_SPACING_LARGE
          large default value for minimal spacing.
static float DEF_SPACING_SMALL
          small default value for minimal spacing.
static float DEF_SPACING_XLARGE
          extra-large default value for minimal spacing.
static float DPI
          dots per inch specification, needed by Graphviz for some values.
static IProperty<Boolean> FULL_EXPORT
          whether to always transform the whole graph with all hierarchy levels.
static IProperty<Boolean> USE_EDGE_IDS
          whether edge identifiers should be generated or not.
 
Constructor Summary
DotExporter()
           
 
Method Summary
static Attribute createAttribute(String name, float value)
          Create an attribute with given name and float value for the Dot graph.
static Attribute createAttribute(String name, int value)
          Create an attribute with given name and integer value for the Dot graph.
static Attribute createAttribute(String name, String value)
          Create an attribute with given name and value for the Dot graph.
 void transferLayout(TransformationData<KNode,GraphvizModel> transData)
          Applies the layout information attached to the given Dot instance to the KGraph instance using the mapping created by a previous call to transform.
 void transform(TransformationData<KNode,GraphvizModel> transData)
          Transforms the KGraph instance to a Dot instance using the given command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_SPACING_SMALL

public static final float DEF_SPACING_SMALL
small default value for minimal spacing.

See Also:
Constant Field Values

DEF_SPACING_LARGE

public static final float DEF_SPACING_LARGE
large default value for minimal spacing.

See Also:
Constant Field Values

DEF_SPACING_XLARGE

public static final float DEF_SPACING_XLARGE
extra-large default value for minimal spacing.

See Also:
Constant Field Values

DPI

public static final float DPI
dots per inch specification, needed by Graphviz for some values.

See Also:
Constant Field Values

COMMAND

public static final IProperty<Command> COMMAND
the Graphviz command to use for transformation.


USE_EDGE_IDS

public static final IProperty<Boolean> USE_EDGE_IDS
whether edge identifiers should be generated or not.


FULL_EXPORT

public static final IProperty<Boolean> FULL_EXPORT
whether to always transform the whole graph with all hierarchy levels.

Constructor Detail

DotExporter

public DotExporter()
Method Detail

transform

public void transform(TransformationData<KNode,GraphvizModel> transData)
Transforms the KGraph instance to a Dot instance using the given command.

Specified by:
transform in interface IGraphTransformer<KNode,GraphvizModel>
Parameters:
transData - the transformation data instance

transferLayout

public void transferLayout(TransformationData<KNode,GraphvizModel> transData)
Applies the layout information attached to the given Dot instance to the KGraph instance using the mapping created by a previous call to transform. Has to be called after a call to transform.

Specified by:
transferLayout in interface IGraphTransformer<KNode,GraphvizModel>
Parameters:
transData - the transformation data instance

createAttribute

public static Attribute createAttribute(String name,
                                        String value)
Create an attribute with given name and value for the Dot graph.

Parameters:
name - name of the attribute
value - value of the attribute
Returns:
instance of a Dot attribute

createAttribute

public static Attribute createAttribute(String name,
                                        int value)
Create an attribute with given name and integer value for the Dot graph.

Parameters:
name - name of the attribute
value - value of the attribute
Returns:
instance of a Dot attribute

createAttribute

public static Attribute createAttribute(String name,
                                        float value)
Create an attribute with given name and float value for the Dot graph.

Parameters:
name - name of the attribute
value - value of the attribute
Returns:
instance of a Dot attribute