KickJava   Java API By Example, From Geeks To Geeks.

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


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.w3c.dom.Node JavaDoc;
22 import org.w3c.dom.svg.SVGAnimatedEnumeration;
23 import org.w3c.dom.svg.SVGAnimatedLength;
24 import org.w3c.dom.svg.SVGMaskElement;
25
26 /**
27  * This class implements {@link org.w3c.dom.svg.SVGMaskElement}.
28  *
29  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
30  * @version $Id: SVGOMMaskElement.java,v 1.12 2004/08/18 07:13:17 vhardy Exp $
31  */

32 public class SVGOMMaskElement
33     extends SVGGraphicsElement
34     implements SVGMaskElement {
35
36     /**
37      * The units values.
38      */

39     protected final static String JavaDoc[] UNITS_VALUES = {
40         "",
41         SVG_USER_SPACE_ON_USE_VALUE,
42         SVG_OBJECT_BOUNDING_BOX_VALUE
43     };
44
45     /**
46      * Creates a new SVGOMMaskElement object.
47      */

48     protected SVGOMMaskElement() {
49     }
50
51     /**
52      * Creates a new SVGOMMaskElement object.
53      * @param prefix The namespace prefix.
54      * @param owner The owner document.
55      */

56     public SVGOMMaskElement(String JavaDoc prefix, AbstractDocument owner) {
57         super(prefix, owner);
58     }
59
60     /**
61      * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getLocalName()}.
62      */

63     public String JavaDoc getLocalName() {
64         return SVG_MASK_TAG;
65     }
66
67     /**
68      * <b>DOM</b>: Implements {@link SVGMaskElement#getMaskUnits()}.
69      */

70     public SVGAnimatedEnumeration getMaskUnits() {
71         return getAnimatedEnumerationAttribute
72             (null, SVG_MASK_UNITS_ATTRIBUTE, UNITS_VALUES,
73              (short)2);
74     }
75
76     /**
77      * <b>DOM</b>: Implements {@link SVGMaskElement#getMaskContentUnits()}.
78      */

79     public SVGAnimatedEnumeration getMaskContentUnits() {
80         return getAnimatedEnumerationAttribute
81             (null, SVG_MASK_CONTENT_UNITS_ATTRIBUTE, UNITS_VALUES,
82              (short)1);
83     }
84
85     /**
86      * <b>DOM</b>: Implements {@link SVGMaskElement#getX()}.
87      */

88     public SVGAnimatedLength getX() {
89         return getAnimatedLengthAttribute
90             (null, SVG_X_ATTRIBUTE, SVG_MASK_X_DEFAULT_VALUE,
91              SVGOMAnimatedLength.HORIZONTAL_LENGTH);
92     }
93
94     /**
95      * <b>DOM</b>: Implements {@link SVGMaskElement#getY()}.
96      */

97     public SVGAnimatedLength getY() {
98         return getAnimatedLengthAttribute
99             (null, SVG_Y_ATTRIBUTE, SVG_MASK_Y_DEFAULT_VALUE,
100              SVGOMAnimatedLength.VERTICAL_LENGTH);
101     }
102
103     /**
104      * <b>DOM</b>: Implements {@link SVGMaskElement#getWidth()}.
105      */

106     public SVGAnimatedLength getWidth() {
107         return getAnimatedLengthAttribute
108             (null, SVG_WIDTH_ATTRIBUTE, SVG_MASK_WIDTH_DEFAULT_VALUE,
109              SVGOMAnimatedLength.HORIZONTAL_LENGTH);
110     }
111
112     /**
113      * <b>DOM</b>: Implements {@link SVGMaskElement#getHeight()}.
114      */

115     public SVGAnimatedLength getHeight() {
116         return getAnimatedLengthAttribute
117             (null, SVG_HEIGHT_ATTRIBUTE, SVG_MASK_HEIGHT_DEFAULT_VALUE,
118              SVGOMAnimatedLength.VERTICAL_LENGTH);
119     }
120
121     /**
122      * Returns a new uninitialized instance of this object's class.
123      */

124     protected Node JavaDoc newNode() {
125         return new SVGOMMaskElement();
126     }
127 }
128
Popular Tags