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.OMSVGAnimatedLength; 35 import org.vectomatic.dom.svg.OMSVGAnimatedPreserveAspectRatio; 36 import org.vectomatic.dom.svg.OMSVGAnimatedRect; 37 import org.vectomatic.dom.svg.OMSVGAnimatedString; 38 import org.vectomatic.dom.svg.OMSVGAnimatedTransformList; 39 import org.vectomatic.dom.svg.OMSVGStringList; 40 41 import com.google.gwt.core.client.JavaScriptException; 42 43 /** 44 * The {@link org.vectomatic.dom.svg.impl.SVGPatternElement} interface corresponds 45 * to the <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 46 * title='pattern element specification'>pattern</a> element. 47 */ 48 public class SVGPatternElement extends SVGElement { 49 protected SVGPatternElement() { 50 } 51 52 // Implementation of the svg::SVGPatternElement W3C IDL interface 53 /** 54 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGPatternElement#getPatternUnits()} 55 * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 56 * title='pattern element specification'>pattern</a> element. Takes one of 57 * the constants defined in {@link org.vectomatic.dom.svg.itf.ISVGUnitTypes}. 58 */ 59 public final native OMSVGAnimatedEnumeration getPatternUnits() /*-{ 60 return this.patternUnits; 61 }-*/; 62 /** 63 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGPatternElement#getPatternContentUnits()} 64 * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 65 * title='pattern element specification'>pattern</a> element. Takes one of 66 * the constants defined in {@link org.vectomatic.dom.svg.itf.ISVGUnitTypes}. 67 */ 68 public final native OMSVGAnimatedEnumeration getPatternContentUnits() /*-{ 69 return this.patternContentUnits; 70 }-*/; 71 /** 72 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGPatternElement#getPatternTransform()} 73 * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 74 * title='pattern element specification'>pattern</a> element. 75 */ 76 public final native OMSVGAnimatedTransformList getPatternTransform() /*-{ 77 return this.patternTransform; 78 }-*/; 79 /** 80 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGPatternElement#getX()} 81 * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 82 * title='pattern element specification'>pattern</a> element. 83 */ 84 public final native OMSVGAnimatedLength getX() /*-{ 85 return this.x; 86 }-*/; 87 /** 88 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGPatternElement#getY()} 89 * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 90 * title='pattern element specification'>pattern</a> element. 91 */ 92 public final native OMSVGAnimatedLength getY() /*-{ 93 return this.y; 94 }-*/; 95 /** 96 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGPatternElement#getWidth()} 97 * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 98 * title='pattern element specification'>pattern</a> element. 99 */ 100 public final native OMSVGAnimatedLength getWidth() /*-{ 101 return this.width; 102 }-*/; 103 /** 104 * Corresponds to attribute {@link org.vectomatic.dom.svg.impl.SVGPatternElement#getHeight()} 105 * on the given <a href='http://www.w3.org/TR/SVG11/pservers.html#PatternElement' 106 * title='pattern element specification'>pattern</a> element. 107 */ 108 public final native OMSVGAnimatedLength getHeight() /*-{ 109 return this.height; 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 native OMSVGAnimatedBoolean getExternalResourcesRequired() /*-{ 125 return this.externalResourcesRequired; 126 }-*/; 127 128 // Implementation of the svg::SVGFitToViewBox W3C IDL interface 129 /** 130 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGFitToViewBox#getViewBox()} 131 * on the given element. 132 */ 133 public final native OMSVGAnimatedRect getViewBox() /*-{ 134 return this.viewBox; 135 }-*/; 136 /** 137 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGFitToViewBox#getPreserveAspectRatio()} 138 * on the given element. 139 */ 140 public final native OMSVGAnimatedPreserveAspectRatio getPreserveAspectRatio() /*-{ 141 return this.preserveAspectRatio; 142 }-*/; 143 144 // Implementation of the svg::SVGLangSpace W3C IDL interface 145 /** 146 * Corresponds to attribute <code>xml:lang</code> on the given element. 147 */ 148 public final native String getXmllang() /*-{ 149 return this.xmllang; 150 }-*/; 151 /** 152 * Corresponds to attribute <code>xml:lang</code> on the given element. 153 * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an attempt 154 * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only 155 * attribute</a>. 156 */ 157 public final native void setXmllang(String value) throws JavaScriptException /*-{ 158 this.xmllang = value; 159 }-*/; 160 /** 161 * Corresponds to attribute <code>xml:space</code> on the given element. 162 */ 163 public final native String getXmlspace() /*-{ 164 return this.xmlspace; 165 }-*/; 166 /** 167 * Corresponds to attribute <code>xml:space</code> on the given element. 168 * @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) Raised on an attempt 169 * to change the value of a <a href="svgdom.html#ReadOnlyNodes">read only 170 * attribute</a>. 171 */ 172 public final native void setXmlspace(String value) throws JavaScriptException /*-{ 173 this.xmlspace = value; 174 }-*/; 175 176 // Implementation of the svg::SVGTests W3C IDL interface 177 /** 178 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredFeatures()} 179 * on the given element. 180 */ 181 public final native OMSVGStringList getRequiredFeatures() /*-{ 182 return @org.vectomatic.dom.svg.OMNode::convertList(Lcom/google/gwt/core/client/JavaScriptObject;)(this.requiredFeatures); 183 }-*/; 184 /** 185 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getRequiredExtensions()} 186 * on the given element. 187 */ 188 public final native OMSVGStringList getRequiredExtensions() /*-{ 189 return @org.vectomatic.dom.svg.OMNode::convertList(Lcom/google/gwt/core/client/JavaScriptObject;)(this.requiredExtensions); 190 }-*/; 191 /** 192 * Corresponds to attribute {@link org.vectomatic.dom.svg.itf.ISVGTests#getSystemLanguage()} 193 * on the given element. 194 */ 195 public final native OMSVGStringList getSystemLanguage() /*-{ 196 return @org.vectomatic.dom.svg.OMNode::convertList(Lcom/google/gwt/core/client/JavaScriptObject;)(this.systemLanguage); 197 }-*/; 198 /** 199 * Returns true if the user agent supports the given extension, specified 200 * by a URI. 201 * @param extension The name of the extension, expressed as a URI. 202 * @return True or false, depending on whether the given extension is supported. 203 */ 204 public final native boolean hasExtension(String extension) /*-{ 205 return this.hasExtension(extension); 206 }-*/; 207 208 // Implementation of the svg::SVGURIReference W3C IDL interface 209 /** 210 * Corresponds to attribute <span class='attr-name'>'xlink:href'</span> on 211 * the given element. 212 */ 213 public final native OMSVGAnimatedString getHref() /*-{ 214 return this.href; 215 }-*/; 216 217 // Implementation of the svg::SVGUnitTypes W3C IDL interface 218 219 }