1 18 package org.apache.batik.dom.svg; 19 20 import org.apache.batik.dom.AbstractDocument; 21 import org.w3c.dom.Attr ; 22 import org.w3c.dom.Node ; 23 import org.w3c.dom.svg.SVGAnimatedLength; 24 import org.w3c.dom.svg.SVGRectElement; 25 26 32 public class SVGOMRectElement 33 extends SVGGraphicsElement 34 implements SVGRectElement { 35 36 39 protected SVGOMRectElement() { 40 } 41 42 47 public SVGOMRectElement(String prefix, AbstractDocument owner) { 48 super(prefix, owner); 49 } 50 51 54 public String getLocalName() { 55 return SVG_RECT_TAG; 56 } 57 58 61 public SVGAnimatedLength getX() { 62 return getAnimatedLengthAttribute 63 (null, SVG_X_ATTRIBUTE, SVG_RECT_X_DEFAULT_VALUE, 64 SVGOMAnimatedLength.HORIZONTAL_LENGTH); 65 } 66 67 70 public SVGAnimatedLength getY() { 71 return getAnimatedLengthAttribute 72 (null, SVG_Y_ATTRIBUTE, SVG_RECT_Y_DEFAULT_VALUE, 73 SVGOMAnimatedLength.VERTICAL_LENGTH); 74 } 75 76 79 public SVGAnimatedLength getWidth() { 80 return getAnimatedLengthAttribute 81 (null, SVG_WIDTH_ATTRIBUTE, "", 82 SVGOMAnimatedLength.HORIZONTAL_LENGTH); 83 } 84 85 88 public SVGAnimatedLength getHeight() { 89 return getAnimatedLengthAttribute 90 (null, SVG_HEIGHT_ATTRIBUTE, "", 91 SVGOMAnimatedLength.VERTICAL_LENGTH); 92 } 93 94 97 public SVGAnimatedLength getRx() { 98 SVGAnimatedLength result = 99 (SVGAnimatedLength)getLiveAttributeValue(null, SVG_RX_ATTRIBUTE); 100 if (result == null) { 101 result = new AbstractSVGAnimatedLength 102 (this, null, SVG_RX_ATTRIBUTE, 103 SVGOMAnimatedLength.HORIZONTAL_LENGTH) { 104 protected String getDefaultValue() { 105 Attr attr = getAttributeNodeNS(null, SVG_RY_ATTRIBUTE); 106 if (attr == null) { 107 return "0"; 108 } 109 return attr.getValue(); 110 } 111 }; 112 putLiveAttributeValue(null, SVG_RX_ATTRIBUTE, 113 (LiveAttributeValue)result); 114 } 115 return result; 116 } 117 118 121 public SVGAnimatedLength getRy() { 122 SVGAnimatedLength result = 123 (SVGAnimatedLength)getLiveAttributeValue(null, SVG_RY_ATTRIBUTE); 124 if (result == null) { 125 result = new AbstractSVGAnimatedLength 126 (this, null, SVG_RY_ATTRIBUTE, 127 SVGOMAnimatedLength.HORIZONTAL_LENGTH) { 128 protected String getDefaultValue() { 129 Attr attr = getAttributeNodeNS(null, SVG_RX_ATTRIBUTE); 130 if (attr == null) { 131 return "0"; 132 } 133 return attr.getValue(); 134 } 135 }; 136 putLiveAttributeValue(null, SVG_RY_ATTRIBUTE, 137 (LiveAttributeValue)result); 138 } 139 return result; 140 } 141 142 145 protected Node newNode() { 146 return new SVGOMRectElement(); 147 } 148 } 149 | Popular Tags |