1 18 package org.apache.batik.transcoder.image; 19 20 import java.io.IOException ; 21 22 import org.w3c.dom.Document ; 23 24 import org.apache.batik.dom.svg.SAXSVGDocumentFactory; 25 import org.apache.batik.transcoder.TranscoderInput; 26 import org.apache.batik.util.XMLResourceDescriptor; 27 28 34 public class ParametrizedDOMTest extends AbstractImageTranscoderTest { 35 36 37 protected String inputURI; 38 39 40 protected String refImageURI; 41 42 48 public ParametrizedDOMTest(String inputURI, String refImageURI) { 49 this.inputURI = inputURI; 50 this.refImageURI = refImageURI; 51 } 52 53 56 protected TranscoderInput createTranscoderInput() { 57 try { 58 String parser = XMLResourceDescriptor.getXMLParserClassName(); 59 SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); 60 Document doc = f.createDocument(resolveURL(inputURI).toString()); 61 return new TranscoderInput(doc); 62 } catch (IOException ex) { 63 throw new IllegalArgumentException (inputURI); 64 } 65 } 66 67 70 protected byte [] getReferenceImageData() { 71 return createBufferedImageData(resolveURL(refImageURI)); 72 } 73 } 74 | Popular Tags |