KickJava   Java API By Example, From Geeks To Geeks.

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


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.Node JavaDoc;
24 import org.w3c.dom.svg.SVGAnimatedBoolean;
25 import org.w3c.dom.svg.SVGAnimatedLength;
26 import org.w3c.dom.svg.SVGCursorElement;
27 import org.w3c.dom.svg.SVGStringList;
28
29 /**
30  * This class implements {@link org.w3c.dom.svg.SVGCursorElement}.
31  *
32  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
33  * @version $Id: SVGOMCursorElement.java,v 1.7 2004/08/18 07:13:14 vhardy Exp $
34  */

35 public class SVGOMCursorElement
36     extends SVGOMURIReferenceElement
37     implements SVGCursorElement {
38
39     /**
40      * The attribute initializer.
41      */

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

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

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

75     public String JavaDoc getLocalName() {
76         return SVG_CURSOR_TAG;
77     }
78
79     /**
80      * <b>DOM</b>: Implements {@link SVGCursorElement#getX()}.
81      */

82     public SVGAnimatedLength getX() {
83         return getAnimatedLengthAttribute
84             (null, SVG_X_ATTRIBUTE, SVG_CURSOR_X_DEFAULT_VALUE,
85              SVGOMAnimatedLength.HORIZONTAL_LENGTH);
86     }
87
88     /**
89      * <b>DOM</b>: Implements {@link SVGCursorElement#getY()}.
90      */

91     public SVGAnimatedLength getY() {
92         return getAnimatedLengthAttribute
93             (null, SVG_Y_ATTRIBUTE, SVG_CURSOR_Y_DEFAULT_VALUE,
94              SVGOMAnimatedLength.VERTICAL_LENGTH);
95     }
96
97     // SVGExternalResourcesRequired support /////////////////////////////
98

99     /**
100      * <b>DOM</b>: Implements {@link
101      * org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()}.
102      */

103     public SVGAnimatedBoolean getExternalResourcesRequired() {
104     return SVGExternalResourcesRequiredSupport.
105             getExternalResourcesRequired(this);
106     }
107
108     // SVGTests support ///////////////////////////////////////////////////
109

110     /**
111      * <b>DOM</b>: Implements {@link
112      * org.w3c.dom.svg.SVGTests#getRequiredFeatures()}.
113      */

114     public SVGStringList getRequiredFeatures() {
115     return SVGTestsSupport.getRequiredFeatures(this);
116     }
117
118     /**
119      * <b>DOM</b>: Implements {@link
120      * org.w3c.dom.svg.SVGTests#getRequiredExtensions()}.
121      */

122     public SVGStringList getRequiredExtensions() {
123     return SVGTestsSupport.getRequiredExtensions(this);
124     }
125
126     /**
127      * <b>DOM</b>: Implements {@link
128      * org.w3c.dom.svg.SVGTests#getSystemLanguage()}.
129      */

130     public SVGStringList getSystemLanguage() {
131     return SVGTestsSupport.getSystemLanguage(this);
132     }
133
134     /**
135      * <b>DOM</b>: Implements {@link
136      * org.w3c.dom.svg.SVGTests#hasExtension(String)}.
137      */

138     public boolean hasExtension(String JavaDoc extension) {
139     return SVGTestsSupport.hasExtension(this, extension);
140     }
141
142     /**
143      * Returns the AttributeInitializer for this element type.
144      * @return null if this element has no attribute with a default value.
145      */

146     protected AttributeInitializer getAttributeInitializer() {
147         return attributeInitializer;
148     }
149
150     /**
151      * Returns a new uninitialized instance of this object's class.
152      */

153     protected Node JavaDoc newNode() {
154         return new SVGOMCursorElement();
155     }
156 }
157
Popular Tags