1 18 package org.apache.batik.dom.svg; 19 20 import org.w3c.dom.Attr ; 21 import org.w3c.dom.DOMException ; 22 import org.w3c.dom.svg.SVGAnimatedInteger; 23 24 30 public class SVGOMAnimatedInteger 31 implements SVGAnimatedInteger, 32 LiveAttributeValue { 33 34 37 protected AbstractElement element; 38 39 42 protected String namespaceURI; 43 44 47 protected String localName; 48 49 52 protected int defaultValue; 53 54 61 public SVGOMAnimatedInteger(AbstractElement elt, 62 String ns, 63 String ln, 64 int val) { 65 element = elt; 66 namespaceURI = ns; 67 localName = ln; 68 defaultValue = val; 69 } 70 71 74 public int getBaseVal() { 75 Attr attr = element.getAttributeNodeNS(namespaceURI, localName); 76 if (attr == null) { 77 return defaultValue; 78 } 79 return Integer.parseInt(attr.getValue()); 80 } 81 82 85 public void setBaseVal(int baseVal) throws DOMException { 86 element.setAttributeNS(namespaceURI, localName, 87 String.valueOf(baseVal)); 88 } 89 90 93 public int getAnimVal() { 94 throw new RuntimeException ("!!! TODO: getAnimVal()"); 95 } 96 97 100 public void attrAdded(Attr node, String newv) { 101 } 102 103 106 public void attrModified(Attr node, String oldv, String newv) { 107 } 108 109 112 public void attrRemoved(Attr node, String oldv) { 113 } 114 } 115 | Popular Tags |