Class Converter
java.lang.Object
net.sourceforge.jeuclid.converter.Converter
Generic converter which uses the registry to do its conversions.
- Version:
- $Revision: fb73652dbc06 $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts an existing file from MathML or ODF to the given type.convert(File inFile, File outFile, String outFileType, LayoutContext params) Converts an existing file from MathML or ODF to the given type.convert(Node doc, File outFile, String outFileType, LayoutContext params) Converts an existing document from MathML to the given type and store it in a file.convert(Node doc, OutputStream outStream, String outFileType, LayoutContext params) Converts an existing file from MathML or ODF to the given type.convert(Node doc, String outFileType, LayoutContext params) Converts an existing document from MathML to the given XML based type and store it in a DOM document.static ConverterDeprecated.static ConverterRetrieve an instance of the converter singleton class.render(Node node, LayoutContext context) Renders a document into an image.render(Node node, LayoutContext context, int imageType) Renders a document into an image.
-
Field Details
-
TYPE_SVG
Mime type for SVG.- See Also:
-
EXTENSION_SVG
File extension for SVG.- See Also:
-
-
Constructor Details
-
Converter
protected Converter()Default constructor.
-
-
Method Details
-
getInstance
Retrieve an instance of the converter singleton class.- Returns:
- a Converter object.
-
getConverter
Deprecated.usegetInstance()instead.- Returns:
- Converter instance
-
convert
Converts an existing file from MathML or ODF to the given type.- Parameters:
inFile- input file.outFile- output file.outFileType- mimetype for the output file.- Returns:
- Dimension of converted image upon success, null otherwise
- Throws:
IOException- if an I/O error occurred during read or write.
-
convert
public Dimension convert(File inFile, File outFile, String outFileType, LayoutContext params) throws IOException Converts an existing file from MathML or ODF to the given type.- Parameters:
inFile- input file.outFile- output file.outFileType- mimetype for the output file.params- rendering parameters.- Returns:
- Dimension of converted image upon success, null otherwise
- Throws:
IOException- if an I/O error occurred during read or write.
-
convert
public Dimension convert(Node doc, File outFile, String outFileType, LayoutContext params) throws IOException Converts an existing document from MathML to the given type and store it in a file.- Parameters:
doc- input document. Seefor the list of valid node types.invalid reference
net.sourceforge.jeuclid.DOMBuilder#DOMBuilder(Node, MathBase)outFile- output file.outFileType- mimetype for the output file.params- parameter set to use for conversion.- Returns:
- Dimension of converted image upon success, null otherwise
- Throws:
IOException- if an I/O error occurred during read or write.
-
convert
public ConverterPlugin.DocumentWithDimension convert(Node doc, String outFileType, LayoutContext params) Converts an existing document from MathML to the given XML based type and store it in a DOM document.- Parameters:
doc- input document. Seefor the list of valid node types.invalid reference
net.sourceforge.jeuclid.DOMBuilder#DOMBuilder(Node, MathBase)outFileType- mimetype for the output file.params- parameter set to use for conversion.- Returns:
- an instance of Document, or the appropriate subtype for this format (e.g. SVGDocument). If conversion is not supported to this type, it may return null.
-
convert
public Dimension convert(Node doc, OutputStream outStream, String outFileType, LayoutContext params) throws IOException Converts an existing file from MathML or ODF to the given type.- Parameters:
doc- input document. Seefor the list of valid node types.invalid reference
net.sourceforge.jeuclid.DOMBuilder#DOMBuilder(Node, MathBase)outStream- output stream.outFileType- mimetype for the output file.params- parameter set to use for conversion.- Returns:
- Dimension of converted image upon success, null otherwise
- Throws:
IOException- if an I/O error occurred during read or write.
-
render
Renders a document into an image.- Parameters:
node- Document / Node to rendercontext- LayoutContext to use.- Returns:
- the rendered image
- Throws:
IOException- if an I/O error occurred.
-
render
Renders a document into an image.- Parameters:
node- Document / Node to rendercontext- LayoutContext to use.imageType- ImageType as defined byBufferedImage- Returns:
- the rendered image
- Throws:
IOException- if an I/O error occurred.
-
getInstance()instead.