KickJava   Java API By Example, From Geeks To Geeks.

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


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

34 public class SVGOMViewElement
35     extends SVGOMElement
36     implements SVGViewElement {
37     
38     /**
39      * The attribute initializer.
40      */

41     protected final static AttributeInitializer attributeInitializer;
42     static {
43         attributeInitializer = new AttributeInitializer(2);
44         attributeInitializer.addAttribute(null,
45                                           null,
46                                           SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE,
47                                           "xMidYMid meet");
48         attributeInitializer.addAttribute(null,
49                                           null,
50                                           SVG_ZOOM_AND_PAN_ATTRIBUTE,
51                                           SVG_MAGNIFY_VALUE);
52     }
53
54     /**
55      * Creates a new SVGOMViewElement object.
56      */

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

65     public SVGOMViewElement(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_VIEW_TAG;
74     }
75
76     /**
77      * <b>DOM</b>: Implements {@link SVGViewElement#getViewTarget()}.
78      */

79     public SVGStringList getViewTarget() {
80         throw new RuntimeException JavaDoc("!!! TODO: getViewTarget()");
81     }
82
83     // SVGZoomAndPan support ///////////////////////////////////////////////
84

85     /**
86      * <b>DOM</b>: Implements {@link
87      * org.w3c.dom.svg.SVGZoomAndPan#getZoomAndPan()}.
88      */

89     public short getZoomAndPan() {
90         return SVGZoomAndPanSupport.getZoomAndPan(this);
91     }
92
93     /**
94      * <b>DOM</b>: Implements {@link
95      * org.w3c.dom.svg.SVGZoomAndPan#getZoomAndPan()}.
96      */

97     public void setZoomAndPan(short val) {
98         SVGZoomAndPanSupport.setZoomAndPan(this, val);
99     }
100
101     // SVGFitToViewBox support ////////////////////////////////////////////
102

103     /**
104      * <b>DOM</b>: Implements {@link
105      * org.w3c.dom.svg.SVGFitToViewBox#getViewBox()}.
106      */

107     public SVGAnimatedRect getViewBox() {
108         throw new RuntimeException JavaDoc(" !!! TODO: getViewBox()");
109     }
110
111     /**
112      * <b>DOM</b>: Implements {@link
113      * org.w3c.dom.svg.SVGFitToViewBox#getPreserveAspectRatio()}.
114      */

115     public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() {
116         return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this);
117     }
118
119     // SVGExternalResourcesRequired support /////////////////////////////
120

121     /**
122      * <b>DOM</b>: Implements {@link
123      * org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()}.
124      */

125     public SVGAnimatedBoolean getExternalResourcesRequired() {
126         return SVGExternalResourcesRequiredSupport.
127             getExternalResourcesRequired(this);
128     }
129
130     /**
131      * Returns the AttributeInitializer for this element type.
132      * @return null if this element has no attribute with a default value.
133      */

134     protected AttributeInitializer getAttributeInitializer() {
135         return attributeInitializer;
136     }
137
138     /**
139      * Returns a new uninitialized instance of this object's class.
140      */

141     protected Node JavaDoc newNode() {
142         return new SVGOMViewElement();
143     }
144 }
145
Popular Tags