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: Merror.java,v bc1d5fde7b73 2009/06/01 14:40:54 maxberger $ */ 018 019 package net.sourceforge.jeuclid.elements.presentation.general; 020 021 import java.awt.Color; 022 023 import net.sourceforge.jeuclid.LayoutContext; 024 import net.sourceforge.jeuclid.context.StyleAttributeLayoutContext; 025 import net.sourceforge.jeuclid.elements.presentation.AbstractContainer; 026 027 import org.apache.batik.dom.AbstractDocument; 028 import org.w3c.dom.Node; 029 030 /** 031 * Represents an merror element. 032 * 033 * @version $Revision: bc1d5fde7b73 $ 034 */ 035 public final class Merror extends AbstractContainer { 036 037 /** 038 * The XML element from this class. 039 */ 040 public static final String ELEMENT = "merror"; 041 042 private static final long serialVersionUID = 1L; 043 044 /** 045 * Default constructor. Sets MathML Namespace. 046 * 047 * @param qname 048 * Qualified name. 049 * @param odoc 050 * Owner Document. 051 */ 052 public Merror(final String qname, final AbstractDocument odoc) { 053 super(qname, odoc); 054 } 055 056 /** {@inheritDoc} */ 057 @Override 058 protected Node newNode() { 059 return new Merror(this.nodeName, this.ownerDocument); 060 } 061 062 /** {@inheritDoc} */ 063 @Override 064 public LayoutContext applyLocalAttributesToContext( 065 final LayoutContext context) { 066 return super 067 .applyLocalAttributesToContext(new StyleAttributeLayoutContext( 068 context, null, Color.RED)); 069 } 070 }