Class Mmultiscripts
- java.lang.Object
-
- org.apache.batik.dom.AbstractNode
-
- org.apache.batik.dom.AbstractParentNode
-
- org.apache.batik.dom.AbstractParentChildNode
-
- org.apache.batik.dom.AbstractElement
-
- org.apache.batik.dom.AbstractElementNS
-
- org.apache.batik.dom.GenericElementNS
-
- net.sourceforge.jeuclid.elements.AbstractJEuclidElement
-
- net.sourceforge.jeuclid.elements.presentation.script.AbstractScriptElement
-
- net.sourceforge.jeuclid.elements.presentation.script.Mmultiscripts
-
- All Implemented Interfaces:
java.io.Serializable,JEuclidElement,JEuclidNode,LayoutableNode,org.apache.batik.dom.events.NodeEventTarget,org.apache.batik.dom.ExtendedNode,org.apache.batik.dom.xbl.NodeXBL,org.apache.batik.dom.xbl.XBLManagerData,org.apache.batik.w3c.dom.ElementTraversal,org.w3c.dom.Element,org.w3c.dom.events.EventTarget,MathMLElement,MathMLMultiScriptsElement,MathMLPresentationElement,org.w3c.dom.Node
public final class Mmultiscripts extends AbstractScriptElement implements MathMLMultiScriptsElement
Prescripts and Tensor Indices.- Version:
- $Revision: 9af8f7182adc $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringELEMENTThe XML element from this class.-
Fields inherited from class net.sourceforge.jeuclid.elements.presentation.script.AbstractScriptElement
ATTR_SUBSCRIPTSHIFT, ATTR_SUPERSCRIPTSHIFT
-
Fields inherited from class net.sourceforge.jeuclid.elements.AbstractJEuclidElement
ATTR_CLASS, ATTR_DEPRECATED_BACKGROUND, ATTR_DEPRECATED_COLOR, ATTR_DEPRECATED_FONTFAMILY, ATTR_DEPRECATED_FONTSIZE, ATTR_DEPRECATED_FONTSTYLE, ATTR_DEPRECATED_FONTWEIGHT, ATTR_HREF, ATTR_ID, ATTR_MATHBACKGROUND, ATTR_MATHCOLOR, ATTR_MATHSIZE, ATTR_MATHVARIANT, ATTR_STYLE, ATTR_XREF, TRIVIAL_SPACE_MAX, URI
-
Fields inherited from class org.apache.batik.dom.AbstractParentChildNode
nextSibling, parentNode, previousSibling
-
Fields inherited from class org.apache.batik.dom.AbstractNode
DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, EMPTY_NODE_LIST, eventSupport, managerData, ownerDocument, userData, userDataHandlers
-
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
-
Constructor Summary
Constructors Constructor Description Mmultiscripts(java.lang.String qname, org.apache.batik.dom.AbstractDocument odoc)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeHook()Override this function to get notified whenever the contents of this element have changed.JEuclidElementgetBase()A MathMLElement representing the base of the script.intgetNumprescriptcolumns()The number of script/subscript columns preceding (to the left of) the base.intgetNumscriptcolumns()The number of script/subscript columns following (to the right of) the base.MathMLNodeListgetPrescripts()A NodeList representing the prescripts of the script, which appear in the order described by the expression (prescript presuperscript)*.MathMLElementgetPreSubScript(int colIndex)A convenience method to retrieve pre-subscript children of the element, referenced by column index .MathMLElementgetPreSuperScript(int colIndex)A convenience method to retrieve pre-superscript children of the element, referenced by column index .MathMLNodeListgetScripts()A MathMLNodeList representing the scripts of the script, which appear in the order described by the expression (script superscript)*.MathMLElementgetSubScript(int colIndex)A convenience method to retrieve subscript children of the element, referenced by column index.MathMLElementgetSuperScript(int colIndex)A convenience method to retrieve superscript children of the element, referenced by column index .booleanhasChildPostscripts(JEuclidElement child, LayoutContext context)returns true is the child has postscripts attached to it.booleanhasChildPrescripts(JEuclidElement child)returns true is the child has prescripts attached to it.MathMLElementinsertPreSubScriptBefore(int colIndex, MathMLElement newScript)A convenience method to insert a pre-subscript before the position referenced by column index.MathMLElementinsertPreSuperScriptBefore(int colIndex, MathMLElement newScript)A convenience method to insert a pre-superscript before the position referenced by column index.MathMLElementinsertSubScriptBefore(int colIndex, MathMLElement newScript)A convenience method to insert a subscript before the position referenced by column index.MathMLElementinsertSuperScriptBefore(int colIndex, MathMLElement newScript)A convenience method to insert a superscript before the position referenced by column index.protected voidlayoutStageInvariant(LayoutView view, LayoutInfo info, LayoutStage stage, LayoutContext context)Layout for elements which are stage independent.protected org.w3c.dom.NodenewNode()voidsetBase(MathMLElement base)setter for the base attribute.MathMLElementsetPreSubScriptAt(int colIndex, MathMLElement newScript)A convenience method to set the pre-subscript child at the position referenced by colIndex.MathMLElementsetPreSuperScriptAt(int colIndex, MathMLElement newScript)A convenience method to set the pre-superscript child at the position referenced by colIndex.MathMLElementsetSubScriptAt(int colIndex, MathMLElement newScript)A convenience method to set the subscript child at the position referenced by colIndex.MathMLElementsetSuperScriptAt(int colIndex, MathMLElement newScript)A convenience method to set the superscript child at the position referenced by colIndex.-
Methods inherited from class net.sourceforge.jeuclid.elements.presentation.script.AbstractScriptElement
getChildLayoutContext, getSubscriptshift, getSuperscriptshift, setSubscriptshift, setSuperscriptshift
-
Methods inherited from class net.sourceforge.jeuclid.elements.AbstractJEuclidElement
addMathElement, applyLocalAttributesToContext, dispatchEvent, getChildrenToDraw, getChildrenToLayout, getClassName, getContents, getFont, getFontMetrics, getHref, getId, getIndexOfMathElement, getMathAttribute, getMathAttribute, getMathbackground, getMathcolor, getMathElement, getMathElementCount, getMathElementStyle, getMathsize, getMathvariant, getMathvariantAsVariant, getMiddleShift, getOwnerMathElement, getParent, getText, getXref, layoutStage1, layoutStage2, setClassName, setDefaultMathAttribute, setFakeParent, setHref, setId, setMathbackground, setMathcolor, setMathElement, setMathElementStyle, setMathsize, setMathvariant, setXref
-
Methods inherited from class org.apache.batik.dom.GenericElementNS
copyInto, deepCopyInto, deepExport, export, getNodeName, isReadonly, setNodeName, setReadonly
-
Methods inherited from class org.apache.batik.dom.AbstractElement
attrAdded, attrModified, attrRemoved, checkChildType, createAttributes, fireDOMAttrModifiedEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getFirstElementChild, getIdAttribute, getLastElementChild, getNextElementSibling, getNodeType, getPreviousElementSibling, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, hasAttributes, nodeAdded, nodeToBeRemoved, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
-
Methods inherited from class org.apache.batik.dom.AbstractParentChildNode
getNextSibling, getParentNode, getPreviousSibling, setNextSibling, setParentNode, setPreviousSibling
-
Methods inherited from class org.apache.batik.dom.AbstractParentNode
appendChild, checkAndRemove, fireDOMNodeInsertedEvent, fireDOMNodeInsertedIntoDocumentEvent, fireDOMNodeRemovedEvent, fireDOMNodeRemovedFromDocumentEvent, fireDOMSubtreeModifiedEvent, getChildNodes, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, getTextContent, hasChildNodes, insertBefore, removeChild, replaceChild
-
Methods inherited from class org.apache.batik.dom.AbstractNode
addEventListener, addEventListenerNS, cloneNode, compareDocumentPosition, compareNamedNodeMaps, compareStrings, createDOMException, fireDOMCharacterDataModifiedEvent, fireUserDataHandlers, getBaseURI, getBaseURI, getCascadedXMLBase, getCurrentDocument, getEventSupport, getFeature, getLocalName, getManagerData, getNodeValue, getOwnerDocument, getParentNodeEventTarget, getPrefix, getUserData, getXblBoundElement, getXblChildNodes, getXblDefinitions, getXblFirstChild, getXblFirstElementChild, getXblLastChild, getXblLastElementChild, getXblNextElementSibling, getXblNextSibling, getXblParentNode, getXblPreviousElementSibling, getXblPreviousSibling, getXblScopedChildNodes, getXblShadowTree, hasEventListenerNS, initializeEventSupport, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, removeEventListener, removeEventListenerNS, setManagerData, setNodeValue, setOwnerDocument, setPrefix, setSpecified, setTextContent, setUserData, willTriggerNS
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
-
Methods inherited from interface org.w3c.dom.mathml.MathMLElement
getClassName, getHref, getId, getMathElementStyle, getOwnerMathElement, getXref, setClassName, setHref, setId, setMathElementStyle, setXref
-
Methods inherited from interface org.w3c.dom.mathml.MathMLMultiScriptsElement
getSubscriptshift, getSuperscriptshift, setSubscriptshift, setSuperscriptshift
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
The XML element from this class.- See Also:
- Constant Field Values
-
-
Method Detail
-
newNode
protected org.w3c.dom.Node newNode()
- Overrides:
newNodein classorg.apache.batik.dom.GenericElementNS
-
changeHook
public void changeHook()
Override this function to get notified whenever the contents of this element have changed.- Overrides:
changeHookin classAbstractJEuclidElement
-
layoutStageInvariant
protected void layoutStageInvariant(LayoutView view, LayoutInfo info, LayoutStage stage, LayoutContext context)
Layout for elements which are stage independent.This function will layout an element which is layed out the same no matter what stage it is in. This is the case for most elements.
Notable exceptions are mo and tables.
- Overrides:
layoutStageInvariantin classAbstractJEuclidElement- Parameters:
view- View Object for this layout.info- An info object which will be filled during layout.stage- current layout stage.context- current LayoutContext.
-
hasChildPrescripts
public boolean hasChildPrescripts(JEuclidElement child)
returns true is the child has prescripts attached to it. In this case, there should be no extra space on the left.- Specified by:
hasChildPrescriptsin interfaceJEuclidElement- Overrides:
hasChildPrescriptsin classAbstractJEuclidElement- Parameters:
child- child to test- Returns:
- true if there are attached prescripts
-
hasChildPostscripts
public boolean hasChildPostscripts(JEuclidElement child, LayoutContext context)
returns true is the child has postscripts attached to it. In this case, there should be no extra space on the left.- Specified by:
hasChildPostscriptsin interfaceJEuclidElement- Overrides:
hasChildPostscriptsin classAbstractJEuclidElement- Parameters:
child- child to testcontext- current layout context.- Returns:
- true if there are attached postscripts
-
getBase
public JEuclidElement getBase()
A MathMLElement representing the base of the script. This is the first child of the element.- Specified by:
getBasein interfaceMathMLMultiScriptsElement- Returns:
- value of the base attribute.
-
setBase
public void setBase(MathMLElement base)
setter for the base attribute.- Specified by:
setBasein interfaceMathMLMultiScriptsElement- Parameters:
base- new value for base.- See Also:
MathMLMultiScriptsElement.getBase()
-
getNumprescriptcolumns
public int getNumprescriptcolumns()
The number of script/subscript columns preceding (to the left of) the base. Should always be half of getprescripts().length()- Specified by:
getNumprescriptcolumnsin interfaceMathMLMultiScriptsElement- Returns:
- value of the numprescriptcolumns attribute.
-
getNumscriptcolumns
public int getNumscriptcolumns()
The number of script/subscript columns following (to the right of) the base. Should always be half of getscripts().length()- Specified by:
getNumscriptcolumnsin interfaceMathMLMultiScriptsElement- Returns:
- value of the numscriptcolumns attribute.
-
getPreSubScript
public MathMLElement getPreSubScript(int colIndex)
A convenience method to retrieve pre-subscript children of the element, referenced by column index .- Specified by:
getPreSubScriptin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of prescript (where 1 represents the leftmost prescript column).- Returns:
- Returns the MathMLElement representing the colIndex-th presubscript (to the left of the base, counting from 1 at the far left). Note that this may be the MathMLElement corresponding to the special element none in the case of a missing presubscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.
-
getPreSuperScript
public MathMLElement getPreSuperScript(int colIndex)
A convenience method to retrieve pre-superscript children of the element, referenced by column index .- Specified by:
getPreSuperScriptin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of pre-superscript (where 1 represents the leftmost prescript column).- Returns:
- Returns the MathMLElement representing the colIndex-th presuperscript (to the left of the base, counting from 1 at the far left). Note that this may be the MathMLElement corresponding to the special element none in the case of a missing presuperscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.
-
getPrescripts
public MathMLNodeList getPrescripts()
A NodeList representing the prescripts of the script, which appear in the order described by the expression (prescript presuperscript)*. This is the same as traversing the contents of the NodeList returned by Node::childNodes() from the Node following the mprescripts (if present) to the end of the list.- Specified by:
getPrescriptsin interfaceMathMLMultiScriptsElement- Returns:
- value of the prescripts attribute.
-
getScripts
public MathMLNodeList getScripts()
A MathMLNodeList representing the scripts of the script, which appear in the order described by the expression (script superscript)*. This is the same as traversing the contents of the NodeList returned by Node::childNodes() from the first Node up to and including the Node preceding the mprescripts (if present).- Specified by:
getScriptsin interfaceMathMLMultiScriptsElement- Returns:
- value of the scripts attribute.
-
getSubScript
public MathMLElement getSubScript(int colIndex)
A convenience method to retrieve subscript children of the element, referenced by column index.- Specified by:
getSubScriptin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of script (where 1 represents the leftmost script column, the first to the right of the base).- Returns:
- Returns the MathMLElement representing the colIndex-th subscript to the right of the base. Note that this may be the MathMLElement corresponding to the special element none in the case of a missing subscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.
-
getSuperScript
public MathMLElement getSuperScript(int colIndex)
A convenience method to retrieve superscript children of the element, referenced by column index .- Specified by:
getSuperScriptin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of script (where 1 represents the leftmost script column, the first to the right of the base)- Returns:
- Returns the MathMLElement representing the colIndex-th superscript to the right of the base. Note that this may be the MathMLElement corresponding to the special element none in the case of a missing superscript (see the discussion of mmultiscripts), or it may be null if colIndex is out of range for the element.
-
insertPreSubScriptBefore
public MathMLElement insertPreSubScriptBefore(int colIndex, MathMLElement newScript)
A convenience method to insert a pre-subscript before the position referenced by column index. If colIndex is 0, the new pre-subscript is appended as the last pre-subscript of the mmultiscripts element; if colIndex is 1, a new pre-subscript is prepended at the far left. Note that inserting a new pre-subscript will cause the insertion of an empty pre-superscript in the same column.- Specified by:
insertPreSubScriptBeforein interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of pre-subscript (where 1 represents the leftmost prescript column).newScript- A MathMLElement representing the element to be inserted as a pre-subscript.- Returns:
- The MathMLElement child of this MathMLMultiScriptsElement representing the new script in the DOM.
-
insertPreSuperScriptBefore
public MathMLElement insertPreSuperScriptBefore(int colIndex, MathMLElement newScript)
A convenience method to insert a pre-superscript before the position referenced by column index. If colIndex is 0, the new pre-superscript is appended as the last pre-superscript of the mmultiscripts element; if colIndex is 1, a new pre-superscript is prepended at the far left. Note that inserting a new pre-superscript will cause the insertion of an empty pre-subscript in the same column.- Specified by:
insertPreSuperScriptBeforein interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of pre-superscript (where 1 represents the leftmost prescript column).newScript- A MathMLElement representing the element to be inserted as a pre-superscript.- Returns:
- The MathMLElement child of this element that represents the new pre-superscript in the DOM.
-
insertSubScriptBefore
public MathMLElement insertSubScriptBefore(int colIndex, MathMLElement newScript)
A convenience method to insert a subscript before the position referenced by column index. If colIndex is 0, the new subscript is appended as the last subscript of the mmultiscripts element; if colIndex is 1, a new subscript is prepended at the far left. Note that inserting a new subscript will cause the insertion of an empty superscript in the same column.- Specified by:
insertSubScriptBeforein interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of subscript, where 1 represents the leftmost script column (the first to the right of the base).newScript- A MathMLElement representing the element to be inserted as a subscript.- Returns:
- The MathMLElement child of this MathMLMultiScriptsElement that represents the new subscript in the DOM.
-
insertSuperScriptBefore
public MathMLElement insertSuperScriptBefore(int colIndex, MathMLElement newScript)
A convenience method to insert a superscript before the position referenced by column index. If colIndex is 0, the new superscript is appended as the last superscript of the mmultiscripts element; if colIndex is 1, a new superscript is prepended at the far left. Note that inserting a new superscript will cause the insertion of an empty subscript in the same column.- Specified by:
insertSuperScriptBeforein interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of superscript, where 1 represents the leftmost script column (the first to the right of the base).newScript- A MathMLElement representing the element to be inserted as a superscript.- Returns:
- The MathMLElement child of this element that represents the new superscript in the DOM.
-
setPreSubScriptAt
public MathMLElement setPreSubScriptAt(int colIndex, MathMLElement newScript)
A convenience method to set the pre-subscript child at the position referenced by colIndex. If there is currently a pre-subscript at this position, it is replaced by newScript.- Specified by:
setPreSubScriptAtin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of pre-subscript (where 1 represents the leftmost prescript column).newScript- MathMLElement representing the element that is to be set as the colIndex-th pre-subscript child of this element.- Returns:
- The MathMLElement child of this MathMLMultiScriptsElement representing the new pre-subscript in the DOM.
-
setPreSuperScriptAt
public MathMLElement setPreSuperScriptAt(int colIndex, MathMLElement newScript)
A convenience method to set the pre-superscript child at the position referenced by colIndex. If there is currently a pre-superscript at this position, it is replaced by newScript.- Specified by:
setPreSuperScriptAtin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of pre-superscript (where 1 represents the leftmost prescript column).newScript- MathMLElement representing the element that is to be set as the colIndex-th pre-superscript child of this element.- Returns:
- The MathMLElement child of this element that represents the new pre-superscript in the DOM.
-
setSubScriptAt
public MathMLElement setSubScriptAt(int colIndex, MathMLElement newScript)
A convenience method to set the subscript child at the position referenced by colIndex. If there is currently a subscript at this position, it is replaced by newScript.- Specified by:
setSubScriptAtin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of subscript, where 1 represents the leftmost script column (the first to the right of the base).newScript- MathMLElement representing the element that is to be set as the colIndex-th subscript child of this element.- Returns:
- The MathMLElement child of this element representing the new subscript in the DOM.
-
setSuperScriptAt
public MathMLElement setSuperScriptAt(int colIndex, MathMLElement newScript)
A convenience method to set the superscript child at the position referenced by colIndex. If there is currently a superscript at this position, it is replaced by newScript.- Specified by:
setSuperScriptAtin interfaceMathMLMultiScriptsElement- Parameters:
colIndex- Column index of superscript, where 1 represents the leftmost script column (the first to the right of the base).newScript- MathMLElement representing the element that is to be set as the colIndex-th superscript child of this element.- Returns:
- The MathMLElement child of this element that represents the new superscript in the DOM.
-
-