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.impl;
31
32 import org.vectomatic.dom.svg.OMSVGAnimatedBoolean;
33 import org.vectomatic.dom.svg.OMSVGAnimatedEnumeration;
34 import org.vectomatic.dom.svg.OMSVGAnimatedTransformList;
35 import org.vectomatic.dom.svg.OMSVGMatrix;
36 import org.vectomatic.dom.svg.OMSVGRect;
37 import org.vectomatic.dom.svg.OMSVGStringList;
38
39 import com.google.gwt.core.client.JavaScriptException;
40
41 /**
42 * The {@link org.vectomatic.dom.svg.impl.SVGClipPathElement} interface corresponds
43 * to the <a href='http://www.w3.org/TR/SVG11/masking.html#ClipPathElement'
44 * title='clipPath element specification'>clipPath</a> element.
45 */
46 public class SVGClipPathElement extends SVGElement {
47 protected SVGClipPathElement() {
48 }
49
50 // Implementation of the svg::SVGClipPathElement W3C IDL interface
51 /**
52 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGClipPathElement#getClipPathUnits()}
53 * on the given <a href='http://www.w3.org/TR/SVG11/masking.html#ClipPathElement'
54 * title='clipPath element specification'>clipPath</a> element. Takes one
55 * of the constants defined in {@link org.vectomatic.dom.svg.itf.ISVGUnitTypes}.
56 */
57 public final native OMSVGAnimatedEnumeration getClipPathUnits() /*-{
58 return this.clipPathUnits;
59 }-*/;
60
61 // Implementation of the svg::SVGExternalResourcesRequired W3C IDL interface
62 /**
63 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
64 * on the given element. Note that the SVG DOM defines the attribute {@link
65 * org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
66 * as being of type {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean}, whereas
67 * the SVG language definition says that {@link org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
68 * is not animated. Because the SVG language definition states that {@link
69 * org.vectomatic.dom.svg.itf.ISVGExternalResourcesRequired#getExternalResourcesRequired()}
70 * cannot be animated, the {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean#getAnimVal()}
71 * will always be the same as the {@link org.vectomatic.dom.svg.OMSVGAnimatedBoolean#getBaseVal()}.
72 */
73 public final native OMSVGAnimatedBoolean getExternalResourcesRequired() /*-{
74 return this.externalResourcesRequired;
75 }-*/;
76
77 // Implementation of the svg::SVGLangSpace W3C IDL interface
78 /**
79 * Corresponds to attribute <code>xml:lang</code> on the given element.
80 */
81 public final native String getXmllang() /*-{
82 return this.xmllang;
83 }-*/;
84 /**
85 * Corresponds to attribute <code>xml:lang</code> on the given element.
86 * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an attempt
87 * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only
88 * attribute</a>.
89 */
90 public final native void setXmllang(String value) throws JavaScriptException /*-{
91 this.xmllang = value;
92 }-*/;
93 /**
94 * Corresponds to attribute <code>xml:space</code> on the given element.
95 */
96 public final native String getXmlspace() /*-{
97 return this.xmlspace;
98 }-*/;
99 /**
100 * Corresponds to attribute <code>xml:space</code> on the given element.
101 * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an attempt
102 * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only
103 * attribute</a>.
104 */
105 public final native void setXmlspace(String value) throws JavaScriptException /*-{
106 this.xmlspace = value;
107 }-*/;
108
109 // Implementation of the svg::SVGLocatable W3C IDL interface
110 /**
111 * The element which established the current viewport. Often, the nearest
112 * ancestor <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement' title='svg
113 * element specification'>svg</a> element. Null if the current element is
114 * the outermost <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement'
115 * title='svg element specification'>svg</a> element.
116 */
117 public final native SVGElement getNearestViewportElement() /*-{
118 return this.nearestViewportElement;
119 }-*/;
120 /**
121 * The farthest ancestor <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement'
122 * title='svg element specification'>svg</a> element. Null if the current
123 * element is the outermost <a href='http://www.w3.org/TR/SVG11/struct.html#SVGElement'
124 * title='svg element specification'>svg</a> element.
125 */
126 public final native SVGElement getFarthestViewportElement() /*-{
127 return this.farthestViewportElement;
128 }-*/;
129 /**
130 * Returns the tight bounding box in current user space (i.e., after application
131 * of the <code>transform</code> attribute, if any) on the geometry of all
132 * contained graphics elements, exclusive of stroking, clipping, masking and
133 * filter effects). Note that getBBox must return the actual bounding box
134 * at the time the method was called, even in case the element has not yet
135 * been rendered.
136 * @return An {@link org.vectomatic.dom.svg.OMSVGRect} object that defines
137 * the bounding box.
138 */
139 public final native OMSVGRect getBBox() /*-{
140 return this.getBBox();
141 }-*/;
142 /**
143 * Returns the transformation matrix from current user units (i.e., after
144 * application of the <code>transform</code> attribute, if any) to the viewport
145 * coordinate system for the {@link org.vectomatic.dom.svg.itf.ISVGLocatable#getNearestViewportElement()}.
146 * @return An {@link org.vectomatic.dom.svg.OMSVGMatrix} object that defines
147 * the CTM.
148 */
149 public final native OMSVGMatrix getCTM() /*-{
150 return this.getCTM();
151 }-*/;
152 /**
153 * Returns the transformation matrix from current user units (i.e., after
154 * application of the <code>transform</code> attribute, if any) to the parent
155 * user agent's notice of a "pixel". For display devices, ideally this represents
156 * a physical screen pixel. For other devices or environments where physical
157 * pixel sizes are not known, then an algorithm similar to the CSS2 definition
158 * of a "pixel" can be used instead. Note that null is returned if this element
159 * is not hooked into the document tree. This method would have been more
160 * aptly named as <code>getClientCTM</code>, but the name <code>getScreenCTM</code>
161 * is kept for historical reasons.
162 * @return An {@link org.vectomatic.dom.svg.OMSVGMatrix} object that defines
163 * the given transformation matrix.
164 */
165 public final native OMSVGMatrix getScreenCTM() /*-{
166 return this.getScreenCTM();
167 }-*/;
168 /**
169 * Returns the transformation matrix from the user coordinate system on the
170 * current element (after application of the <code>transform</code> attribute,
171 * if any) to the user coordinate system on parameter <var>element</var> (after
172 * application of its <code>transform</code> attribute, if any).
173 * @param element The target element.
174 * @return An {@link org.vectomatic.dom.svg.OMSVGMatrix} object that defines
175 * the transformation.
176 * @throws SVGException(SVG_MATRIX_NOT_INVERTABLE) Raised if the currently
177 * defined transformation matrices make it impossible to compute the given
178 * matrix (e.g., because one of the transformations is singular).
179 */
180 public final native OMSVGMatrix getTransformToElement(SVGElement element) throws JavaScriptException /*-{
181 return this.getTransformToElement(element);
182 }-*/;
183
184 // Implementation of the svg::SVGTests W3C IDL interface
185 /**
186 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredFeatures()}
187 * on the given element.
188 */
189 public final native OMSVGStringList getRequiredFeatures() /*-{
190 return @org.vectomatic.dom.svg.OMNode::convertList(Lcom/google/gwt/core/client/JavaScriptObject;)(this.requiredFeatures);
191 }-*/;
192 /**
193 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredExtensions()}
194 * on the given element.
195 */
196 public final native OMSVGStringList getRequiredExtensions() /*-{
197 return @org.vectomatic.dom.svg.OMNode::convertList(Lcom/google/gwt/core/client/JavaScriptObject;)(this.requiredExtensions);
198 }-*/;
199 /**
200 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getSystemLanguage()}
201 * on the given element.
202 */
203 public final native OMSVGStringList getSystemLanguage() /*-{
204 return @org.vectomatic.dom.svg.OMNode::convertList(Lcom/google/gwt/core/client/JavaScriptObject;)(this.systemLanguage);
205 }-*/;
206 /**
207 * Returns true if the user agent supports the given extension, specified
208 * by a URI.
209 * @param extension The name of the extension, expressed as a URI.
210 * @return True or false, depending on whether the given extension is supported.
211 */
212 public final native boolean hasExtension(String extension) /*-{
213 return this.hasExtension(extension);
214 }-*/;
215
216 // Implementation of the svg::SVGTransformable W3C IDL interface
217 /**
218 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTransformable#getTransform()}
219 * on the given element.
220 */
221 public final native OMSVGAnimatedTransformList getTransform() /*-{
222 return this.transform;
223 }-*/;
224
225 // Implementation of the svg::SVGUnitTypes W3C IDL interface
226
227 }