Revision: 11808
http://sourceforge.net/p/foray/code/11808
Author: victormote
Date: 2021-01-17 17:40:35 +0000 (Sun, 17 Jan 2021)
Log Message:
-----------
Remove some unnecessary logging and logger passing.
Modified Paths:
--------------
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfGraphics2D.java
trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/SvgPdf.java
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java 2021-01-17 15:25:28 UTC (rev 11807)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/SvgGraphic.java 2021-01-17 17:40:35 UTC (rev 11808)
@@ -53,8 +53,7 @@
/**
* An SVG Graphic.
*/
-public class SvgGraphic extends Graphic4a
- implements org.axsl.graphic.SvgGraphic {
+public class SvgGraphic extends Graphic4a implements org.axsl.graphic.SvgGraphic {
/** The encapsulated SVG document. */
private SVGDocument doc;
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfGraphics2D.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfGraphics2D.java 2021-01-17 15:25:28 UTC (rev 11807)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/batik/PdfGraphics2D.java 2021-01-17 17:40:35 UTC (rev 11808)
@@ -47,7 +47,7 @@
import org.axsl.graphic.output.GraphicOutputContext;
import org.axsl.pdf.PdfPage;
-import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
@@ -156,9 +156,6 @@
/** Used to create proper font metrics. */
private Graphics2D fmg;
- /** The logger. */
- private Logger logger;
-
/** The PDF context. */
private GraphicOutputContext pdfContext;
@@ -175,20 +172,16 @@
* This is used to create a Graphics object for use inside an already existing document.
* @param textAsShapes Set this to true so that text will be rendered using curves and not the font.
* @param fontConsumer The font consumer for this document.
- * @param logger The logger.
* @param pdfContext The PDF context in which this content is being written.
* @param outputStream The output stream to which this processor writes its PDF output.
*/
- public PdfGraphics2D(final boolean textAsShapes,
- final FontConsumer fontConsumer, final Logger logger,
- final GraphicOutputContext pdfContext,
- final OutputStream outputStream) {
+ public PdfGraphics2D(final boolean textAsShapes, final FontConsumer fontConsumer,
+ final GraphicOutputContext pdfContext, final OutputStream outputStream) {
super(textAsShapes);
/* TODO: Only write the comments if running in debug mode?? */
this.currentStream = new CharacterOutputStream(outputStream, true);
this.comment("%%%% Start FOrayGraphic SVG-to-PDF conversion. %%%%");
- this.logger = logger;
this.fontConsumer = fontConsumer;
this.pdfContext = pdfContext;
this.graphicsStateStack.push(new PdfGraphicsState(null));
@@ -200,7 +193,6 @@
*/
public PdfGraphics2D(final PdfGraphics2D g) {
super(g);
- this.logger = g.logger;
}
/**
@@ -639,15 +631,11 @@
}
@Override
- public void drawRenderedImage(final RenderedImage img,
- final AffineTransform xform) {
- this.logger.info("drawRenderedImage");
+ public void drawRenderedImage(final RenderedImage img, final AffineTransform xform) {
}
@Override
- public void drawRenderableImage(final RenderableImage img,
- final AffineTransform xform) {
- this.logger.info("drawRenderableImage");
+ public void drawRenderableImage(final RenderableImage img, final AffineTransform xform) {
}
@Override
@@ -734,10 +722,9 @@
}
@Override
- public void drawString(final AttributedCharacterIterator iterator,
- final float x, final float y) {
- this.logger.error(
- "drawString(AttributedCharacterIterator)");
+ public void drawString(final AttributedCharacterIterator iterator, final float x, final float y) {
+ LoggerFactory.getLogger(this.getClass()).error("drawString(AttributedCharacterIterator)");
+ /* TODO: This method may not ever be called, as we never see the above error logged. Investigate further. */
final Shape imclip = getClip();
writeClip(imclip);
@@ -885,14 +872,11 @@
@Override
public void setXORMode(final Color c1) {
- this.logger.info("setXORMode");
}
@Override
- public void copyArea(final int x, final int y, final int width,
- final int height, final int dx, final int dy) {
- this.logger.info("copyArea");
+ public void copyArea(final int x, final int y, final int width, final int height, final int dx, final int dy) {
}
/**
Modified: trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/SvgPdf.java
===================================================================
--- trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/SvgPdf.java 2021-01-17 15:25:28 UTC (rev 11807)
+++ trunk/foray/foray-graphic/src/main/java/org/foray/graphic/output/SvgPdf.java 2021-01-17 17:40:35 UTC (rev 11808)
@@ -133,7 +133,7 @@
builder = null;
final PdfGraphics2D graphics;
- graphics = new PdfGraphics2D(true, fontConsumer, this.svg.getLogger(), pdfContext, outputStream);
+ graphics = new PdfGraphics2D(true, fontConsumer, pdfContext, outputStream);
graphics.setGraphicContext(new org.apache.batik.ext.awt.g2d.GraphicContext());
root.paint(graphics);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|