001 /* 002 * Copyright 2007 - 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: Mpadded.java,v 2986a8eeaebc 2009/09/24 12:53:08 max $ */ 018 019 package net.sourceforge.jeuclid.elements.presentation.general; 020 021 import net.sourceforge.jeuclid.elements.presentation.AbstractContainer; 022 023 import org.apache.batik.dom.AbstractDocument; 024 import org.w3c.dom.Node; 025 import org.w3c.dom.mathml.MathMLPaddedElement; 026 027 /** 028 * This class implements the mpadded element. 029 * <p> 030 * TODO: none of the attributes are actually implemented yet. 031 * 032 * @version $Revision: 2986a8eeaebc $ 033 */ 034 public final class Mpadded extends AbstractContainer implements 035 MathMLPaddedElement { 036 037 /** constant for depth attribute. */ 038 public static final String ATTR_DEPTH = "depth"; 039 040 /** constant for height attribute. */ 041 public static final String ATTR_HEIGHT = "height"; 042 043 /** constant for lspace attribute. */ 044 public static final String ATTR_LSPACE = "lspace"; 045 046 /** constant for width attribute. */ 047 public static final String ATTR_WIDTH = "width"; 048 049 /** 050 * The MathML element name for this class. 051 */ 052 public static final String ELEMENT = "mpadded"; 053 054 private static final long serialVersionUID = 1L; 055 056 /** 057 * Default constructor. Sets MathML Namespace. 058 * 059 * @param qname 060 * Qualified name. 061 * @param odoc 062 * Owner Document. 063 */ 064 public Mpadded(final String qname, final AbstractDocument odoc) { 065 super(qname, odoc); 066 } 067 068 /** {@inheritDoc} */ 069 @Override 070 protected Node newNode() { 071 return new Mpadded(this.nodeName, this.ownerDocument); 072 } 073 074 /** {@inheritDoc} */ 075 public String getDepth() { 076 return this.getMathAttribute(Mpadded.ATTR_DEPTH); 077 } 078 079 /** {@inheritDoc} */ 080 public String getHeight() { 081 return this.getMathAttribute(Mpadded.ATTR_HEIGHT); 082 } 083 084 /** {@inheritDoc} */ 085 public String getLspace() { 086 return this.getMathAttribute(Mpadded.ATTR_LSPACE); 087 } 088 089 /** {@inheritDoc} */ 090 public String getWidth() { 091 return this.getMathAttribute(Mpadded.ATTR_WIDTH); 092 } 093 094 /** {@inheritDoc} */ 095 public void setDepth(final String depth) { 096 this.setAttribute(Mpadded.ATTR_DEPTH, depth); 097 } 098 099 /** {@inheritDoc} */ 100 public void setHeight(final String height) { 101 this.setAttribute(Mpadded.ATTR_HEIGHT, height); 102 } 103 104 /** {@inheritDoc} */ 105 public void setLspace(final String lspace) { 106 this.setAttribute(Mpadded.ATTR_LSPACE, lspace); 107 } 108 109 /** {@inheritDoc} */ 110 public void setWidth(final String width) { 111 this.setAttribute(Mpadded.ATTR_WIDTH, width); 112 } 113 114 }