#

## Programming with JEuclid

Most information can be found in the JEuclid API Documentation. This document gives a short overview and pointers where to start.

If you program with JEuclid and you need to do more than simple displaying / converting of math, you may be interested in the following

### Converting

- If you need to convert from MathML to any image format, SVG, SVG-DOM, or BufferedImage use the net.sourceforge.jeuclid.converter.Converter class.

### Displaying

AWT

  net.sourceforge.jeuclid.awt.MathComponent

Swing

  net.sourceforge.jeuclid.swing.JMathComponent

SWT

  net.sourceforge.jeuclid.swt.MathView

### JEuclid rendering pipeline

- To parse a String or File into DOM, use net.sourceforge.jeuclid.parser.Parser

- To convert an arbitrary DOM tree into a JEuclid DOM tree use net.sourceforge.jeuclid.DOMBuilder

- You can then create a net.sourceforge.jeuclid.layout.JEuclidView which contains the layout information

- To actually draw the formula, call the JEuclidView#draw(Graphics2D g, float x, float y) method

#### JEuclid DOM Model

The JEuclid DOM Tree conforms to the MathML Document Object Model Java Binding. This means you can (and should) use the methods defined there to modify the internal tree.

#### JEuclid View

The JEuclid view registers for events with the JEuclid DOM model. Changes in the JEuclid DOM are therefore noted in the JEuclidView. This means that subsequent drawing operations will only layout the modified part of the tree, saving rendering time.