Package net.ggtools.grand.output
Class DotWriter
- java.lang.Object
-
- net.ggtools.grand.output.DotWriter
-
- All Implemented Interfaces:
GraphConsumer
,GraphWriter
public class DotWriter extends Object implements GraphWriter
A class to write dependency graph in dot format. The rendering can be customized either by properties at object creation or at runtime using various setters. The property names use the following scheme:dot.objecttype.attributes
. Where objecttype can be:node
for "common" nodes,link
for dependency links,mainnode
for nodes with a special importance (i.e.: when node.isMainNode() is true),startnode
for the start node,- and
graph
for the graph itself.
- Author:
- Christophe Labouisse
- See Also:
- Graphviz home page, Dot attributes
- To do:
- The current configuration scheme sucks, create something more generic.
-
-
Constructor Summary
Constructors Constructor Description DotWriter()
Creates a new DotWriter using default configuration.DotWriter(Properties override)
Creates a new DotWriter with custom properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setProducer(GraphProducer producer)
Method setProducer.void
setShowGraphName(boolean show)
Method setShowGraphName.void
write(File output)
Method write.void
write(OutputStream stream)
Method write.
-
-
-
Constructor Detail
-
DotWriter
public DotWriter() throws IOException
Creates a new DotWriter using default configuration.- Throws:
IOException
- when the default configuration cannot be loaded.
-
DotWriter
public DotWriter(Properties override) throws IOException
Creates a new DotWriter with custom properties. No overriding will take place if override is null.- Parameters:
override
- custom configuration.- Throws:
IOException
- when the configuration cannot be loaded.
-
-
Method Detail
-
write
public final void write(File output) throws IOException, GrandException
Method write.- Specified by:
write
in interfaceGraphWriter
- Parameters:
output
- File- Throws:
IOException
- when output cannot be created/written toGrandException
- if an error occurs in getGraph()- See Also:
GraphWriter.write(java.io.File)
-
write
public final void write(OutputStream stream) throws GrandException
Method write.- Specified by:
write
in interfaceGraphWriter
- Parameters:
stream
- OutputStream- Throws:
GrandException
- if an error occurs in getGraph()- See Also:
GraphWriter.write(java.io.OutputStream)
-
setProducer
public final void setProducer(GraphProducer producer)
Method setProducer.- Specified by:
setProducer
in interfaceGraphConsumer
- Parameters:
producer
- GraphProducer- See Also:
GraphConsumer.setProducer(net.ggtools.grand.graph.GraphProducer)
-
setShowGraphName
public final void setShowGraphName(boolean show)
Method setShowGraphName.- Specified by:
setShowGraphName
in interfaceGraphWriter
- Parameters:
show
- boolean- See Also:
GraphWriter.setShowGraphName(boolean)
-
-