diff options
author | Glen Mazza <gmazza@apache.org> | 2004-05-12 23:19:53 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-05-12 23:19:53 +0000 |
commit | f6064f69f4c9c001d9ab0db3d82f00e92a4359b0 (patch) | |
tree | f3729a95932f2a42c07bba8bd380a63a6a354578 /src/java/org/apache/fop/render/pdf | |
parent | 240bcc0c6d3af5ce0e8f9d2c2ca40f0d546f5b9f (diff) | |
download | xmlgraphics-fop-f6064f69f4c9c001d9ab0db3d82f00e92a4359b0.tar.gz xmlgraphics-fop-f6064f69f4c9c001d9ab0db3d82f00e92a4359b0.zip |
Removed the getLogger() and setLogger() from FOUserAgent; replaced with Commons Logging
equivalents in places where previously used.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197591 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/pdf')
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFRenderer.java | 14 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/pdf/PDFXMLHandler.java | 20 |
2 files changed, 22 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index ed35a16fe..5debef993 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -594,7 +594,7 @@ public class PDFRenderer extends PrintRenderer { if (back.getURL() != null) { ImageFactory fact = ImageFactory.getInstance(); FopImage fopimage = fact.getImage(back.getURL(), userAgent); - if (fopimage != null && fopimage.load(FopImage.DIMENSIONS, userAgent.getLogger())) { + if (fopimage != null && fopimage.load(FopImage.DIMENSIONS)) { if (back.getRepeat() == BackgroundRepeat.REPEAT) { // create a pattern for the image } else { @@ -1118,12 +1118,12 @@ public class PDFRenderer extends PrintRenderer { if (fopimage == null) { return; } - if (!fopimage.load(FopImage.DIMENSIONS, userAgent.getLogger())) { + if (!fopimage.load(FopImage.DIMENSIONS)) { return; } String mime = fopimage.getMimeType(); if ("text/xml".equals(mime)) { - if (!fopimage.load(FopImage.ORIGINAL_DATA, userAgent.getLogger())) { + if (!fopimage.load(FopImage.ORIGINAL_DATA)) { return; } Document doc = ((XMLImage) fopimage).getDocument(); @@ -1131,7 +1131,7 @@ public class PDFRenderer extends PrintRenderer { renderDocument(doc, ns, pos); } else if ("image/svg+xml".equals(mime)) { - if (!fopimage.load(FopImage.ORIGINAL_DATA, userAgent.getLogger())) { + if (!fopimage.load(FopImage.ORIGINAL_DATA)) { return; } Document doc = ((XMLImage) fopimage).getDocument(); @@ -1139,14 +1139,14 @@ public class PDFRenderer extends PrintRenderer { renderDocument(doc, ns, pos); } else if ("image/eps".equals(mime)) { - if (!fopimage.load(FopImage.ORIGINAL_DATA, userAgent.getLogger())) { + if (!fopimage.load(FopImage.ORIGINAL_DATA)) { return; } FopPDFImage pdfimage = new FopPDFImage(fopimage, url); int xobj = pdfDoc.addImage(currentContext, pdfimage).getXNumber(); fact.releaseImage(url, userAgent); } else if ("image/jpeg".equals(mime)) { - if (!fopimage.load(FopImage.ORIGINAL_DATA, userAgent.getLogger())) { + if (!fopimage.load(FopImage.ORIGINAL_DATA)) { return; } FopPDFImage pdfimage = new FopPDFImage(fopimage, url); @@ -1158,7 +1158,7 @@ public class PDFRenderer extends PrintRenderer { placeImage((int) pos.getX() / 1000, (int) pos.getY() / 1000, w, h, xobj); } else { - if (!fopimage.load(FopImage.BITMAP, userAgent.getLogger())) { + if (!fopimage.load(FopImage.BITMAP)) { return; } FopPDFImage pdfimage = new FopPDFImage(fopimage, url); diff --git a/src/java/org/apache/fop/render/pdf/PDFXMLHandler.java b/src/java/org/apache/fop/render/pdf/PDFXMLHandler.java index 38d28e90b..a1debb513 100644 --- a/src/java/org/apache/fop/render/pdf/PDFXMLHandler.java +++ b/src/java/org/apache/fop/render/pdf/PDFXMLHandler.java @@ -32,8 +32,13 @@ import org.apache.fop.svg.PDFGraphics2D; import org.apache.fop.svg.SVGUserAgent; import org.apache.fop.fonts.FontInfo; +// Commons-Logging +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + + /* org.w3c.dom.Document is not imported to avoid conflict with - org.apache.fop.control.Document */ + org.apache.fop.apps.Document */ import java.io.OutputStream; @@ -55,6 +60,12 @@ import java.awt.geom.AffineTransform; * The properties from the PDF renderer are subject to change. */ public class PDFXMLHandler implements XMLHandler { + + /** + * logging instance + */ + private Log log = LogFactory.getLog(PDFXMLHandler.class); + /** * The PDF document that is being drawn into. */ @@ -220,8 +231,7 @@ public class PDFXMLHandler implements XMLHandler { int yOffset = pdfInfo.currentYPosition; SVGUserAgent ua - = new SVGUserAgent(context.getUserAgent().getLogger(), - context.getUserAgent().getPixelUnitToMillimeter(), + = new SVGUserAgent(context.getUserAgent().getPixelUnitToMillimeter(), new AffineTransform()); GVTBuilder builder = new GVTBuilder(); @@ -240,7 +250,7 @@ public class PDFXMLHandler implements XMLHandler { try { root = builder.build(ctx, doc); } catch (Exception e) { - context.getUserAgent().getLogger().error("svg graphic could not be built: " + log.error("svg graphic could not be built: " + e.getMessage(), e); return; } @@ -298,7 +308,7 @@ public class PDFXMLHandler implements XMLHandler { root.paint(graphics); pdfInfo.currentStream.add(graphics.getString()); } catch (Exception e) { - context.getUserAgent().getLogger().error("svg graphic could not be rendered: " + log.error("svg graphic could not be rendered: " + e.getMessage(), e); } |