View Javadoc

1   /**********************************************
2    * Copyright (C) 2010 Lukas Laag
3    * This file is part of lib-gwt-svg.
4    * 
5    * libgwtsvg is free software: you can redistribute it and/or modify
6    * it under the terms of the GNU Lesser General Public License as published by
7    * the Free Software Foundation, either version 3 of the License, or
8    * (at your option) any later version.
9    * 
10   * libgwtsvg is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU Lesser General Public License for more details.
14   * 
15   * You should have received a copy of the GNU Lesser General Public License
16   * along with libgwtsvg.  If not, see http://www.gnu.org/licenses/
17   **********************************************/
18  /*
19   * Copyright (c) 2004 World Wide Web Consortium,
20   *
21   * (Massachusetts Institute of Technology, European Research Consortium for
22   * Informatics and Mathematics, Keio University). All Rights Reserved. This
23   * work is distributed under the W3C(r) Software License [1] in the hope that
24   * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
25   * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26   *
27   * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
28   */
29  
30  package org.vectomatic.dom.svg;
31  
32  import org.vectomatic.dom.svg.impl.SVGMaskElement;
33  import org.vectomatic.dom.svg.itf.ISVGContainerElement;
34  import org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired;
35  import org.vectomatic.dom.svg.itf.ISVGLangSpace;
36  import org.vectomatic.dom.svg.itf.ISVGStylable;
37  import org.vectomatic.dom.svg.itf.ISVGTests;
38  import org.vectomatic.dom.svg.itf.ISVGUnitTypes;
39  import org.vectomatic.dom.svg.utils.DOMHelper;
40  import org.vectomatic.dom.svg.utils.SVGConstants;
41  
42  import com.google.gwt.core.client.JavaScriptException;
43  import com.google.gwt.dom.client.TagName;
44  
45  /**
46   * The {@link org.vectomatic.dom.svg.OMSVGMaskElement} interface corresponds
47   * to the <a href='http://www.w3.org/TR/SVG11/masking.html#MaskElement' title='mask
48   * element specification'>mask</a>  element.
49   */
50  @TagName("mask")
51  public class OMSVGMaskElement extends OMSVGElement implements ISVGTests, ISVGLangSpace, ISVGExternalResourcesRequired, ISVGStylable, ISVGUnitTypes, ISVGContainerElement {
52    public OMSVGMaskElement() {
53      this((SVGMaskElement)DOMHelper.createElementNS(DOMHelper.getCurrentDocument(), SVGConstants.SVG_NAMESPACE_URI, SVGConstants.SVG_MASK_TAG).cast());
54    }
55  
56    protected OMSVGMaskElement(SVGMaskElement ot) {
57      super(ot);
58    }
59  
60    // Implementation of the svg::SVGMaskElement W3C IDL interface
61    /**
62     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGMaskElement#getMaskUnits()}
63     * on the given <a href='http://www.w3.org/TR/SVG11/masking.html#MaskElement'
64     * title='mask element specification'>mask</a>  element.  Takes one of the
65     * constants defined in {@link org.vectomatic.dom.svg.itf.ISVGUnitTypes}.
66     */
67    public final OMSVGAnimatedEnumeration getMaskUnits() {
68      return ((SVGMaskElement)ot).getMaskUnits();
69    }
70    /**
71     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGMaskElement#getMaskContentUnits()}
72     * on the given <a href='http://www.w3.org/TR/SVG11/masking.html#MaskElement'
73     * title='mask element specification'>mask</a>  element.  Takes one of the
74     * constants defined in {@link org.vectomatic.dom.svg.itf.ISVGUnitTypes}.
75     */
76    public final OMSVGAnimatedEnumeration getMaskContentUnits() {
77      return ((SVGMaskElement)ot).getMaskContentUnits();
78    }
79    /**
80     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGMaskElement#getX()}
81     * on the given <a href='http://www.w3.org/TR/SVG11/masking.html#MaskElement'
82     * title='mask element specification'>mask</a> element.
83     */
84    public final OMSVGAnimatedLength getX() {
85      return ((SVGMaskElement)ot).getX();
86    }
87    /**
88     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGMaskElement#getY()}
89     * on the given <a href='http://www.w3.org/TR/SVG11/masking.html#MaskElement'
90     * title='mask element specification'>mask</a> element.
91     */
92    public final OMSVGAnimatedLength getY() {
93      return ((SVGMaskElement)ot).getY();
94    }
95    /**
96     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGMaskElement#getWidth()}
97     * on the given <a href='http://www.w3.org/TR/SVG11/masking.html#MaskElement'
98     * title='mask element specification'>mask</a>  element.
99     */
100   public final OMSVGAnimatedLength getWidth() {
101     return ((SVGMaskElement)ot).getWidth();
102   }
103   /**
104    * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGMaskElement#getHeight()}
105    * on the given <a href='http://www.w3.org/TR/SVG11/masking.html#MaskElement'
106    * title='mask element specification'>mask</a>  element.
107    */
108   public final OMSVGAnimatedLength getHeight() {
109     return ((SVGMaskElement)ot).getHeight();
110   }
111 
112   // Implementation of the svg::SVGExternalResourcesRequired W3C IDL interface
113   /**
114    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
115    * on the given element. Note that the SVG DOM defines the attribute {@link
116    * org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
117    * as being of type {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean}, whereas
118    * the SVG language definition says that {@link org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
119    * is not animated. Because the SVG language definition states that {@link
120    * org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
121    * cannot be animated, the {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean#getAnimVal()}
122    * will always be the same as the {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean#getBaseVal()}.
123    */
124   public final OMSVGAnimatedBoolean getExternalResourcesRequired() {
125     return ((SVGMaskElement)ot).getExternalResourcesRequired();
126   }
127 
128   // Implementation of the svg::SVGLangSpace W3C IDL interface
129   /**
130    * Corresponds to attribute <code>xml:lang</code> on the given element.
131    */
132   public final String getXmllang() {
133     return ((SVGMaskElement)ot).getXmllang();
134   }
135   /**
136    * Corresponds to attribute <code>xml:lang</code> on the given element.
137    * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an   attempt
138    * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only
139    * attribute</a>.
140    */
141   public final void setXmllang(java.lang.String value) throws JavaScriptException {
142     ((SVGMaskElement)ot).setXmllang(value);
143   }
144   /**
145    * Corresponds to attribute <code>xml:space</code> on the given element.
146    */
147   public final String getXmlspace() {
148     return ((SVGMaskElement)ot).getXmlspace();
149   }
150   /**
151    * Corresponds to attribute <code>xml:space</code> on the given element.
152    * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an   attempt
153    * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only
154    * attribute</a>.
155    */
156   public final void setXmlspace(java.lang.String value) throws JavaScriptException {
157     ((SVGMaskElement)ot).setXmlspace(value);
158   }
159 
160   // Implementation of the svg::SVGTests W3C IDL interface
161   /**
162    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredFeatures()}
163    * on the given element.
164    */
165   public final OMSVGStringList getRequiredFeatures() {
166     return ((SVGMaskElement)ot).getRequiredFeatures();
167   }
168   /**
169    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredExtensions()}
170    * on the given element.
171    */
172   public final OMSVGStringList getRequiredExtensions() {
173     return ((SVGMaskElement)ot).getRequiredExtensions();
174   }
175   /**
176    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getSystemLanguage()}
177    * on the given element.
178    */
179   public final OMSVGStringList getSystemLanguage() {
180     return ((SVGMaskElement)ot).getSystemLanguage();
181   }
182   /**
183    * Returns true if the user agent supports the given extension, specified
184    * by a URI.
185    * @param extension The name of the extension, expressed as a URI.
186    * @return True or false, depending on whether the given extension is   supported.
187    */
188   public final boolean hasExtension(String extension) {
189     return ((SVGMaskElement)ot).hasExtension(extension);
190   }
191 
192   // Implementation of the svg::SVGUnitTypes W3C IDL interface
193 
194 }