net.sourceforge.jeuclid.converter
Class Converter

java.lang.Object
  extended by net.sourceforge.jeuclid.converter.Converter

public final class Converter
extends Object

Generic converter which uses the registry to do its conversions.

Version:
$Revision: 434 $
Author:
Max Berger

Method Summary
 Dimension convert(File inFile, File outFile, Map<ParameterKey,String> params)
          Converts an existing file from MathML or ODF to the given type.
 Dimension convert(File inFile, File outFile, String outFileType)
          Converts an existing file from MathML or ODF to the given type.
 Dimension convert(Node doc, File outFile, Map<ParameterKey,String> params)
          Converts an existing file from MathML or ODF to the given type.
 Dimension convert(Node doc, OutputStream outStream, Map<ParameterKey,String> params)
          Converts an existing file from MathML or ODF to the given type.
static Converter getConverter()
          Retrieve an instance of the converter singleton class.
 BufferedImage render(MathBase base)
          Renders a document into an image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConverter

public static Converter getConverter()
Retrieve an instance of the converter singleton class.

Returns:
a Converter object.

convert

public Dimension convert(File inFile,
                         File outFile,
                         String outFileType)
                  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.
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,
                         Map<ParameterKey,String> params)
                  throws IOException
Converts an existing file from MathML or ODF to the given type.

Parameters:
inFile - input file.
outFile - 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,
                         Map<ParameterKey,String> params)
                  throws IOException
Converts an existing file from MathML or ODF to the given type.

Parameters:
doc - input document. See DOMBuilder.DOMBuilder(Node, MathBase) for the list of valid node types.
outFile - 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 Dimension convert(Node doc,
                         OutputStream outStream,
                         Map<ParameterKey,String> params)
                  throws IOException
Converts an existing file from MathML or ODF to the given type.

Parameters:
doc - input document. See DOMBuilder.DOMBuilder(Node, MathBase) for the list of valid node types.
outStream - output stream.
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

public BufferedImage render(MathBase base)
                     throws IOException
Renders a document into an image.

Parameters:
base - MathBase containing the MathML document and its rendering parameters.
Returns:
the rendered image
Throws:
IOException - if an I/O error occurred.


Copyright © 2002-2008 The JEuclid project. All Rights Reserved.