|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.io.IOHandler
yext.svg.io.SVGIOHandler
public class SVGIOHandler
Writes a Graph2D in SVG vector graphics format.
The size, viewport and zoom level of the output will be determined by the Graph2DView associated with the input graph.
The output SVG can be enhanced by providing a specialized implementation
of SVGGraph2DRenderer.
Graph2DView,
SVGGraph2DRenderer| Constructor Summary | |
|---|---|
SVGIOHandler()
Instantiates a new SVGIOHandler. |
|
| Method Summary | |
|---|---|
boolean |
canRead()
Returns false, since this class can't read a graph. |
Graph2DView |
createDefaultGraph2DView(Graph2D graph)
Creates the default view used as rendering context of this output handler in case there is no current view associated with the graph2D. |
protected Document |
createDocument()
Creates the xml document that will serve as internal representation of the SVG output. |
Graph2DView |
getActiveGraph2DView()
|
Document |
getDocument()
Returns the xml document that will serve as internal representation of the SVG output. |
String |
getFileFormatString()
Returns the SVG file format string. |
String |
getFileNameExtension()
Returns the SVG file name extension, i.e. |
Graph2DView |
getGraph2DView()
|
SVGGraph2DRenderer |
getSVGGraph2DRenderer()
Returns the SVGGraph2DRenderer that will be used to render the graph. |
Object |
getSVGRenderingHintValue()
Returns the preferred rendering mode to be used when exporting SVG enhanced content (i.e. |
boolean |
isCanvasSizeAssigned()
Returns whether or not the <svg> element of the generated file will have the canvas width and height assigned. |
boolean |
isUseCSS()
Returns true if SVG element attributes will be generated as a
single CSS style attribute. |
void |
read(Graph2D graph,
InputStream in)
Throws always an UnsupportedOperationException, since
canRead() == false. |
void |
setCanvasSizeAssigned(boolean canvasSizeAssigned)
Sets whether or not the <svg> element of the generated file will have the canvas width and height assigned. |
void |
setGraph2DView(Graph2DView viewPort)
|
void |
setSVGGraph2DRenderer(SVGGraph2DRenderer renderer)
Sets the SVGGraph2DRenderer that will be used to render the graph. |
void |
setSVGRenderingHintValue(Object value)
Specifies the preferred rendering mode to be used when exporting SVG enhanced content (i.e. |
void |
setUseCSS(boolean useCSS)
Specifies whether SVG element attributes should be generated as a single CSS style attribute. |
void |
write(Graph2D graph,
OutputStream out)
|
| Methods inherited from class y.io.IOHandler |
|---|
canWrite, canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, read, shouldSerialize, shouldSerialize, write, writeSubset, writeSubset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SVGIOHandler()
| Method Detail |
|---|
public String getFileFormatString()
getFileFormatString in class IOHandlerpublic String getFileNameExtension()
getFileNameExtension in class IOHandlerpublic boolean canRead()
canRead in class IOHandlerpublic void setSVGGraph2DRenderer(SVGGraph2DRenderer renderer)
public SVGGraph2DRenderer getSVGGraph2DRenderer()
setSVGGraph2DRenderer(yext.svg.io.SVGGraph2DRenderer)public Object getSVGRenderingHintValue()
SVGModel).
SVGModel.KEY_SVG_RENDERINGSVGModel.KEY_SVG_RENDERING,
SVGModel.VALUE_SVG_RENDERING_DEFAULT,
SVGModel.VALUE_SVG_RENDERING_FORCE_RASTERIZATION,
SVGModel.VALUE_SVG_RENDERING_FORCE_VECTORIZATIONpublic void setSVGRenderingHintValue(Object value)
SVGModel). The specified value has to be compatible
with SVGModel.KEY_SVG_RENDERING.
If the specified value is null, it is silently treated as
SVGModel.VALUE_SVG_RENDERING_DEFAULT.
The default setting for SVGRenderingHintValue is
SVGModel.VALUE_SVG_RENDERING_FORCE_VECTORIZATION.
value - the SVG rendering hint value
IllegalArgumentException - iff the specified value is not
compatible with SVGModel.KEY_SVG_RENDERINGSVGModel.KEY_SVG_RENDERING,
SVGModel.VALUE_SVG_RENDERING_DEFAULT,
SVGModel.VALUE_SVG_RENDERING_FORCE_RASTERIZATION,
SVGModel.VALUE_SVG_RENDERING_FORCE_VECTORIZATIONpublic boolean isUseCSS()
true if SVG element attributes will be generated as a
single CSS style attribute.
true if SVG element attributes will be generated as a
single CSS style attribute; false otherwise.public void setUseCSS(boolean useCSS)
useCSS - if true SVG element attributes are generated
as a single CSS style attribute.public Graph2DView getActiveGraph2DView()
public void read(Graph2D graph,
InputStream in)
throws IOException
UnsupportedOperationException, since
canRead() == false.
read in class IOHandlerIOException
public void write(Graph2D graph,
OutputStream out)
throws IOException
write in class IOHandlerIOExceptionprotected Document createDocument()
public Document getDocument()
public Graph2DView createDefaultGraph2DView(Graph2D graph)
The returned view will be automatically registered as one of the graph's views. After the returned view is not needed anymore it is advisable to remove it from the list of registered view of the given graph.
Graph2D.removeView(View)public void setGraph2DView(Graph2DView viewPort)
public Graph2DView getGraph2DView()
public boolean isCanvasSizeAssigned()
By default the canvas size will be assigned.
public void setCanvasSizeAssigned(boolean canvasSizeAssigned)
By default the canvas size will be assigned.
|
© Copyright 2000-2007, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||