org.faceless.graph2.tag
Class SVGEmbedder
java.lang.Object
org.faceless.graph2.tag.Embedder
org.faceless.graph2.tag.SVGEmbedder
public class SVGEmbedder
- extends Embedder
This Embedder creates an SVG format Graph using the SVGOutput
class, and embeds it in the HTML using the <object> and/or <embed> tags.
It handles rollovers in a similar way to the PNGEmbedder
class.
- Since:
- 2.4
Methods inherited from class org.faceless.graph2.tag.Embedder |
getAction, getActionKeys, getAttribute, getAttributes, getFont, getFonts, getForeignXML, getGraph, getHeight, getId, getImageOutputStream, getImagePath, getPageResources, getPageWriter, getPaint, getWidth |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SVGEmbedder
public SVGEmbedder()
setBrowserSniff
public void setBrowserSniff(boolean sniff)
- Set whether to "sniff" the browser using JavaScript. The correct code to
handle SVG documents cannot be created in a cross-browser fashion, so
setting this flag will cause the browser to be identified with JavaScript
on load and the tags modified then.
- Since:
- 2.4.2
getMIMEType
public String getMIMEType()
- Description copied from class:
Embedder
- Get the MIME type for the image that will be written by this Embedder to
Embedder.getImageOutputStream()
- Specified by:
getMIMEType
in class Embedder
convert
public void convert()
throws IOException
- Description copied from class:
Embedder
- Convert the object returned by
Embedder.getGraph()
to an appropriate binary form,
write it to Embedder.getImageOutputStream()
and write the HTML required to embed it to
Embedder.getPageWriter()
, referencing the image at Embedder.getImagePath()
.
At it's very minimum it could look something like this:
ImageOutput output = new ImageOutput();
getGraph().draw(output);
output.writePNG(getImageOutputStream(), 0);
getPageWriter().write("<img src='"+getImagePath()+"' />");
which is suitable for embedding an image with no mouse interaction.
- Specified by:
convert
in class Embedder
- Throws:
IOException
Copyright © 2001-2011 Big Faceless Organization