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.SVGPatternElement;
33  import org.vectomatic.dom.svg.itf.ISVGContainerElement;
34  import org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired;
35  import org.vectomatic.dom.svg.itf.ISVGFitToViewBox;
36  import org.vectomatic.dom.svg.itf.ISVGLangSpace;
37  import org.vectomatic.dom.svg.itf.ISVGStylable;
38  import org.vectomatic.dom.svg.itf.ISVGTests;
39  import org.vectomatic.dom.svg.itf.ISVGURIReference;
40  import org.vectomatic.dom.svg.itf.ISVGUnitTypes;
41  import org.vectomatic.dom.svg.utils.DOMHelper;
42  import org.vectomatic.dom.svg.utils.SVGConstants;
43  
44  import com.google.gwt.core.client.JavaScriptException;
45  import com.google.gwt.dom.client.TagName;
46  
47  /**
48   * The {@link org.vectomatic.dom.svg.OMSVGPatternElement} interface corresponds
49   * to the <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
50   * title='pattern element specification'>pattern</a> element.
51   */
52  @TagName("pattern")
53  public class OMSVGPatternElement extends OMSVGElement implements ISVGURIReference, ISVGTests, ISVGLangSpace, ISVGExternalResourcesRequired, ISVGStylable, ISVGFitToViewBox, ISVGUnitTypes, ISVGContainerElement {
54    public OMSVGPatternElement() {
55      this((SVGPatternElement)DOMHelper.createElementNS(DOMHelper.getCurrentDocument(), SVGConstants.SVG_NAMESPACE_URI, SVGConstants.SVG_PATTERN_TAG).cast());
56    }
57  
58    protected OMSVGPatternElement(SVGPatternElement ot) {
59      super(ot);
60    }
61  
62    // Implementation of the svg::SVGPatternElement W3C IDL interface
63    /**
64     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGPatternElement#getPatternUnits()}
65     * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
66     * title='pattern element specification'>pattern</a> element. Takes one of
67     * the constants defined in {@link org.vectomatic.dom.svg.itf.ISVGUnitTypes}.
68     */
69    public final OMSVGAnimatedEnumeration getPatternUnits() {
70      return ((SVGPatternElement)ot).getPatternUnits();
71    }
72    /**
73     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGPatternElement#getPatternContentUnits()}
74     * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
75     * title='pattern element specification'>pattern</a> element. Takes one of
76     * the constants defined in {@link org.vectomatic.dom.svg.itf.ISVGUnitTypes}.
77     */
78    public final OMSVGAnimatedEnumeration getPatternContentUnits() {
79      return ((SVGPatternElement)ot).getPatternContentUnits();
80    }
81    /**
82     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGPatternElement#getPatternTransform()}
83     * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
84     * title='pattern element specification'>pattern</a> element.
85     */
86    public final OMSVGAnimatedTransformList getPatternTransform() {
87      return ((SVGPatternElement)ot).getPatternTransform();
88    }
89    /**
90     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGPatternElement#getX()}
91     * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
92     * title='pattern element specification'>pattern</a> element.
93     */
94    public final OMSVGAnimatedLength getX() {
95      return ((SVGPatternElement)ot).getX();
96    }
97    /**
98     * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGPatternElement#getY()}
99     * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
100    * title='pattern element specification'>pattern</a> element.
101    */
102   public final OMSVGAnimatedLength getY() {
103     return ((SVGPatternElement)ot).getY();
104   }
105   /**
106    * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGPatternElement#getWidth()}
107    * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
108    * title='pattern element specification'>pattern</a> element.
109    */
110   public final OMSVGAnimatedLength getWidth() {
111     return ((SVGPatternElement)ot).getWidth();
112   }
113   /**
114    * Corresponds to attribute {@link org.vectomatic.dom.svg.OMSVGPatternElement#getHeight()}
115    * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement'
116    * title='pattern element specification'>pattern</a> element.
117    */
118   public final OMSVGAnimatedLength getHeight() {
119     return ((SVGPatternElement)ot).getHeight();
120   }
121 
122   // Implementation of the svg::SVGExternalResourcesRequired W3C IDL interface
123   /**
124    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
125    * on the given element. Note that the SVG DOM defines the attribute {@link
126    * org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
127    * as being of type {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean}, whereas
128    * the SVG language definition says that {@link org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
129    * is not animated. Because the SVG language definition states that {@link
130    * org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
131    * cannot be animated, the {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean#getAnimVal()}
132    * will always be the same as the {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean#getBaseVal()}.
133    */
134   public final OMSVGAnimatedBoolean getExternalResourcesRequired() {
135     return ((SVGPatternElement)ot).getExternalResourcesRequired();
136   }
137 
138   // Implementation of the svg::SVGFitToViewBox W3C IDL interface
139   /**
140    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGFitToViewBox#getViewBox()}
141    * on the given element.
142    */
143   public final OMSVGAnimatedRect getViewBox() {
144     return ((SVGPatternElement)ot).getViewBox();
145   }
146   /**
147    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGFitToViewBox#getPreserveAspectRatio()}
148    * on the given element.
149    */
150   public final OMSVGAnimatedPreserveAspectRatio getPreserveAspectRatio() {
151     return ((SVGPatternElement)ot).getPreserveAspectRatio();
152   }
153 
154   // Implementation of the svg::SVGLangSpace W3C IDL interface
155   /**
156    * Corresponds to attribute <code>xml:lang</code> on the given element.
157    */
158   public final String getXmllang() {
159     return ((SVGPatternElement)ot).getXmllang();
160   }
161   /**
162    * Corresponds to attribute <code>xml:lang</code> on the given element.
163    * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an   attempt
164    * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only
165    * attribute</a>.
166    */
167   public final void setXmllang(java.lang.String value) throws JavaScriptException {
168     ((SVGPatternElement)ot).setXmllang(value);
169   }
170   /**
171    * Corresponds to attribute <code>xml:space</code> on the given element.
172    */
173   public final String getXmlspace() {
174     return ((SVGPatternElement)ot).getXmlspace();
175   }
176   /**
177    * Corresponds to attribute <code>xml:space</code> on the given element.
178    * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an   attempt
179    * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only
180    * attribute</a>.
181    */
182   public final void setXmlspace(java.lang.String value) throws JavaScriptException {
183     ((SVGPatternElement)ot).setXmlspace(value);
184   }
185 
186   // Implementation of the svg::SVGTests W3C IDL interface
187   /**
188    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredFeatures()}
189    * on the given element.
190    */
191   public final OMSVGStringList getRequiredFeatures() {
192     return ((SVGPatternElement)ot).getRequiredFeatures();
193   }
194   /**
195    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredExtensions()}
196    * on the given element.
197    */
198   public final OMSVGStringList getRequiredExtensions() {
199     return ((SVGPatternElement)ot).getRequiredExtensions();
200   }
201   /**
202    * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getSystemLanguage()}
203    * on the given element.
204    */
205   public final OMSVGStringList getSystemLanguage() {
206     return ((SVGPatternElement)ot).getSystemLanguage();
207   }
208   /**
209    * Returns true if the user agent supports the given extension, specified
210    * by a URI.
211    * @param extension The name of the extension, expressed as a URI.
212    * @return True or false, depending on whether the given extension is   supported.
213    */
214   public final boolean hasExtension(String extension) {
215     return ((SVGPatternElement)ot).hasExtension(extension);
216   }
217 
218   // Implementation of the svg::SVGURIReference W3C IDL interface
219   /**
220    * Corresponds to attribute <span class='attr-name'>'xlink:href'</span> on
221    * the given element.
222    */
223   public final OMSVGAnimatedString getHref() {
224     return ((SVGPatternElement)ot).getHref();
225   }
226 
227   // Implementation of the svg::SVGUnitTypes W3C IDL interface
228 
229 }