public final class DotExporter extends GraphExporter
GraphExporter.Format
Constructor and Description |
---|
DotExporter()
Creates a new DotExporter instance which will represent edges as arrows
in non-hypergraphs.
|
DotExporter(boolean alwaysHyper,
GraphExporter.Format format)
Creates a new DotExporter instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
exportGraphToStream(Graph graph,
java.io.OutputStream binOut)
Writes a visual representation of a graph to a binary stream.
|
protected void |
exportRuleToStream(Rule rule,
java.io.OutputStream binOut)
Writes a visual representation of a rule to a binary stream.
|
protected void |
exportSystemToStream(ExplicitTransitionSystem system,
java.io.OutputStream binOut)
Writes a visual representation of a labeled transition system to a
binary stream.
|
void |
exportTransformationSequence(java.util.List<Transition> sequence,
java.io.File file)
Write a representation of a transformation sequence to a file.
|
DotStyle |
getDefaultEdgeStyle()
Returns the default style for hyperedges.
|
DotStyle |
getDefaultGraphStyle()
Returns the default style for the graphs in transition systems.
|
DotStyle |
getDefaultLineStyle()
Returns the default style for lines.
|
DotStyle |
getDefaultNodeStyle()
Returns the default style for graph nodes.
|
DotStyle |
getHighlightStyle()
Returns the highlight style of this DotExporter.
|
void |
printDot(ExplicitTransitionSystem system,
java.io.PrintWriter out)
Write a DOT representation of this ExplicitTransitionSystem to a
PrintWriter.
|
void |
printDot(Graph graph,
java.io.PrintWriter out)
Prints a DOT representation of a graph to a PrintWriter.
|
void |
printDot(Graph graph,
java.io.PrintWriter out,
java.util.Map<java.lang.Object,DotStyle> styles)
Prints a DOT representation of this graph to a PrintWriter.
|
void |
printDot(Rule rule,
java.io.PrintWriter out)
Prints a DOT representation of a rule to a PrintWriter with custom
styles.
|
void |
setCustomStyles(java.util.Map<java.lang.Object,DotStyle> styles)
Sets the custom styles for this DotExporter.
|
void |
setDefaultEdgeStyle(DotStyle style)
Sets the default style for hyperedges.
|
void |
setDefaultGraphStyle(DotStyle style)
Sets the default style for the graphs in transition systems.
|
void |
setDefaultLineStyle(DotStyle style)
Sets the default style for lines.
|
void |
setDefaultNodeStyle(DotStyle style)
Sets the default style for graph nodes.
|
void |
setHighlightStyle(DotStyle style)
Sets the highlight style of this DotExporter.
|
exportGraph, exportRule, exportTransitionSystem, getFormat
public DotExporter()
public DotExporter(boolean alwaysHyper, GraphExporter.Format format)
alwaysHyper
- if true
, all edges are always represented as hyperedges,
that is, as boxes; if false
, edges of graph which only
contain binary edges will be represented by arrows.format
- format of the graphical files this DotExported generatespublic void setDefaultNodeStyle(DotStyle style)
public DotStyle getDefaultNodeStyle()
public void setDefaultEdgeStyle(DotStyle style)
public DotStyle getDefaultEdgeStyle()
public void setDefaultGraphStyle(DotStyle style)
public DotStyle getDefaultGraphStyle()
public void setDefaultLineStyle(DotStyle style)
public DotStyle getDefaultLineStyle()
public void setHighlightStyle(DotStyle style)
style
- the new highlight style of this DotExporterpublic DotStyle getHighlightStyle()
public void setCustomStyles(java.util.Map<java.lang.Object,DotStyle> styles)
A reference to the same object is stored within this DotExporter; changes to the style map done after the call to this method will be visible to the DotExporter.
styles
- map which associates custom styles to certain objectspublic void printDot(Graph graph, java.io.PrintWriter out, java.util.Map<java.lang.Object,DotStyle> styles)
graph
- graph to write a DOT representation ofout
- the PrintWriter to write tostyles
- styles for some objects of graphpublic void printDot(Graph graph, java.io.PrintWriter out)
Calling printDot(graph, out)
is equivalent to
calling printDot(graph, out, null)
.
public void printDot(Rule rule, java.io.PrintWriter out)
rule
- rule to print a DOT representation ofout
- PrintWriter to print the DOT representation tostyles
- styles for some objects of graph, or null
of no custom
styles are setpublic void printDot(ExplicitTransitionSystem system, java.io.PrintWriter out)
system
- the transition system to be exportedout
- the PrintWriter to write the DOT representation of the
ExplicitTransitionSystem tographIds
- a map which assigns identifiers to the graphs in the transition
systemstyles
- maps which maps some of the objects in the transitions system
(graph nodes, edges, transitions system nodes, transitions, etc)
to user-defined stylesprotected void exportGraphToStream(Graph graph, java.io.OutputStream binOut) throws java.io.IOException
exportGraphToStream
in class GraphExporter
graph
- graph to exportbinOut
- binary stream where the visual representation of the graph is
written tojava.io.IOException
protected void exportRuleToStream(Rule rule, java.io.OutputStream binOut) throws java.io.IOException
exportRuleToStream
in class GraphExporter
rule
- graph to exportbinOut
- binary stream where the visual representation of the graph is
written tojava.io.IOException
protected void exportSystemToStream(ExplicitTransitionSystem system, java.io.OutputStream binOut) throws java.io.IOException
exportSystemToStream
in class GraphExporter
system
- system to write a visual representation ofbinOut
- stream where the visual representation is written tojava.io.IOException
- if an IO error occurspublic void exportTransformationSequence(java.util.List<Transition> sequence, java.io.File file) throws java.io.IOException
Calling exportTransformationSequence(sequence, out)
is
equivalent to calling
exportTransitionSystem(sequence, out, null)
.
exportTransformationSequence
in class GraphExporter
sequence
- transformation sequence to be exportedjava.io.IOException
- when an IO error occurs