jaxe.equations.element
Class MathRootElement

java.lang.Object
  extended by jaxe.equations.element.MathElement
      extended by jaxe.equations.element.MathRootElement

public class MathRootElement
extends MathElement

The root element for creating a MathElement tree

Version:
%I%, %G%
Author:
Stephan Michels, Marco Sielaff

Field Summary
static java.lang.String ATTRIBUTE_MODE
          Attribute name of the mode property
private  boolean debug
           
static int DISPLAY
          Non inline mathematical expression
static java.lang.String ELEMENT
          The XML element from this class
static int INLINE
          Inline mathematical expression
private  int mode
           
 
Fields inherited from class jaxe.equations.element.MathElement
FO_URI, SVG_URI, URI
 
Constructor Summary
MathRootElement()
           
 
Method Summary
 int getAscentHeight(boolean dynamicParts)
          Return the current height of the upper part of this component from the baseline
 int getDescentHeight(boolean dynamicParts)
          Return the current height of the lower part of this component from the baseline
 int getHeight()
          Return the current height of this component
 int getHeight(boolean dynamicParts)
          Return the current height of this component
 int getMode()
          Returns the mode
 int getWidth()
          Return the current width of this component
 int getWidth(boolean dynamicParts)
          Return the current width of this component
 boolean isDebug()
          Indicates, if the debug mode is enabled
 void paint(java.awt.Graphics g)
          Paints this component and all of its elements
 void paint(java.awt.Graphics g, int posX, int posY)
          Paints this component and all of its elements
 void setDebug(boolean debug)
          Enables, or disables the debug mode
 void setMode(int mode)
          Set the type of equation
 
Methods inherited from class jaxe.equations.element.MathElement
addMathElement, addText, debug, getFont, getFontMetrics, getFontSize, getMathBase, getMathElement, getMathElementCount, getMiddleShift, getParent, getSymbolFont, getSymbolFontMetrics, getSymbolGlyphVector, getText, setFontSize, setMathBase, setMathElementAt, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT

public static final java.lang.String ELEMENT
The XML element from this class

See Also:
Constant Field Values

ATTRIBUTE_MODE

public static final java.lang.String ATTRIBUTE_MODE
Attribute name of the mode property

See Also:
Constant Field Values

INLINE

public static final int INLINE
Inline mathematical expression

See Also:
Constant Field Values

DISPLAY

public static final int DISPLAY
Non inline mathematical expression

See Also:
Constant Field Values

mode

private int mode

debug

private boolean debug
Constructor Detail

MathRootElement

public MathRootElement()
Method Detail

setMode

public void setMode(int mode)
Set the type of equation

Parameters:
mode - INLINE|DISPLAY

getMode

public int getMode()
Returns the mode

Returns:
Display mode

setDebug

public void setDebug(boolean debug)
Enables, or disables the debug mode

Parameters:
debug - Debug mode

isDebug

public boolean isDebug()
Indicates, if the debug mode is enabled

Returns:
True, if the debug mode is enabled

paint

public void paint(java.awt.Graphics g)
Paints this component and all of its elements

Parameters:
g - The graphics context to use for painting

getWidth

public int getWidth()
Return the current width of this component

Returns:
Width

getHeight

public int getHeight()
Return the current height of this component

Returns:
Height

paint

public void paint(java.awt.Graphics g,
                  int posX,
                  int posY)
Paints this component and all of its elements

Overrides:
paint in class MathElement
Parameters:
g - The graphics context to use for painting
posX - The first left position for painting
posY - The position of the baseline

getWidth

public int getWidth(boolean dynamicParts)
Return the current width of this component

Overrides:
getWidth in class MathElement
Returns:
Width

getHeight

public int getHeight(boolean dynamicParts)
Return the current height of this component

Overrides:
getHeight in class MathElement
Parameters:
dynamicParts - Should be true, if the calculation consider the elements, which has not fixed sizes
Returns:
Height

getAscentHeight

public int getAscentHeight(boolean dynamicParts)
Return the current height of the upper part of this component from the baseline

Overrides:
getAscentHeight in class MathElement
Parameters:
dynamicParts - Should be true, if the calculation consider the elements, which has not fixed sizes
Returns:
Height of the upper part

getDescentHeight

public int getDescentHeight(boolean dynamicParts)
Return the current height of the lower part of this component from the baseline

Overrides:
getDescentHeight in class MathElement
Parameters:
dynamicParts - Should be true, if the calculation consider the elements, which has not fixed sizes
Returns:
Height of the lower part