KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 2000-2001,2003-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.SVGAnimatedBoolean;
26 import org.w3c.dom.svg.SVGScriptElement;
27
28 /**
29  * This class implements {@link org.w3c.dom.svg.SVGScriptElement}.
30  *
31  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
32  * @version $Id: SVGOMScriptElement.java,v 1.8 2004/08/18 07:13:18 vhardy Exp $
33  */

34 public class SVGOMScriptElement
35     extends SVGOMURIReferenceElement
36     implements SVGScriptElement {
37
38     /**
39      * The attribute initializer.
40      */

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

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

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

74     public String JavaDoc getLocalName() {
75         return SVG_SCRIPT_TAG;
76     }
77
78     /**
79      * <b>DOM</b>: Implements {@link SVGScriptElement#getType()}.
80      */

81     public String JavaDoc getType() {
82     return getAttributeNS(null, SVG_TYPE_ATTRIBUTE);
83     }
84  
85     /**
86      * <b>DOM</b>: Implements {@link SVGScriptElement#setType(String)}.
87      */

88     public void setType(String JavaDoc type) throws DOMException JavaDoc {
89     setAttributeNS(null, SVG_TYPE_ATTRIBUTE, type);
90     }
91
92     // SVGExternalResourcesRequired support /////////////////////////////
93

94     /**
95      * <b>DOM</b>: Implements {@link
96      * org.w3c.dom.svg.SVGExternalResourcesRequired}.
97      */

98     public SVGAnimatedBoolean getExternalResourcesRequired() {
99     return SVGExternalResourcesRequiredSupport.
100             getExternalResourcesRequired(this);
101     }
102
103     /**
104      * Returns the AttributeInitializer for this element type.
105      * @return null if this element has no attribute with a default value.
106      */

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

114     protected Node JavaDoc newNode() {
115         return new SVGOMScriptElement();
116     }
117 }
118
Popular Tags