TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.tptp.platform.report.chart.svg.internal
Interface IGraphicDocumentGenerator

All Known Implementing Classes:
SVGGenerator

public interface IGraphicDocumentGenerator

IGraphicDocumentGenerator defines the API for an SVG generator. An SVG generator generates graphic in support of data visualization, such as line charts, bar charts, pie charts, etc. Input to the SVG generator consists of data and configuration information, and is formated in XML that conforms to input.xsd. The output charts are formated in Scalable Vector Graphics (SVG). SVG is a W3C recommendation for describing two-dimensional graphics in XML.


Method Summary
 org.w3c.dom.Document generateGraphicDocument(Chart input)
          Generates a chart in SVG format given the input as an object model.
 org.w3c.dom.Document generateGraphicDocument(org.w3c.dom.Document input, boolean validateInput)
          Generates a chart in SVG format given the input XML as a DOM object.
 void generateGraphicDocument(org.w3c.dom.Document input, boolean validateInput, java.io.OutputStream outputStream)
          Generates a chart in SVG format given the input XML a DOM object, and writes the output to the given output stream.
 org.w3c.dom.Document generateGraphicDocument(java.io.InputStream input, boolean validateInput)
          Generates a chart in SVG format given the input XML as an input stream.
 void generateGraphicDocument(java.io.InputStream input, boolean validateInput, java.io.OutputStream outputStream)
          Generates a chart in SVG format given the input XML an input stream, and writes the output to the given output stream.
 boolean serializeGeneratedDocumentToFile(org.w3c.dom.Document generatedDocument, java.lang.String uri)
          Serializes a Document object to a file in XML format.
 java.lang.String serializeGeneratedDocumentToString(org.w3c.dom.Document generatedDocument)
          Serializes a Document object to a String in XML format.
 

Method Detail

generateGraphicDocument

org.w3c.dom.Document generateGraphicDocument(Chart input)
                                             throws SVGGeneratorException
Generates a chart in SVG format given the input as an object model.

Parameters:
input - The document object model (DOM) representation of the input XML.
Returns:
the SVG output
Throws:
SVGGeneratorException - If input is invalid, or generation process failed

generateGraphicDocument

org.w3c.dom.Document generateGraphicDocument(org.w3c.dom.Document input,
                                             boolean validateInput)
                                             throws SVGGeneratorException
Generates a chart in SVG format given the input XML as a DOM object. The input XML will be validated at runtime if validateInput is set to true.

Parameters:
input - The document object model (DOM) representation of the input XML.
validateInput - Set to true if the input should be validated, false otherwise.
Returns:
the SVG output
Throws:
SVGGeneratorException - If input is invalid, or generation process failed

generateGraphicDocument

org.w3c.dom.Document generateGraphicDocument(java.io.InputStream input,
                                             boolean validateInput)
                                             throws SVGGeneratorException
Generates a chart in SVG format given the input XML as an input stream. The input XML will be validated at runtime if validateInput is set to true.

Parameters:
input - the input to the SVG generator as an input stream
validateInput - Set to true if the input should be validated, false otherwise.
Returns:
the SVG output
Throws:
SVGGeneratorException - If input is invalid, or generation process failed

generateGraphicDocument

void generateGraphicDocument(org.w3c.dom.Document input,
                             boolean validateInput,
                             java.io.OutputStream outputStream)
                             throws SVGGeneratorException
Generates a chart in SVG format given the input XML a DOM object, and writes the output to the given output stream. The input XML will be validated at runtime if validateInput is set to true.

Parameters:
input - The document object model (DOM) representation of the input XML.
validateInput - Set to true if the input should be validated, false otherwise.
outputStream - output stream
Throws:
SVGGeneratorException - If input is invalid, generation process failed, or failed to write to the given output stream

generateGraphicDocument

void generateGraphicDocument(java.io.InputStream input,
                             boolean validateInput,
                             java.io.OutputStream outputStream)
                             throws SVGGeneratorException
Generates a chart in SVG format given the input XML an input stream, and writes the output to the given output stream. The input XML will be validated at runtime if validateInput is set to true.

Parameters:
input - the input to the SVG generator as an input stream
validateInput - Set to true if the input should be validated, false otherwise.
outputStream - output stream
Throws:
SVGGeneratorException - If input is invalid, generation process failed, or failed to write to the given output stream

serializeGeneratedDocumentToFile

boolean serializeGeneratedDocumentToFile(org.w3c.dom.Document generatedDocument,
                                         java.lang.String uri)
                                         throws SVGGeneratorException
Serializes a Document object to a file in XML format. This is a convevience method to save the output of the SVG generator to a file.

Parameters:
generatedDocument - the generated graphic
filename - The location to which the object is serialized.
Returns:
boolean true, if the operation is successful.
Throws:
SVGGeneratorException - If failed to write to the file specified

serializeGeneratedDocumentToString

java.lang.String serializeGeneratedDocumentToString(org.w3c.dom.Document generatedDocument)
                                                    throws SVGGeneratorException
Serializes a Document object to a String in XML format. This is a convevience method to save the output of the SVG generator to a string.

Parameters:
generatedDocument - the generated graphic
Returns:
String the XML-serialized form of the Document
Throws:
SVGGeneratorException - If XML serialization failed

TPTP 4.5.0 Platform Project
Internal API Specification