001    /*
002     * Copyright 2002 - 2007 JEuclid, http://jeuclid.sf.net
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    /* $Id: Munder.java,v bc1d5fde7b73 2009/06/01 14:40:54 maxberger $ */
018    
019    package net.sourceforge.jeuclid.elements.presentation.script;
020    
021    import net.sourceforge.jeuclid.elements.JEuclidElement;
022    
023    import org.apache.batik.dom.AbstractDocument;
024    import org.w3c.dom.DOMException;
025    import org.w3c.dom.Node;
026    import org.w3c.dom.mathml.MathMLElement;
027    
028    /**
029     * This class arranges an element under an other element.
030     * 
031     * @version $Revision: bc1d5fde7b73 $
032     */
033    public final class Munder extends AbstractUnderOver {
034    
035        /**
036         * The XML element from this class.
037         */
038        public static final String ELEMENT = "munder";
039    
040        private static final long serialVersionUID = 1L;
041    
042        /**
043         * Default constructor. Sets MathML Namespace.
044         * 
045         * @param qname
046         *            Qualified name.
047         * @param odoc
048         *            Owner Document.
049         */
050        public Munder(final String qname, final AbstractDocument odoc) {
051            super(qname, odoc);
052        }
053    
054        /** {@inheritDoc} */
055        @Override
056        protected Node newNode() {
057            return new Munder(this.nodeName, this.ownerDocument);
058        }
059    
060        /** {@inheritDoc} */
061        @Override
062        public JEuclidElement getOverscript() {
063            return null;
064        }
065    
066        /** {@inheritDoc} */
067        @Override
068        public JEuclidElement getUnderscript() {
069            return this.getMathElement(1);
070        }
071    
072        /** {@inheritDoc} */
073        public void setOverscript(final MathMLElement overscript) {
074            throw new DOMException(DOMException.HIERARCHY_REQUEST_ERR,
075                    "munder does not have overscript");
076        }
077    
078        /** {@inheritDoc} */
079        public void setUnderscript(final MathMLElement underscript) {
080            this.setMathElement(1, underscript);
081        }
082    
083    }