public abstract class OffscreenGraph extends Object
Constructor and Description |
---|
OffscreenGraph(int width,
int height)
Create an off-screen graph.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
configureViewer(org.eclipse.zest.core.viewers.GraphViewer viewer)
Configure the viewer.
|
void |
dispose()
Dispose the off-screen graph shell.
|
org.eclipse.zest.core.widgets.Graph |
getGraph() |
void |
resize(int width,
int height)
Resize the off-screen graph.
|
static void |
saveDot(org.eclipse.zest.core.widgets.Graph graph,
OutputStream out)
Save a graph in the dot format to an output stream.
|
static void |
saveImage(org.eclipse.draw2d.IFigure root,
OutputStream out,
String format)
Save a figure as image to an output stream.
|
void |
saveImage(OutputStream out,
String format)
Save the graph as image to an output stream.
|
static void |
saveSVG(org.eclipse.draw2d.IFigure root,
OutputStream out)
Save a figure as Scalable Vector Graphics to an output stream.
|
void |
saveSVG(OutputStream out)
Save the graph as Scalable Vector Graphics to an output stream.
|
public OffscreenGraph(int width, int height)
width
- the graph widthheight
- the graph heightpublic org.eclipse.zest.core.widgets.Graph getGraph()
public void resize(int width, int height)
width
- the graph widthheight
- the graph heightpublic void dispose()
Shell.dispose()
protected abstract void configureViewer(org.eclipse.zest.core.viewers.GraphViewer viewer)
viewer
- the graph viewerpublic void saveImage(OutputStream out, String format) throws IOException
out
- the output stream to write the image to (which is closed after
writing)format
- the informal name of the image format, if null
defaults to png
IOException
- if writing the image failsImageIO.write(java.awt.image.RenderedImage, String, OutputStream)
public void saveSVG(OutputStream out) throws IOException, TransformerFactoryConfigurationError, TransformerException
out
- the output stream to write the SVG DOM to (which is closed
after writing)IOException
- if writing to the output stream failsTransformerFactoryConfigurationError
- if creating the transformer
failsTransformerException
- if writing the document failspublic static void saveImage(org.eclipse.draw2d.IFigure root, OutputStream out, String format) throws IOException
root
- the figure to drawout
- the output stream to write the image to (which is closed after
writing)format
- the informal name of the image format, if null
defaults to png
IOException
- if writing the image failsImageIO.write(java.awt.image.RenderedImage, String, OutputStream)
public static void saveSVG(org.eclipse.draw2d.IFigure root, OutputStream out) throws IOException, TransformerFactoryConfigurationError, TransformerException
root
- the figure to drawout
- the output stream to write the SVG DOM to (which is closed
after writing)IOException
- if writing to the output stream failsTransformerFactoryConfigurationError
- if creating the transformer
failsTransformerException
- if writing the document failspublic static void saveDot(org.eclipse.zest.core.widgets.Graph graph, OutputStream out) throws IOException
graph
- the graphout
- the output stream (which is closed after writing)IOException
- if writing to the output stream failsBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a