1 18 package org.apache.batik.svggen; 19 20 import java.awt.Rectangle ; 21 import java.awt.image.BufferedImageOp ; 22 23 import org.w3c.dom.Element ; 24 25 33 public class SVGCustomBufferedImageOp extends AbstractSVGFilterConverter { 34 private static final String ERROR_EXTENSION = 35 "SVGCustomBufferedImageOp:: ExtensionHandler could not convert filter"; 36 37 41 public SVGCustomBufferedImageOp(SVGGeneratorContext generatorContext) { 42 super(generatorContext); 43 } 44 45 53 public SVGFilterDescriptor toSVG(BufferedImageOp filter, 54 Rectangle filterRect) { 55 SVGFilterDescriptor filterDesc = 56 (SVGFilterDescriptor)descMap.get(filter); 57 58 if (filterDesc == null) { 59 filterDesc = 62 generatorContext.extensionHandler. 63 handleFilter(filter, filterRect, generatorContext); 64 65 if (filterDesc != null) { 66 Element def = filterDesc.getDef(); 67 if(def != null) 68 defSet.add(def); 69 descMap.put(filter, filterDesc); 70 } else { 71 System.err.println(ERROR_EXTENSION); 72 } 73 } 74 75 return filterDesc; 76 } 77 78 } 79 80 | Popular Tags |