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:nodefor "common" nodes,linkfor dependency links,mainnodefor nodes with a special importance (i.e.: when node.isMainNode() is true),startnodefor the start node,- and
graphfor 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 voidsetProducer(GraphProducer producer)Method setProducer.voidsetShowGraphName(boolean show)Method setShowGraphName.voidwrite(File output)Method write.voidwrite(OutputStream stream)Method write.
-
-
-
Constructor Detail
-
DotWriter
public DotWriter() throws IOExceptionCreates 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:
writein 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:
writein 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:
setProducerin interfaceGraphConsumer- Parameters:
producer- GraphProducer- See Also:
GraphConsumer.setProducer(net.ggtools.grand.graph.GraphProducer)
-
setShowGraphName
public final void setShowGraphName(boolean show)
Method setShowGraphName.- Specified by:
setShowGraphNamein interfaceGraphWriter- Parameters:
show- boolean- See Also:
GraphWriter.setShowGraphName(boolean)
-
-