Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jaxe.equations.element
Class MathElement  view MathElement download MathElement.java

java.lang.Object
  extended byjaxe.equations.element.MathElement
Direct Known Subclasses:
MathFrac, MathOperator, MathOver, MathPhantom, MathRoot, MathRootElement, MathRow, MathSqrt, MathSub, MathSubSup, MathSup, MathTable, MathTableData, MathTableRow, MathText, MathUnder, MathUnderOver

public class MathElement
extends java.lang.Object

The basic class the the math elements. From this class elements inherits.

Version:
1.5

Field Summary
private  jaxe.equations.MathBase base
           
private  java.util.Vector childs
           
static java.lang.String FO_URI
          The URI from FO
private  int fontsize
           
private  MathElement parent
           
static java.lang.String SVG_URI
          The URI from SVG
private  java.lang.StringBuffer text
           
static java.lang.String URI
          The URI from MathML
 
Constructor Summary
MathElement()
          Creates a math element
MathElement(jaxe.equations.MathBase base)
          Creates a math element
MathElement(jaxe.equations.MathBase base, int fontsize)
          Creates a math element
 
Method Summary
 void addMathElement(MathElement child)
          Add a math element as a child
 void addText(java.lang.String text)
          Add the content of a String to this element
 void debug(java.awt.Graphics g, int posX, int posY)
          Paints a border around this element as debug information
 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
 java.awt.Font getFont()
          Gets the used font
 java.awt.FontMetrics getFontMetrics()
          Gets the font metrics of the used font
 int getFontSize()
          Gets the used font size
 int getHeight(boolean dynamicParts)
          Return the current height of this element
 jaxe.equations.MathBase getMathBase()
          Gets the math base
 MathElement getMathElement(int index)
          Gets a child from this element
 int getMathElementCount()
          Returns the count of childs from this element
protected  int getMiddleShift()
          Returns the distance of the baseline and the middleline
 MathElement getParent()
          Returns get parent of this element
 int getRealHeight(java.awt.Graphics g, boolean dynamicParts)
           
 java.awt.Font getSymbolFont()
          Gets the used symbol font size
 java.awt.FontMetrics getSymbolFontMetrics()
          Gets the font metrics of the used symbol font
 java.awt.font.GlyphVector getSymbolGlyphVector(java.awt.Graphics2D g2d, char c)
          Get a glyph vector of the symbol font
 java.lang.String getText()
          Returns the text contentof this element
 int getWidth(boolean dynamicParts)
          Return the current width of this element
 void paint(java.awt.Graphics g, int posX, int posY)
          Paints this element
 void setFontSize(int fontsize)
          Sets the font size for this component
 void setMathBase(jaxe.equations.MathBase base)
          Sets the base for this element
 void setParent(MathElement parent)
          Sets the parent of this element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URI

public static final java.lang.String URI
The URI from MathML

See Also:
Constant Field Values

SVG_URI

public static final java.lang.String SVG_URI
The URI from SVG

See Also:
Constant Field Values

FO_URI

public static final java.lang.String FO_URI
The URI from FO

See Also:
Constant Field Values

base

private jaxe.equations.MathBase base

parent

private MathElement parent

fontsize

private int fontsize

childs

private java.util.Vector childs

text

private java.lang.StringBuffer text
Constructor Detail

MathElement

public MathElement(jaxe.equations.MathBase base,
                   int fontsize)
Creates a math element


MathElement

public MathElement(jaxe.equations.MathBase base)
Creates a math element


MathElement

public MathElement()
Creates a math element

Method Detail

addMathElement

public void addMathElement(MathElement child)
Add a math element as a child


getMathElement

public MathElement getMathElement(int index)
Gets a child from this element


getMathElementCount

public int getMathElementCount()
Returns the count of childs from this element


addText

public void addText(java.lang.String text)
Add the content of a String to this element


getText

public java.lang.String getText()
Returns the text contentof this element


setMathBase

public void setMathBase(jaxe.equations.MathBase base)
Sets the base for this element


getMathBase

public jaxe.equations.MathBase getMathBase()
Gets the math base


setParent

public void setParent(MathElement parent)
Sets the parent of this element


getParent

public MathElement getParent()
Returns get parent of this element


setFontSize

public void setFontSize(int fontsize)
Sets the font size for this component


getFontSize

public int getFontSize()
Gets the used font size


getFont

public java.awt.Font getFont()
Gets the used font


getFontMetrics

public java.awt.FontMetrics getFontMetrics()
Gets the font metrics of the used font


getSymbolFont

public java.awt.Font getSymbolFont()
Gets the used symbol font size


getSymbolFontMetrics

public java.awt.FontMetrics getSymbolFontMetrics()
Gets the font metrics of the used symbol font


getSymbolGlyphVector

public java.awt.font.GlyphVector getSymbolGlyphVector(java.awt.Graphics2D g2d,
                                                      char c)
Get a glyph vector of the symbol font


debug

public void debug(java.awt.Graphics g,
                  int posX,
                  int posY)
Paints a border around this element as debug information


paint

public void paint(java.awt.Graphics g,
                  int posX,
                  int posY)
Paints this element


getWidth

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


getHeight

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


getRealHeight

public int getRealHeight(java.awt.Graphics g,
                         boolean dynamicParts)

getAscentHeight

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


getDescentHeight

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


getMiddleShift

protected int getMiddleShift()
Returns the distance of the baseline and the middleline