1 18 package org.apache.batik.svggen; 19 20 import java.awt.Paint ; 21 22 import org.apache.batik.ext.awt.g2d.GraphicContext; 23 import org.w3c.dom.Element ; 24 25 33 public class SVGCustomPaint extends AbstractSVGConverter { 34 37 public SVGCustomPaint(SVGGeneratorContext generatorContext) { 38 super(generatorContext); 39 } 40 41 51 public SVGDescriptor toSVG(GraphicContext gc) { 52 return toSVG(gc.getPaint()); 53 } 54 55 61 public SVGPaintDescriptor toSVG(Paint paint) { 62 SVGPaintDescriptor paintDesc = (SVGPaintDescriptor)descMap.get(paint); 63 64 if (paintDesc == null) { 65 paintDesc = 68 generatorContext.extensionHandler. 69 handlePaint(paint, 70 generatorContext); 71 72 if (paintDesc != null) { 73 Element def = paintDesc.getDef(); 74 if(def != null) defSet.add(def); 75 descMap.put(paint, paintDesc); 76 } 77 } 78 79 return paintDesc; 80 } 81 } 82 | Popular Tags |