It refers to the process of handling user actions when he goes through the process of creating equations . It also involves guiding the user through the process of creating mathematical expressions. To generate MathML when the user is done with equation creation, the list of user actions needs to be tracked for dynamic MathML generation.
Equation elements
Operators , operands, superscripts, subscripts, special math symbols(Square root,integral,limits),underover,matrix,fence(brackets.)
Pre-requisites
· Current Container
Refers to the current display object which has focus.(i.e. The user has clicked on a particular display object to which the equation is going to be added).The current container acts as a pre parent to the math equation that the user might type. Before equation creation the current container holds the super parent container which is the parent to all math expressions.
· Counter Id
As and when the user adds math elements into the drawing board, an ID is assigned to the particular math element .Global data keeps a counter of the entire Id’s assigned at any point in the equation creation.
· Math Table
An array of user defined objects called math node.
· Math Node
An object which uniquely defines a math object in the equation.
Attributes of Math Node
Nodeid : The globally assigned identifier
ParentId : The identifier of the parent math node which holds this node.
Node Name : The name which specifies what type of math node it is. The
name corresponds to the MathML tag which describes .
For e.g.: mo for operators ,
mi for operands,
mn for constants,
msup for superscripts
Node Text : The text of the node. Applicable only for mn, mo,mi.
Attributes : Properties of math elements like fontsize, style, thickness etc.
EVENT HANDLING FOR SUPERSCRIPTS AND SUBSCRIPTS
Description :
Superscript in MathML takes two mathnodes as their children. The base and the exponent. The global data assigns identifier to the superscript node which is an imaginary node, which exists just to hold the two children but has no physical rendering.
MathNode :
![]()
<msup><Id><ParentID of Current Container><null>
Implementation in Flex:
A mathematical component is drawn on the Canvas Container
that Flex offers.here are two alternatives to this.
1) Draw using a UIComponent and its graphics method.
<shape>.<uicomponent>.<graphics>.drawline(//)
How ever this method is tedious when it involves the calculation of appropriate coordinates(For Eg.In superscript,The x cood is increment by the width of the base ..and the Y coor is incremented by the height of base.and then decremented again to lie on the axis of the equation line.
Usage of lex components like HBox and VBox takes care of all these.(Esp Layout).
- Superscript Box Structure :WYSIWYG EDITOR
- Superscript in Flex

