1 18 package org.apache.batik.svggen; 19 20 import java.util.HashMap ; 21 import java.util.LinkedList ; 22 import java.util.List ; 23 import java.util.Map ; 24 25 import org.w3c.dom.Element ; 26 27 35 public class SVGClipDescriptor implements SVGDescriptor, SVGSyntax{ 36 private String clipPathValue; 37 private Element clipPathDef; 38 39 44 public SVGClipDescriptor(String clipPathValue, Element clipPathDef){ 45 if (clipPathValue == null) 46 throw new SVGGraphics2DRuntimeException(ErrorConstants.ERR_CLIP_NULL); 47 48 this.clipPathValue = clipPathValue; 49 this.clipPathDef = clipPathDef; 50 } 51 52 60 public Map getAttributeMap(Map attrMap) { 61 if (attrMap == null) 62 attrMap = new HashMap (); 63 64 attrMap.put(SVG_CLIP_PATH_ATTRIBUTE, clipPathValue); 65 66 return attrMap; 67 } 68 69 70 79 public List getDefinitionSet(List defSet) { 80 if (defSet == null) 81 defSet = new LinkedList (); 82 83 if (clipPathDef != null) 84 defSet.add(clipPathDef); 85 86 return defSet; 87 } 88 } 89 | Popular Tags |