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
All Implemented Interfaces:
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, Element, EventTarget, MathMLElement, MathMLPresentationElement, MathMLScriptElement, Node
Direct Known Subclasses:
Msub, Msubsup, Msup

public abstract class AbstractSubSuper extends AbstractScriptElement implements MathMLScriptElement
Generic support for all elements that have a subscript or a superscript attribute.

Supported elements: msub, msup, msubsup.

Version:
$Revision: bc1d5fde7b73 $
See Also:
  • Constructor Details

    • AbstractSubSuper

      public AbstractSubSuper(String qname, org.apache.batik.dom.AbstractDocument odoc)
      Default constructor. Sets MathML Namespace.
      Parameters:
      qname - Qualified name.
      odoc - Owner Document.
  • Method Details

    • getBase

      public abstract JEuclidElement getBase()
      A MathMLElement representing the base of the script. This is the first child of the element.
      Specified by:
      getBase in interface MathMLScriptElement
      Returns:
      value of the base attribute.
    • getSuperscript

      public abstract JEuclidElement getSuperscript()
      A MathMLElement representing the superscript of the script. This is the second child of a msup or the third child of a msubsup; retrieval must return null for an msub.
      Specified by:
      getSuperscript in interface MathMLScriptElement
      Returns:
      value of the superscript attribute.
    • getSubscript

      public abstract JEuclidElement getSubscript()
      A MathMLElement representing the subscript of the script. This is the second child of a msub or msubsup; retrieval must return null for an msup.
      Specified by:
      getSubscript in interface MathMLScriptElement
      Returns:
      value of the subscript attribute.
    • 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:
      hasChildPostscripts in interface JEuclidElement
      Overrides:
      hasChildPostscripts in class AbstractJEuclidElement
      Parameters:
      child - child to test
      context - current layout context.
      Returns:
      true if there are attached postscripts
    • 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:
      layoutStageInvariant in class AbstractJEuclidElement
      Parameters:
      view - View Object for this layout.
      info - An info object which will be filled during layout.
      stage - current layout stage.
      context - current LayoutContext.