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.SVGAnimatedEnumeration; 25 import org.w3c.dom.svg.SVGAnimatedLength; 26 import org.w3c.dom.svg.SVGAnimatedString; 27 import org.w3c.dom.svg.SVGTextPathElement; 28 29 35 public class SVGOMTextPathElement 36 extends SVGOMTextContentElement 37 implements SVGTextPathElement { 38 39 42 protected final static AttributeInitializer attributeInitializer; 43 static { 44 attributeInitializer = new AttributeInitializer(4); 45 attributeInitializer.addAttribute(XMLSupport.XMLNS_NAMESPACE_URI, 46 null, "xmlns:xlink", 47 XLinkSupport.XLINK_NAMESPACE_URI); 48 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 49 "xlink", "type", "simple"); 50 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 51 "xlink", "show", "other"); 52 attributeInitializer.addAttribute(XLinkSupport.XLINK_NAMESPACE_URI, 53 "xlink", "actuate", "onLoad"); 54 } 55 56 59 protected final static String [] METHOD_VALUES = { 60 "", 61 SVG_ALIGN_VALUE, 62 SVG_STRETCH_VALUE 63 }; 64 65 68 protected final static String [] SPACING_VALUES = { 69 "", 70 SVG_AUTO_VALUE, 71 SVG_EXACT_VALUE 72 }; 73 74 77 protected SVGOMTextPathElement() { 78 } 79 80 85 public SVGOMTextPathElement(String prefix, AbstractDocument owner) { 86 super(prefix, owner); 87 } 88 89 92 public String getLocalName() { 93 return SVG_TEXT_PATH_TAG; 94 } 95 96 99 public SVGAnimatedLength getStartOffset() { 100 return getAnimatedLengthAttribute 101 (null, SVG_START_OFFSET_ATTRIBUTE, 102 SVG_TEXT_PATH_START_OFFSET_DEFAULT_VALUE, 103 SVGOMAnimatedLength.OTHER_LENGTH); 104 } 105 106 109 public SVGAnimatedEnumeration getMethod() { 110 return getAnimatedEnumerationAttribute 111 (null, SVG_METHOD_ATTRIBUTE, METHOD_VALUES, (short)1); 112 } 113 114 117 public SVGAnimatedEnumeration getSpacing() { 118 return getAnimatedEnumerationAttribute 119 (null, SVG_SPACING_ATTRIBUTE, SPACING_VALUES, (short)2); 120 } 121 122 123 125 129 public SVGAnimatedString getHref() { 130 return SVGURIReferenceSupport.getHref(this); 131 } 132 133 137 protected AttributeInitializer getAttributeInitializer() { 138 return attributeInitializer; 139 } 140 141 144 protected Node newNode() { 145 return new SVGOMTextPathElement(); 146 } 147 } 148 | Popular Tags |