1 18 package org.apache.batik.dom.svg; 19 20 import org.apache.batik.dom.AbstractDocument; 21 import org.apache.batik.dom.util.XMLSupport; 22 import org.w3c.dom.Node ; 23 import org.w3c.dom.svg.SVGAngle; 24 import org.w3c.dom.svg.SVGAnimatedAngle; 25 import org.w3c.dom.svg.SVGAnimatedBoolean; 26 import org.w3c.dom.svg.SVGAnimatedEnumeration; 27 import org.w3c.dom.svg.SVGAnimatedLength; 28 import org.w3c.dom.svg.SVGAnimatedPreserveAspectRatio; 29 import org.w3c.dom.svg.SVGAnimatedRect; 30 import org.w3c.dom.svg.SVGMarkerElement; 31 32 38 public class SVGOMMarkerElement 39 extends SVGStylableElement 40 implements SVGMarkerElement { 41 42 45 protected final static AttributeInitializer attributeInitializer; 46 static { 47 attributeInitializer = new AttributeInitializer(1); 48 attributeInitializer.addAttribute(null, 49 null, 50 SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE, 51 "xMidYMid meet"); 52 } 53 54 57 protected final static String [] UNITS_VALUES = { 58 "", 59 SVG_USER_SPACE_ON_USE_VALUE, 60 SVG_STROKE_WIDTH_ATTRIBUTE 61 }; 62 63 66 protected SVGOMMarkerElement() { 67 } 68 69 74 public SVGOMMarkerElement(String prefix, AbstractDocument owner) { 75 super(prefix, owner); 76 } 77 78 81 public String getLocalName() { 82 return SVG_MARKER_TAG; 83 } 84 85 88 public SVGAnimatedLength getRefX() { 89 return getAnimatedLengthAttribute 90 (null, SVG_REF_X_ATTRIBUTE, SVG_MARKER_REF_X_DEFAULT_VALUE, 91 SVGOMAnimatedLength.HORIZONTAL_LENGTH); 92 } 93 94 97 public SVGAnimatedLength getRefY() { 98 return getAnimatedLengthAttribute 99 (null, SVG_REF_Y_ATTRIBUTE, SVG_MARKER_REF_Y_DEFAULT_VALUE, 100 SVGOMAnimatedLength.VERTICAL_LENGTH); 101 } 102 103 106 public SVGAnimatedEnumeration getMarkerUnits() { 107 return getAnimatedEnumerationAttribute 108 (null, SVG_MARKER_UNITS_ATTRIBUTE, UNITS_VALUES, 109 (short)2); 110 } 111 112 115 public SVGAnimatedLength getMarkerWidth() { 116 return getAnimatedLengthAttribute 117 (null, SVG_MARKER_WIDTH_ATTRIBUTE, 118 SVG_MARKER_MARKER_WIDTH_DEFAULT_VALUE, 119 SVGOMAnimatedLength.HORIZONTAL_LENGTH); 120 } 121 122 125 public SVGAnimatedLength getMarkerHeight() { 126 return getAnimatedLengthAttribute 127 (null, SVG_MARKER_HEIGHT_ATTRIBUTE, 128 SVG_MARKER_MARKER_HEIGHT_DEFAULT_VALUE, 129 SVGOMAnimatedLength.VERTICAL_LENGTH); 130 } 131 132 135 public SVGAnimatedEnumeration getOrientType() { 136 throw new RuntimeException (" !!! TODO: getOrientType()"); 137 } 138 139 142 public SVGAnimatedAngle getOrientAngle() { 143 throw new RuntimeException (" !!! TODO: getOrientAngle()"); 144 } 145 146 149 public void setOrientToAuto() { 150 throw new RuntimeException (" !!! TODO: setOrientToAuto()"); 151 } 152 153 157 public void setOrientToAngle(SVGAngle angle) { 158 throw new RuntimeException (" !!! TODO: setOrientToAngle()"); 159 } 160 161 163 167 public SVGAnimatedRect getViewBox() { 168 throw new RuntimeException (" !!! TODO: getViewBox()"); 169 } 170 171 175 public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio() { 176 return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); 177 } 178 179 181 185 public SVGAnimatedBoolean getExternalResourcesRequired() { 186 return SVGExternalResourcesRequiredSupport. 187 getExternalResourcesRequired(this); 188 } 189 190 192 195 public String getXMLlang() { 196 return XMLSupport.getXMLLang(this); 197 } 198 199 202 public void setXMLlang(String lang) { 203 setAttributeNS(XMLSupport.XML_NAMESPACE_URI, 204 XMLSupport.XML_LANG_ATTRIBUTE, 205 lang); 206 } 207 208 211 public String getXMLspace() { 212 return XMLSupport.getXMLSpace(this); 213 } 214 215 218 public void setXMLspace(String space) { 219 setAttributeNS(XMLSupport.XML_NAMESPACE_URI, 220 XMLSupport.XML_SPACE_ATTRIBUTE, 221 space); 222 } 223 224 228 protected AttributeInitializer getAttributeInitializer() { 229 return attributeInitializer; 230 } 231 232 235 protected Node newNode() { 236 return new SVGOMMarkerElement(); 237 } 238 } 239 | Popular Tags |