net.ggtools.grand.output
Class DotWriter

java.lang.Object
  extended by net.ggtools.grand.output.DotWriter
All Implemented Interfaces:
GraphConsumer, GraphWriter

public class DotWriter
extends java.lang.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 usign various setters. The property names use the following scheme: dot.objecttype.attributes. Where objectype can be:

The property values are sets of valid dot attributes without the surrounding bracket.

Author:
Christophe Labouisse
See Also:
Graphviz home page, Dot attributes

Constructor Summary
DotWriter()
          Creates a new DotWriter using default configuration.
DotWriter(java.util.Properties override)
          Creates a new DotWriter with custom properties.
 
Method Summary
 void setProducer(GraphProducer producer)
          Set the graph producer.
 void setShowGraphName(boolean show)
          Set wether or not the graph name should be display on the written graph.
 void write(java.io.File output)
          Write a project's graph to a file.
 void write(java.io.OutputStream stream)
          Write a project's graph to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotWriter

public DotWriter()
          throws java.io.IOException
Creates a new DotWriter using default configuration.

Throws:
java.io.IOException - when the default configuration cannot be loaded.

DotWriter

public DotWriter(java.util.Properties override)
          throws java.io.IOException
Creates a new DotWriter with custom properties. No overriding will take place if override is null.

Parameters:
override - custom configuration.
Throws:
java.io.IOException - when the configuration cannot be loaded.
Method Detail

write

public void write(java.io.File output)
           throws java.io.IOException,
                  GrandException
Description copied from interface: GraphWriter
Write a project's graph to a file.

Specified by:
write in interface GraphWriter
Parameters:
output - file to write the graph to.
Throws:
java.io.IOException - if the file cannot be written.
GrandException - if the graph cannot be written for a problem within Grand.

write

public void write(java.io.OutputStream stream)
           throws GrandException
Description copied from interface: GraphWriter
Write a project's graph to a stream.

Specified by:
write in interface GraphWriter
Parameters:
stream - The stream to write to.
Throws:
GrandException - if the graph cannot be written for a problem within Grand.

setProducer

public void setProducer(GraphProducer producer)
Description copied from interface: GraphConsumer
Set the graph producer. Such a producer will be called whenever the consumer needs a graph.

Specified by:
setProducer in interface GraphConsumer
Parameters:
producer - the producer to get the graph from.

setShowGraphName

public void setShowGraphName(boolean show)
Description copied from interface: GraphWriter
Set wether or not the graph name should be display on the written graph. The default value depends on the implementations.

Specified by:
setShowGraphName in interface GraphWriter
Parameters:
show - true to display the graph name.


Copyright © 2004-2005 ggTools. All Rights Reserved.