1 18 package org.apache.batik.dom.svg; 19 20 import org.apache.batik.dom.AbstractDocument; 21 import org.apache.batik.dom.util.XLinkSupport; 22 import org.apache.batik.dom.util.XMLSupport; 23 import org.w3c.dom.Node ; 24 import org.w3c.dom.svg.SVGAnimatedBoolean; 25 import org.w3c.dom.svg.SVGAnimatedEnumeration; 26 import org.w3c.dom.svg.SVGAnimatedInteger; 27 import org.w3c.dom.svg.SVGAnimatedLength; 28 import org.w3c.dom.svg.SVGAnimatedString; 29 import org.w3c.dom.svg.SVGFilterElement; 30 31 37 public class SVGOMFilterElement 38 extends SVGStylableElement 39 implements SVGFilterElement { 40 41 44 protected final static AttributeInitializer attributeInitializer; 45 static { 46 attributeInitializer = new AttributeInitializer(4); 47 attributeInitializer.addAttribute(XMLSupport.XMLNS_NAMESPACE_URI, 48 null, "xmlns:xlink", 49 XLinkSupport.XLINK_NAMESPACE_URI); 50 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 51 "xlink", "type", "simple"); 52 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 53 "xlink", "show", "other"); 54 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 55 "xlink", "actuate", "onLoad"); 56 } 57 58 61 protected final static String [] UNITS_VALUES = { 62 "", 63 SVG_USER_SPACE_ON_USE_VALUE, 64 SVG_OBJECT_BOUNDING_BOX_VALUE 65 }; 66 67 70 protected SVGOMFilterElement() { 71 } 72 73 78 public SVGOMFilterElement(String prefix, AbstractDocument owner) { 79 super(prefix, owner); 80 } 81 82 85 public String getLocalName() { 86 return SVG_FILTER_TAG; 87 } 88 89 92 public SVGAnimatedEnumeration getFilterUnits() { 93 return getAnimatedEnumerationAttribute 94 (null, SVG_FILTER_UNITS_ATTRIBUTE, UNITS_VALUES, 95 (short)2); 96 } 97 98 101 public SVGAnimatedEnumeration getPrimitiveUnits() { 102 return getAnimatedEnumerationAttribute 103 (null, SVG_PRIMITIVE_UNITS_ATTRIBUTE, UNITS_VALUES, 104 (short)1); 105 } 106 107 110 public SVGAnimatedLength getX() { 111 return getAnimatedLengthAttribute 112 (null, SVG_X_ATTRIBUTE, SVG_FILTER_X_DEFAULT_VALUE, 113 SVGOMAnimatedLength.HORIZONTAL_LENGTH); 114 } 115 116 119 public SVGAnimatedLength getY() { 120 return getAnimatedLengthAttribute 121 (null, SVG_Y_ATTRIBUTE, SVG_FILTER_Y_DEFAULT_VALUE, 122 SVGOMAnimatedLength.VERTICAL_LENGTH); 123 } 124 125 128 public SVGAnimatedLength getWidth() { 129 return getAnimatedLengthAttribute 130 (null, SVG_WIDTH_ATTRIBUTE, SVG_FILTER_WIDTH_DEFAULT_VALUE, 131 SVGOMAnimatedLength.HORIZONTAL_LENGTH); 132 } 133 134 137 public SVGAnimatedLength getHeight() { 138 return getAnimatedLengthAttribute 139 (null, SVG_HEIGHT_ATTRIBUTE, SVG_FILTER_HEIGHT_DEFAULT_VALUE, 140 SVGOMAnimatedLength.VERTICAL_LENGTH); 141 } 142 143 146 public SVGAnimatedInteger getFilterResX() { 147 throw new RuntimeException (" !!! TODO: getFilterResX()"); 148 } 149 150 153 public SVGAnimatedInteger getFilterResY() { 154 throw new RuntimeException (" !!! TODO: getFilterResY()"); 155 } 156 157 160 public void setFilterRes(int filterResX, int filterResY) { 161 throw new RuntimeException (" !!! TODO: setFilterRes()"); 162 } 163 164 166 169 public SVGAnimatedString getHref() { 170 return SVGURIReferenceSupport.getHref(this); 171 } 172 173 175 179 public SVGAnimatedBoolean getExternalResourcesRequired() { 180 return SVGExternalResourcesRequiredSupport. 181 getExternalResourcesRequired(this); 182 } 183 184 186 189 public String getXMLlang() { 190 return XMLSupport.getXMLLang(this); 191 } 192 193 196 public void setXMLlang(String lang) { 197 setAttributeNS(XMLSupport.XML_NAMESPACE_URI, 198 XMLSupport.XML_LANG_ATTRIBUTE, 199 lang); 200 } 201 202 205 public String getXMLspace() { 206 return XMLSupport.getXMLSpace(this); 207 } 208 209 212 public void setXMLspace(String space) { 213 setAttributeNS(XMLSupport.XML_NAMESPACE_URI, 214 XMLSupport.XML_SPACE_ATTRIBUTE, 215 space); 216 } 217 218 222 protected AttributeInitializer getAttributeInitializer() { 223 return attributeInitializer; 224 } 225 226 229 protected Node newNode() { 230 return new SVGOMFilterElement(); 231 } 232 } 233 | Popular Tags |