KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 2000-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.Node JavaDoc;
24 import org.w3c.dom.svg.SVGAElement;
25 import org.w3c.dom.svg.SVGAnimatedString;
26
27 /**
28  * This class implements {@link SVGAElement}.
29  *
30  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
31  * @version $Id: SVGOMAElement.java,v 1.9 2004/08/18 07:13:14 vhardy Exp $
32  */

33 public class SVGOMAElement
34     extends SVGURIReferenceGraphicsElement
35     implements SVGAElement {
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", "replace");
50         attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI,
51                                           "xlink", "actuate", "onRequest");
52     }
53
54     /**
55      * Creates a new SVGOMAElement object.
56      */

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

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

72     public String JavaDoc getLocalName() {
73         return SVG_A_TAG;
74     }
75
76     /**
77      * <b>DOM</b>: Implements {@link SVGAElement#getTarget()}.
78      */

79     public SVGAnimatedString getTarget() {
80         return getAnimatedStringAttribute(null, SVG_TARGET_ATTRIBUTE);
81     }
82
83     /**
84      * Returns the AttributeInitializer for this element type.
85      * @return null if this element has no attribute with a default value.
86      */

87     protected AttributeInitializer getAttributeInitializer() {
88         return attributeInitializer;
89     }
90
91     /**
92      * Returns a new uninitialized instance of this object's class.
93      */

94     protected Node JavaDoc newNode() {
95         return new SVGOMAElement();
96     }
97 }
98
Popular Tags