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.SVGAnimatedString; 27 import org.w3c.dom.svg.SVGAnimatedTransformList; 28 import org.w3c.dom.svg.SVGGradientElement; 29 30 36 public abstract class SVGOMGradientElement 37 extends SVGStylableElement 38 implements SVGGradientElement { 39 40 43 protected final static AttributeInitializer attributeInitializer; 44 static { 45 attributeInitializer = new AttributeInitializer(4); 46 attributeInitializer.addAttribute(XMLSupport.XMLNS_NAMESPACE_URI, 47 null, "xmlns:xlink", 48 XLinkSupport.XLINK_NAMESPACE_URI); 49 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 50 "xlink", "type", "simple"); 51 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 52 "xlink", "show", "other"); 53 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 54 "xlink", "actuate", "onLoad"); 55 } 56 57 60 protected final static String [] UNITS_VALUES = { 61 "", 62 SVG_USER_SPACE_ON_USE_VALUE, 63 SVG_OBJECT_BOUNDING_BOX_VALUE 64 }; 65 66 69 protected final static String [] SPREAD_METHOD_VALUES = { 70 "", 71 SVG_PAD_VALUE, 72 SVG_REFLECT_VALUE, 73 SVG_REPEAT_VALUE 74 }; 75 76 79 protected SVGOMGradientElement() { 80 } 81 82 87 protected SVGOMGradientElement(String prefix, AbstractDocument owner) { 88 super(prefix, owner); 89 } 90 91 95 public SVGAnimatedTransformList getGradientTransform() { 96 throw new RuntimeException (" !!! TODO: getGradientTransform()"); 97 } 98 99 103 public SVGAnimatedEnumeration getGradientUnits() { 104 return getAnimatedEnumerationAttribute 105 (null, SVG_GRADIENT_UNITS_ATTRIBUTE, UNITS_VALUES, 106 (short)2); 107 } 108 109 113 public SVGAnimatedEnumeration getSpreadMethod() { 114 return getAnimatedEnumerationAttribute 115 (null, SVG_SPREAD_METHOD_ATTRIBUTE, SPREAD_METHOD_VALUES, 116 (short)1); 117 } 118 119 123 public SVGAnimatedString getHref() { 124 return SVGURIReferenceSupport.getHref(this); 125 } 126 127 129 133 public SVGAnimatedBoolean getExternalResourcesRequired() { 134 return SVGExternalResourcesRequiredSupport. 135 getExternalResourcesRequired(this); 136 } 137 138 142 protected AttributeInitializer getAttributeInitializer() { 143 return attributeInitializer; 144 } 145 146 149 protected Node newNode() { 150 return new SVGOMAElement(); 151 } 152 } 153 | Popular Tags |