KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 2000-2003 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.XMLSupport;
22 import org.w3c.dom.Node JavaDoc;
23 import org.w3c.dom.svg.SVGAnimatedBoolean;
24 import org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio;
25 import org.w3c.dom.svg.SVGAnimatedRect;
26 import org.w3c.dom.svg.SVGSymbolElement;
27
28 /**
29  * This class implements {@link SVGSymbolElement}.
30  *
31  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
32  * @version $Id: SVGOMSymbolElement.java,v 1.13 2004/09/01 09:35:23 deweese Exp $
33  */

34 public class SVGOMSymbolElement
35     extends SVGStylableElement
36     implements SVGSymbolElement {
37
38     /**
39      * The attribute initializer.
40      */

41     protected final static AttributeInitializer attributeInitializer;
42     static {
43         attributeInitializer = new AttributeInitializer(1);
44         attributeInitializer.addAttribute(null,
45                                           null,
46                                           SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE,
47                                           "xMidYMid meet");
48     }
49
50     /**
51      * Creates a new SVGOMSymbolElement object.
52      */

53     protected SVGOMSymbolElement() {
54     }
55
56     /**
57      * Creates a new SVGOMSymbolElement object.
58      * @param prefix The namespace prefix.
59      * @param owner The owner document.
60      */

61     public SVGOMSymbolElement(String JavaDoc prefix, AbstractDocument owner) {
62         super(prefix, owner);
63
64     }
65
66     /**
67      * <b>DOM</b>: Implements {@link Node#getLocalName()}.
68      */

69     public String JavaDoc getLocalName() {
70         return SVG_SYMBOL_TAG;
71     }
72
73     // SVGLangSpace support //////////////////////////////////////////////////
74

75     /**
76      * <b>DOM</b>: Returns the xml:lang attribute value.
77      */

78     public String JavaDoc getXMLlang() {
79         return XMLSupport.getXMLLang(this);
80     }
81
82     /**
83      * <b>DOM</b>: Sets the xml:lang attribute value.
84      */

85     public void setXMLlang(String JavaDoc lang) {
86         setAttributeNS(XMLSupport.XML_NAMESPACE_URI,
87                        XMLSupport.XML_LANG_ATTRIBUTE,
88                        lang);
89     }
90     
91     /**
92      * <b>DOM</b>: Returns the xml:space attribute value.
93      */

94     public String JavaDoc getXMLspace() {
95         return XMLSupport.getXMLSpace(this);
96     }
97
98     /**
99      * <b>DOM</b>: Sets the xml:space attribute value.
100      */

101     public void setXMLspace(String JavaDoc space) {
102         setAttributeNS(XMLSupport.XML_NAMESPACE_URI,
103                        XMLSupport.XML_SPACE_ATTRIBUTE,
104                        space);
105     }
106
107     // SVGZoomAndPan support ///////////////////////////////////////////////
108

109     /**
110      * <b>DOM</b>: Implements {@link
111      * org.w3c.dom.svg.SVGZoomAndPan#getZoomAndPan()}.
112      */

113     public short getZoomAndPan() {
114     return SVGZoomAndPanSupport.getZoomAndPan(this);
115     }
116
117     /**
118      * <b>DOM</b>: Implements {@link
119      * org.w3c.dom.svg.SVGZoomAndPan#getZoomAndPan()}.
120      */

121     public void setZoomAndPan(short val) {
122     SVGZoomAndPanSupport.setZoomAndPan(this, val);
123     }
124
125     // SVGFitToViewBox support ////////////////////////////////////////////
126

127     /**
128      * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}.
129      */

130     public SVGAnimatedRect getViewBox() {
131     throw new RuntimeException JavaDoc(" !!! TODO: getViewBox()");
132     }
133
134     /**
135      * <b>DOM</b>: Implements {@link
136      * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}.
137      */

138     public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() {
139         return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this);
140     }
141
142     // SVGExternalResourcesRequired support /////////////////////////////
143

144     /**
145      * <b>DOM</b>: Implements {@link
146      * org.w3c.dom.svg.SVGExternalResourcesRequired}.
147      */

148     public SVGAnimatedBoolean getExternalResourcesRequired() {
149     return SVGExternalResourcesRequiredSupport.
150             getExternalResourcesRequired(this);
151     }
152
153     /**
154      * Returns the AttributeInitializer for this element type.
155      * @return null if this element has no attribute with a default value.
156      */

157     protected AttributeInitializer getAttributeInitializer() {
158         return attributeInitializer;
159     }
160
161     /**
162      * Returns a new uninitialized instance of this object's class.
163      */

164     protected Node JavaDoc newNode() {
165         return new SVGOMSymbolElement();
166     }
167 }
168
Popular Tags