FIGUE

MathML Support in Figue

* Figue's main page

* Mathematical Formula Layout in Figue

See the related paper .

* Download Figue version supporting MathML2.0

See the Copyright Notices.

Last version available as a single jar file figue.jar

Source of Figue classes figue.tar.gz

Remember the requirements:

  • you need to have a least JDK1.2 installed properly on your machine
  • you need also to load the XML parser (Xerces Java Parser 1.0.3 xerces.jar)

* How to use Figue to display MathML presentation ?

  • Input : MathML File or MathML String
  • parse the MathML input and give a corresponding MathML Document
  • process and gernerate Figue Facade from the MathML Document

*
Figue module for importing and processing the MathML

* Example of MathML display by using Figue (Step by Step)

* The Whole Program

Import the usual figue packages.
import figue.*;
import figue.box.*;
import figue.resource.*;
import figue.io.xml.Utility;
 
Import the xerces java parser packag
import org.apache.xerces.parsers.DOMParser;
import org.xml.sax.SAXException; 
import org.w3c.dom.Document; 
Import the java package
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.lang.reflect.*;
import java.io.IOException;
Create a xerces java parser
          try {
            parser = new org.apache.xerces.parsers.DOMParser();
            // specifying validation
            boolean validate = true;
            parser.setFeature("http://xml.org/sax/features/validation", validate);
            boolean nameSpaceProcessing = true;
            parser.setFeature("http://xml.org/sax/features/namespaces", nameSpaceProcessing);         
        }
        catch (SAXException  e ) {
            e.printStackTrace();
        }
Create a Figue facade and init the resources for it (font, color ...)
  
        _facade = new AWTFacade();
        initResources();
Get the edited MathML text and parse it afterwards. We have a three different forms of input data of
String text = textArea.getText();
try {
doc=Utility.xercesParseXMLStringReader(text,"/net/home/hnaciri/THESE/implementation/test_figue/dtd/dtdMathML/mmlents/mathml.dtd",parser);
}
catch (SAXException  e) {
e.printStackTrace();
}  
catch (IOException e) {
e.printStackTrace(); 
}
Build a FIGUE facade from MathML Element
Utility.buildFacade( _facade, doc.getDocumentElement(),"MathML"); 

Display a facade
    _facade.buildInit(null); 
    _facade.buildComplete();   

*My home page