public class SVGEmbedder extends Embedder
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.Constructor and Description |
---|
SVGEmbedder() |
Modifier and Type | Method and Description |
---|---|
void |
convert()
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() . |
String |
getMIMEType()
Get the MIME type for the image that will be written by this Embedder to
Embedder.getImageOutputStream() |
SVGOutput |
getSVGOutput()
Return the
SVGOutput created by this class |
void |
setBrowserSniff(boolean sniff)
Set whether to "sniff" the browser using JavaScript.
|
getAction, getActionKeys, getAttribute, getAttributes, getFont, getFonts, getForeignXML, getGraph, getHeight, getId, getImageOutputStream, getImagePath, getPageResources, getPageWriter, getPaint, getResourceProvider, getWidth
public void setBrowserSniff(boolean sniff)
public String getMIMEType()
Embedder
Embedder.getImageOutputStream()
getMIMEType
in class Embedder
public void convert() throws IOException
Embedder
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.
convert
in class Embedder
IOException
Copyright © 2001-2016 Big Faceless Organization