1 18 package org.apache.batik.svggen; 19 20 import java.awt.Composite ; 21 22 import org.apache.batik.ext.awt.g2d.GraphicContext; 23 import org.w3c.dom.Element ; 24 25 33 public class SVGCustomComposite extends AbstractSVGConverter { 34 37 public SVGCustomComposite(SVGGeneratorContext generatorContext) { 38 super(generatorContext); 39 } 40 41 51 public SVGDescriptor toSVG(GraphicContext gc) { 52 return toSVG(gc.getComposite()); 53 } 54 55 60 public SVGCompositeDescriptor toSVG(Composite composite) { 61 if (composite == null) 62 throw new NullPointerException (); 63 SVGCompositeDescriptor compositeDesc = 64 (SVGCompositeDescriptor)descMap.get(composite); 65 66 if (compositeDesc == null) { 67 SVGCompositeDescriptor desc = 70 generatorContext. 71 extensionHandler.handleComposite(composite, 72 generatorContext); 73 74 if (desc != null) { 75 Element def = desc.getDef(); 76 if(def != null) 77 defSet.add(def); 78 descMap.put(composite, desc); 79 } 80 } 81 82 return compositeDesc; 83 } 84 } 85 | Popular Tags |