KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > dom > svg > SVGOMAltGlyphElement


1 /*
2
3    Copyright 2001-2004 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.dom.svg;
19
20 import org.apache.batik.dom.AbstractDocument;
21 import org.apache.batik.dom.util.XLinkSupport;
22 import org.apache.batik.dom.util.XMLSupport;
23 import org.w3c.dom.DOMException JavaDoc;
24 import org.w3c.dom.Node JavaDoc;
25 import org.w3c.dom.svg.SVGAltGlyphElement;
26
27 /**
28  * This class implements {@link SVGAltGlyphElement}.
29  *
30  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
31  * @version $Id: SVGOMAltGlyphElement.java,v 1.6 2004/08/18 07:13:14 vhardy Exp $
32  */

33 public class SVGOMAltGlyphElement
34     extends SVGURIReferenceTextPositioningElement
35     implements SVGAltGlyphElement {
36
37     /**
38      * The attribute initializer.
39      */

40     protected final static AttributeInitializer attributeInitializer;
41     static {
42         attributeInitializer = new AttributeInitializer(4);
43         attributeInitializer.addAttribute(XMLSupport.XMLNS_NAMESPACE_URI,
44                                           null, "xmlns:xlink",
45                                           XLinkSupport.XLINK_NAMESPACE_URI);
46         attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI,
47                                           "xlink", "type", "simple");
48         attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI,
49                                           "xlink", "show", "other");
50         attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI,
51                                           "xlink", "actuate", "onLoad");
52     }
53
54     /**
55      * Creates a new SVGOMAltGlyphElement object.
56      */

57     protected SVGOMAltGlyphElement() {
58     }
59
60     /**
61      * Creates a new SVGOMAltGlyphElement object.
62      * @param prefix The namespace prefix.
63      * @param owner The owner document.
64      */

65     public SVGOMAltGlyphElement(String JavaDoc prefix, AbstractDocument owner) {
66         super(prefix, owner);
67
68     }
69
70     /**
71      * <b>DOM</b>: Implements {@link Node#getLocalName()}.
72      */

73     public String JavaDoc getLocalName() {
74         return SVG_ALT_GLYPH_TAG;
75     }
76
77     /**
78      * <b>DOM</b>: Implements {@link SVGAltGlyphElement#getGlyphRef()}.
79      */

80     public String JavaDoc getGlyphRef() {
81         return getAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE);
82     }
83
84     /**
85      * <b>DOM</b>: Implements {@link SVGAltGlyphElement#setGlyphRef(String)}.
86      */

87     public void setGlyphRef(String JavaDoc glyphRef) throws DOMException JavaDoc {
88         setAttributeNS(null, SVG_GLYPH_REF_ATTRIBUTE, glyphRef);
89     }
90
91     /**
92      * <b>DOM</b>: Implements {@link SVGAltGlyphElement#getFormat()}.
93      */

94     public String JavaDoc getFormat() {
95         return getAttributeNS(null, SVG_FORMAT_ATTRIBUTE);
96     }
97
98     /**
99      * <b>DOM</b>: Implements {@link SVGAltGlyphElement#setFormat(String)}.
100      */

101     public void setFormat(String JavaDoc format) throws DOMException JavaDoc {
102         setAttributeNS(null, SVG_FORMAT_ATTRIBUTE, format);
103     }
104
105     /**
106      * Returns the AttributeInitializer for this element type.
107      * @return null if this element has no attribute with a default value.
108      */

109     protected AttributeInitializer getAttributeInitializer() {
110         return attributeInitializer;
111     }
112
113     /**
114      * Returns a new uninitialized instance of this object's class.
115      */

116     protected Node JavaDoc newNode() {
117         return new SVGOMAltGlyphElement();
118     }
119 }
120
Popular Tags