|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jeuclid.MathBase
public class MathBase
Keeps a MathML Tree and its Rendering attributes.
This is the main class for MathML handling. It stores a MathML Tree and its rendering attributes.
To obtain a renderable MathML tree, create an instance of this class, and
fill its tree with the help of DOMBuilder.
| Field Summary | |
|---|---|
static float |
DEFAULT_FONTSIZE
Default font size. |
static int |
DISPLAY
Non inline mathematical expression. |
static String |
FALSE
Constant for string "false". |
static int |
INLINE
Inline mathematical expression. |
static String |
TRUE
Constant for string "true". |
static String |
VALUE_ZERO
Constant for zero-value (0). |
| Constructor Summary | |
|---|---|
MathBase(Map<ParameterKey,String> params)
Default constructor. |
|
| Method Summary | |
|---|---|
float |
getAscender(Graphics2D g)
Gets the height of the ascender. |
static Map<ParameterKey,String> |
getDefaultParameters()
Provides a reasonable set of default parameters. |
float |
getDescender(Graphics2D g)
Returns the height of the descender. |
float |
getFontSize()
|
float |
getHeight(Graphics2D g)
Return the current height of this component. |
Map<ParameterKey,String> |
getParams()
Retrieves the current set of parametes. |
DocumentElement |
getRootElement()
|
float |
getWidth(Graphics2D g)
Return the current width of this component. |
boolean |
isDebug()
Indicates, weither the debug mode is enabled. |
void |
paint(Graphics2D g)
Paints the componet and all of its elements into the top-right corner. |
void |
paint(Graphics2D g,
float x,
float y)
Paints this component and all of its elements. |
void |
setDebug(boolean debug)
Enables, or disables the debug mode. |
void |
setParam(ParameterKey key,
String value)
Sets a rendering parameter. |
void |
setRootElement(DocumentElement element)
Set the root element of a math tree. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int INLINE
public static final int DISPLAY
public static final float DEFAULT_FONTSIZE
public static final String TRUE
public static final String FALSE
public static final String VALUE_ZERO
| Constructor Detail |
|---|
public MathBase(Map<ParameterKey,String> params)
Allocates a new MathBase with the given rendering parameters. You may
use getDefaultParameters() to obtain a default set of
rendering parameters.
The root element will initially be empty. You may use
DOMBuilder or SAXBuilder to fill it.
params - Rendering parameters.ParameterKey,
getDefaultParameters()| Method Detail |
|---|
public float getAscender(Graphics2D g)
g - Graphics2D context to use.
public float getDescender(Graphics2D g)
g - Graphics2D context to use.
public void setRootElement(DocumentElement element)
element - Root element of a math treepublic DocumentElement getRootElement()
public void setDebug(boolean debug)
debug - Debug mode flag.public boolean isDebug()
public void paint(Graphics2D g,
float x,
float y)
g - The graphics context to use for painting.x - x-offsety - y-offsetpublic void paint(Graphics2D g)
g - The graphics context to use for painting.paint(Graphics2D, float, float)public float getWidth(Graphics2D g)
g - Graphics2D context to use.
public float getHeight(Graphics2D g)
g - Graphics2D context to use.
public float getFontSize()
public Map<ParameterKey,String> getParams()
Please note that it is not recommended to change any of these
parameters, but rather to use setParam(ParameterKey, String)
instead.
public void setParam(ParameterKey key,
String value)
key - Key of the rendering parameter.value - new value.public static Map<ParameterKey,String> getDefaultParameters()
MathBase(Map)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||