com.tensegrity.graph.view
Class VisualGraphViewUtil

java.lang.Object
  extended bycom.tensegrity.graph.view.VisualGraphViewUtil

public class VisualGraphViewUtil
extends java.lang.Object

Utility class for outputing SVG (Scalable Vector Graphics) from a given VisualGraphView instance.

Please refer to http://www.svg.org for detailed information about the SVG format.

Version:
$Id: VisualGraphViewUtil.java,v 1.41 2005/11/10 15:45:45 BurkhardWick Exp $
Author:
BurkhardWick

Method Summary
static boolean containsAttributeValue(AttributableOnSet attribOnSet, java.lang.String text)
          Checks if the given AttributableOnSet contains an attribute that contains the given text in its value.
static boolean containsAttributeValue(AttributeSet attribs, java.lang.String text)
          Checks if the given AttributeSet contains an attribute that contains the given text in its value.
static java.util.Collection findElementsWithAttributeValue(VisualGraphObjectContainer vgv, java.lang.String text)
          Looks through all elements in the VisualGraphObjectContainer (recursively) and returns all elements whose attribute values contain the given text.
static void renderSVG(VisualGraphView vgv, java.io.OutputStream svgOutput)
          This method outputs the given VisualGraphView into the given OutputStream.
static void renderSVG(VisualGraphView vgv, java.io.OutputStream svgOutput, boolean closeStream)
          Renders the SVG to the given outputstream.
static void renderSVG(VisualGraphView vgv, java.io.OutputStream svgOutput, boolean closeStream, boolean compress)
          Renders the SVG to the given outputstream.
static void renderSVG(VisualGraphView vgv, java.io.OutputStream svgOutput, boolean closeStream, boolean compress, boolean optimize)
          This method outputs the given VisualGraphView into the given OutputStream.
static void renderSVG(VisualGraphView vgv, java.io.OutputStream svgOutput, boolean closeStream, boolean compress, boolean optimize, Boundary insets)
          This method outputs the given VisualGraphView into the given OutputStream.
static void renderSVG(VisualGraphView vgv, java.io.OutputStream svgOutput, boolean closeStream, boolean compress, boolean optimize, Boundary insets, double[] viewValues, double[] viewportValues)
          This method outputs the given VisualGraphView into the given OutputStream.
static void setDefaultEdgeType(VisualGraphView vgv, java.lang.String elementName)
          Sets the default edge geometry, style and rule in the given VisualGraphView according to the element in the ElementPool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

renderSVG

public static void renderSVG(VisualGraphView vgv,
                             java.io.OutputStream svgOutput)
This method outputs the given VisualGraphView into the given OutputStream.

Parameters:
vgv - the VisualGraphView to output.
svgOutput - the OutputStream to write the svg-data to.

renderSVG

public static void renderSVG(VisualGraphView vgv,
                             java.io.OutputStream svgOutput,
                             boolean closeStream)
Renders the SVG to the given outputstream.

Parameters:
vgv - The graph to render to SVG
svgOutput - The output stream to write to
closeStream - If true, the stream will be closed afterwards

renderSVG

public static void renderSVG(VisualGraphView vgv,
                             java.io.OutputStream svgOutput,
                             boolean closeStream,
                             boolean compress)
Renders the SVG to the given outputstream.

Parameters:
vgv - The graph to render to SVG
svgOutput - The output stream to write to
closeStream - If true, the stream will be closed afterwards
compress - If true, the SVG will be saved in compressed format

renderSVG

public static void renderSVG(VisualGraphView vgv,
                             java.io.OutputStream svgOutput,
                             boolean closeStream,
                             boolean compress,
                             boolean optimize)
This method outputs the given VisualGraphView into the given OutputStream.

Parameters:
vgv - the VisualGraphView to output.
svgOutput - the OutputStream to write the svg-data to.
closeStream - If true, the stream will be flushed and closed before the function returns
compress - True, if the result should be gzipped
optimize - True, if CSS items should be created, so styles that are used very often are only once in the xml.

renderSVG

public static void renderSVG(VisualGraphView vgv,
                             java.io.OutputStream svgOutput,
                             boolean closeStream,
                             boolean compress,
                             boolean optimize,
                             Boundary insets)
This method outputs the given VisualGraphView into the given OutputStream.

Parameters:
vgv - the VisualGraphView to output.
svgOutput - the OutputStream to write the svg-data to.
closeStream - If true, the stream will be flushed and closed before the function returns
compress - True, if the result should be gzipped
optimize - True, if CSS items should be created, so styles that are used very often are only once in the xml.
insets - Adds a border around the graph

renderSVG

public static void renderSVG(VisualGraphView vgv,
                             java.io.OutputStream svgOutput,
                             boolean closeStream,
                             boolean compress,
                             boolean optimize,
                             Boundary insets,
                             double[] viewValues,
                             double[] viewportValues)
This method outputs the given VisualGraphView into the given OutputStream.

Parameters:
vgv - the VisualGraphView to output.
svgOutput - the OutputStream to write the svg-data to.
closeStream - If true, the stream will be flushed and closed before the function returns
compress - True, if the result should be gzipped
optimize - True, if CSS items should be created, so styles that are used very often are only once in the xml.
insets - Adds a border around the graph
viewValues - double array containing the view values to be used while render output.
viewportValues - double array containing the viewport values to be used while render output.

findElementsWithAttributeValue

public static java.util.Collection findElementsWithAttributeValue(VisualGraphObjectContainer vgv,
                                                                  java.lang.String text)
Looks through all elements in the VisualGraphObjectContainer (recursively) and returns all elements whose attribute values contain the given text.

Parameters:
vgv - The container to start looking
text - The text to look for
Returns:
A collection with all found elements. Might be empty, but might not be null

containsAttributeValue

public static boolean containsAttributeValue(AttributableOnSet attribOnSet,
                                             java.lang.String text)
Checks if the given AttributableOnSet contains an attribute that contains the given text in its value.

Parameters:
attribOnSet - The attributable to check
text - The text to look for
Returns:
Returns true, if the element contains the text

containsAttributeValue

public static boolean containsAttributeValue(AttributeSet attribs,
                                             java.lang.String text)
Checks if the given AttributeSet contains an attribute that contains the given text in its value.

Parameters:
attribs - The attribute set to check
text - The text to look for
Returns:
Returns true, if the set contains the text

setDefaultEdgeType

public static final void setDefaultEdgeType(VisualGraphView vgv,
                                            java.lang.String elementName)
Sets the default edge geometry, style and rule in the given VisualGraphView according to the element in the ElementPool.

Parameters:
vgv - The VisualGraphView to modify
elementName - The name of the element in the ElementPool to use


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.