1 18 19 package org.apache.tools.ant.taskdefs.optional; 20 21 22 import org.apache.batik.transcoder.Transcoder; 24 import org.apache.batik.apps.rasterizer.SVGConverterController; 25 import org.apache.batik.apps.rasterizer.SVGConverterSource; 26 27 import org.apache.tools.ant.Task; 29 30 import java.io.File ; 32 import java.util.Vector ; 33 import java.util.Map ; 34 35 36 51 public class RasterizerTaskSVGConverterController implements SVGConverterController { 52 53 55 protected Task executingTask = null; 56 57 58 62 protected RasterizerTaskSVGConverterController() { 63 } 64 65 70 public RasterizerTaskSVGConverterController(Task task) { 71 executingTask = task; 72 } 73 74 75 public boolean proceedWithComputedTask(Transcoder transcoder, 77 Map hints, 78 Vector sources, 79 Vector dest){ 80 return true; 81 } 82 83 public boolean proceedWithSourceTranscoding(SVGConverterSource source, 84 File dest) { 85 return true; 86 } 87 88 public boolean proceedOnSourceTranscodingFailure(SVGConverterSource source, 89 File dest, 90 String errorCode){ 91 if(executingTask != null) { 92 executingTask.log("Unable to rasterize image '" 93 + source.getName() + "' to '" 94 + dest.getAbsolutePath() + "': " + errorCode); 95 } 96 return true; 97 } 98 99 public void onSourceTranscodingSuccess(SVGConverterSource source, 100 File dest){ 101 } 102 103 } 104 | Popular Tags |