Package org.faceless.graph2.tag
Class Embedder
- java.lang.Object
-
- org.faceless.graph2.tag.Embedder
-
- Direct Known Subclasses:
PDFEmbedder
,PNGEmbedder
,SVGEmbedder
public abstract class Embedder extends Object
An Embedder is responsible for converting a Graph object to HTML and binary output. Subclasses of this object handle conversion from aGraph
object to various output formats (PNG, SVG etc). This class is used by theEmbeddedXMLGraph
class. It's possible for customers to subclass this (or further subclass one of the existing subclasses) to create their own output formats.- Since:
- 2.4
- See Also:
EmbeddedXMLGraph.doEmbed()
,EmbedderFactory
-
-
Field Summary
Fields Modifier and Type Field Description static Collection<String>
ACTIONS
A list of the "actions" that can be applied to each rollover area.
-
Constructor Summary
Constructors Constructor Description Embedder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
convert()
Convert the object returned bygetGraph()
to an appropriate binary form, write it togetImageOutputStream()
and write the HTML required to embed it togetPageWriter()
, referencing the image atgetImagePath()
.String
getAttribute(String attribute)
Get the specified non-standard attribute set on theor tag, or null if it doesn't exist Collection<String>
getAttributes()
Get the list of non-standard attributes set on theor tag. String
getForeignXML()
Get any XML that was included in the Graph XML from a different namespaceGraph
getGraph()
Get the Graph this Embedder is operating onint
getHeight()
Get the requested height of the GraphString
getId()
Get the ID for the object being created by this Embedder.abstract String
getMIMEType()
Get the MIME type for the image that will be written by this Embedder togetImageOutputStream()
XMLGraphResourceProvider
getResourceProvider()
Return theXMLGraphResourceProvider
to use with this formatint
getWidth()
Get the requested width of the Graph
-
-
-
Field Detail
-
ACTIONS
public static final Collection<String> ACTIONS
A list of the "actions" that can be applied to each rollover area. These include "title", "href", "target" and the "onNNN" attributes.
-
-
Method Detail
-
getResourceProvider
public XMLGraphResourceProvider getResourceProvider()
Return theXMLGraphResourceProvider
to use with this format- Since:
- 2.4.8
-
getAttributes
public Collection<String> getAttributes()
Get the list of non-standard attributes set on theor tag. - See Also:
getAttribute(java.lang.String)
-
getAttribute
public String getAttribute(String attribute)
Get the specified non-standard attribute set on theor tag, or null if it doesn't exist - See Also:
getAttributes()
-
getGraph
public Graph getGraph()
Get the Graph this Embedder is operating on
-
getWidth
public int getWidth()
Get the requested width of the Graph
-
getHeight
public int getHeight()
Get the requested height of the Graph
-
getId
public String getId()
Get the ID for the object being created by this Embedder. The ID is unique on its page for this graph, and should be used if any other objects (like image maps or JavaScript) are to be created that relate to this Graph.
-
getForeignXML
public String getForeignXML()
Get any XML that was included in the Graph XML from a different namespace
-
getMIMEType
public abstract String getMIMEType()
Get the MIME type for the image that will be written by this Embedder togetImageOutputStream()
-
convert
public abstract void convert() throws IOException
Convert the object returned bygetGraph()
to an appropriate binary form, write it togetImageOutputStream()
and write the HTML required to embed it togetPageWriter()
, referencing the image atgetImagePath()
. 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.- Throws:
IOException
-
-