1 18 package org.apache.batik.dom.svg; 19 20 import org.apache.batik.util.SVGConstants; 21 import org.w3c.dom.svg.SVGAnimatedLengthList; 22 23 30 public class SVGTextPositioningElementSupport { 31 32 public final static String X_DEFAULT_VALUE 33 = ""; 34 public final static String Y_DEFAULT_VALUE 35 = ""; 36 public final static String DX_DEFAULT_VALUE 37 = ""; 38 public final static String DY_DEFAULT_VALUE 39 = ""; 40 41 45 public static SVGAnimatedLengthList getX(AbstractElement e){ 46 47 SVGOMAnimatedLengthList result =(SVGOMAnimatedLengthList) 48 e.getLiveAttributeValue(null, SVGConstants.SVG_X_ATTRIBUTE); 49 if (result == null) { 50 result = new SVGOMAnimatedLengthList(e, null, 51 SVGConstants.SVG_X_ATTRIBUTE, 52 X_DEFAULT_VALUE, 53 AbstractSVGLength.HORIZONTAL_LENGTH); 54 e.putLiveAttributeValue(null, 55 SVGConstants.SVG_X_ATTRIBUTE, result); 56 } 57 return result; 58 } 59 60 64 public static SVGAnimatedLengthList getY(AbstractElement e){ 65 66 SVGOMAnimatedLengthList result =(SVGOMAnimatedLengthList) 67 e.getLiveAttributeValue(null, SVGConstants.SVG_Y_ATTRIBUTE); 68 if (result == null) { 69 result = new SVGOMAnimatedLengthList(e, null, 70 SVGConstants.SVG_Y_ATTRIBUTE, 71 Y_DEFAULT_VALUE, 72 AbstractSVGLength.VERTICAL_LENGTH); 73 e.putLiveAttributeValue(null, 74 SVGConstants.SVG_Y_ATTRIBUTE, result); 75 } 76 return result; 77 } 78 79 83 public static SVGAnimatedLengthList getDx(AbstractElement e){ 84 85 SVGOMAnimatedLengthList result =(SVGOMAnimatedLengthList) 86 e.getLiveAttributeValue(null, SVGConstants.SVG_DX_ATTRIBUTE); 87 if (result == null) { 88 result = new SVGOMAnimatedLengthList(e, null, 89 SVGConstants.SVG_DX_ATTRIBUTE, 90 DX_DEFAULT_VALUE, 91 AbstractSVGLength.HORIZONTAL_LENGTH); 92 e.putLiveAttributeValue(null, 93 SVGConstants.SVG_DX_ATTRIBUTE, result); 94 } 95 return result; 96 } 97 98 102 public static SVGAnimatedLengthList getDy(AbstractElement e){ 103 104 SVGOMAnimatedLengthList result =(SVGOMAnimatedLengthList) 105 e.getLiveAttributeValue(null, SVGConstants.SVG_DY_ATTRIBUTE); 106 if (result == null) { 107 result = new SVGOMAnimatedLengthList(e, null, 108 SVGConstants.SVG_DY_ATTRIBUTE, 109 DY_DEFAULT_VALUE, 110 AbstractSVGLength.VERTICAL_LENGTH); 111 e.putLiveAttributeValue(null, 112 SVGConstants.SVG_DY_ATTRIBUTE, result); 113 } 114 return result; 115 } 116 } 117 | Popular Tags |