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.DOMException ; 24 import org.w3c.dom.Node ; 25 import org.w3c.dom.svg.SVGAnimatedBoolean; 26 import org.w3c.dom.svg.SVGScriptElement; 27 28 34 public class SVGOMScriptElement 35 extends SVGOMURIReferenceElement 36 implements SVGScriptElement { 37 38 41 protected final static AttributeInitializer attributeInitializer; 42 static { 43 attributeInitializer = new AttributeInitializer(1); 44 attributeInitializer.addAttribute(XMLSupport.XMLNS_NAMESPACE_URI, 45 null, "xmlns:xlink", 46 XLinkSupport.XLINK_NAMESPACE_URI); 47 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 48 "xlink", "type", "simple"); 49 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 50 "xlink", "show", "other"); 51 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 52 "xlink", "actuate", "onLoad"); 53 } 54 55 58 protected SVGOMScriptElement() { 59 } 60 61 66 public SVGOMScriptElement(String prefix, AbstractDocument owner) { 67 super(prefix, owner); 68 69 } 70 71 74 public String getLocalName() { 75 return SVG_SCRIPT_TAG; 76 } 77 78 81 public String getType() { 82 return getAttributeNS(null, SVG_TYPE_ATTRIBUTE); 83 } 84 85 88 public void setType(String type) throws DOMException { 89 setAttributeNS(null, SVG_TYPE_ATTRIBUTE, type); 90 } 91 92 94 98 public SVGAnimatedBoolean getExternalResourcesRequired() { 99 return SVGExternalResourcesRequiredSupport. 100 getExternalResourcesRequired(this); 101 } 102 103 107 protected AttributeInitializer getAttributeInitializer() { 108 return attributeInitializer; 109 } 110 111 114 protected Node newNode() { 115 return new SVGOMScriptElement(); 116 } 117 } 118 | Popular Tags |