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 34 public class SVGCompositeDescriptor implements SVGDescriptor, SVGSyntax{ 35 private Element def; 36 private String opacityValue; 37 private String filterValue; 38 39 public SVGCompositeDescriptor(String opacityValue, 40 String filterValue){ 41 this.opacityValue = opacityValue; 42 this.filterValue = filterValue; 43 } 44 45 public SVGCompositeDescriptor(String opacityValue, 46 String filterValue, 47 Element def){ 48 this(opacityValue, filterValue); 49 this.def = def; 50 } 51 52 public String getOpacityValue(){ 53 return opacityValue; 54 } 55 56 public String getFilterValue(){ 57 return filterValue; 58 } 59 60 public Element getDef(){ 61 return def; 62 } 63 64 public Map getAttributeMap(Map attrMap) { 65 if(attrMap == null) 66 attrMap = new HashMap (); 67 68 attrMap.put(SVG_OPACITY_ATTRIBUTE, opacityValue); 69 attrMap.put(SVG_FILTER_ATTRIBUTE, filterValue); 70 71 return attrMap; 72 } 73 74 public List getDefinitionSet(List defSet) { 75 if (defSet == null) 76 defSet = new LinkedList (); 77 78 if (def != null) 79 defSet.add(def); 80 81 return defSet; 82 } 83 } 84 | Popular Tags |