1 package JSci.mathml; 2 3 import org.w3c.dom.DOMException ; 4 import org.w3c.dom.mathml.*; 5 6 11 public class MathMLUnderOverElementImpl extends MathMLElementImpl implements MathMLUnderOverElement { 12 15 public MathMLUnderOverElementImpl(MathMLDocumentImpl owner, String qualifiedName) { 16 super(owner, qualifiedName); 17 } 18 19 public String getAccentunder() { 20 if (getLocalName().equals("mover")) { 21 return null; 22 } 23 return getAttribute("accentunder"); 24 } 25 public void setAccentunder(String accentunder) { 26 setAttribute("accentunder", accentunder); 27 } 28 29 public String getAccent() { 30 if (getLocalName().equals("munder")) { 31 return null; 32 } 33 return getAttribute("accent"); 34 } 35 public void setAccent(String accent) { 36 setAttribute("accent", accent); 37 } 38 39 public MathMLElement getBase() { 40 return (MathMLElement) getFirstChild(); 41 } 42 public void setBase(MathMLElement base) { 43 replaceChild(base, getFirstChild()); 44 } 45 46 public MathMLElement getUnderscript() { 47 if (getLocalName().equals("mover")) { 48 return null; 49 } 50 return (MathMLElement) item(1); 51 } 52 public void setUnderscript(MathMLElement underscript) throws DOMException { 53 if (getLocalName().equals("mover")) { 54 throw new DOMException (DOMException.HIERARCHY_REQUEST_ERR, "Cannot set a subscript for msup"); 55 } 56 replaceChild(underscript, item(1)); 57 } 58 59 public MathMLElement getOverscript() { 60 if (getLocalName().equals("munder")) { 61 return null; 62 } 63 if (getLocalName().equals("mover")) { 64 return (MathMLElement) item(1); 65 } else { 66 return (MathMLElement) item(2); 67 } 68 } 69 public void setOverscript(MathMLElement overscript) throws DOMException { 70 if (getLocalName().equals("munder")) { 71 throw new DOMException (DOMException.HIERARCHY_REQUEST_ERR, "Cannot set a superscript for msub"); 72 } 73 if(getLocalName().equals("mover")) { 74 replaceChild(overscript, item(1)); 75 } else { 76 replaceChild(overscript, item(2)); 77 } 78 } 79 } 80 81 | Popular Tags |