diff options
Diffstat (limited to 'src/java/org/apache/fop/render')
15 files changed, 31 insertions, 32 deletions
diff --git a/src/java/org/apache/fop/render/Graphics2DImagePainter.java b/src/java/org/apache/fop/render/Graphics2DImagePainter.java index 6b4754720..e72fc1e46 100644 --- a/src/java/org/apache/fop/render/Graphics2DImagePainter.java +++ b/src/java/org/apache/fop/render/Graphics2DImagePainter.java @@ -24,6 +24,7 @@ package org.apache.fop.render; * a Graphics2D instance can implement this interface to paint themselves. * @deprecated use {@link org.apache.xmlgraphics.java2d.Graphics2DImagePainter} directly! */ +// @SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") public interface Graphics2DImagePainter extends org.apache.xmlgraphics.java2d.Graphics2DImagePainter { diff --git a/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java b/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java index 0067f8367..30b3af9dd 100644 --- a/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java +++ b/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java @@ -62,6 +62,15 @@ public class ImageProxyPanel extends JPanel { public ImageProxyPanel(AWTRenderer renderer, int page) { this.renderer = renderer; this.page = page; + try { + Dimension size = renderer.getPageImageSize(page); + Insets insets = getInsets(); + size.width += insets.left + insets.right; + size.height += insets.top + insets.bottom; + this.size = size; + } catch (Exception e) { + this.size = new Dimension(10, 10); + } // Allows single panel to appear behind page display. // Important for textured L&Fs. setOpaque(false); @@ -78,17 +87,6 @@ public class ImageProxyPanel extends JPanel { * @return the size of the page plus the border. */ public Dimension getPreferredSize() { - if (size == null) { - try { - Insets insets = getInsets(); - size = renderer.getPageImageSize(page); - size = new Dimension(size.width + insets.left + insets.right, - size.height + insets.top + insets.bottom); - } catch (FOPException fopEx) { - // Arbitary size. Doesn't really matter what's returned here. - return new Dimension(10, 10); - } - } return size; } @@ -96,7 +94,7 @@ public class ImageProxyPanel extends JPanel { * Sets the number of the page to be displayed and refreshes the display. * @param pg the page number */ - public void setPage(int pg) { + public synchronized void setPage(int pg) { if (page != pg) { page = pg; imageRef = null; diff --git a/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java b/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java index 53cd585c9..643c78b7c 100644 --- a/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java +++ b/src/java/org/apache/fop/render/awt/viewer/PreviewDialogAboutBox.java @@ -64,7 +64,7 @@ public class PreviewDialogAboutBox extends Dialog implements ActionListener { JPanel insetsPanel3 = new JPanel(); okButton = new JButton(); JLabel imageControl1 = new JLabel(); - imageControl1.setIcon(new ImageIcon(getClass().getResource("images/fop.gif"))); + imageControl1.setIcon(new ImageIcon(PreviewDialogAboutBox.class.getResource("images/fop.gif"))); JLabel label1 = new JLabel(translator.getString("About.Product")); JLabel label2 = new JLabel(translator.getString("About.Version") + " " + Version.getVersion()); diff --git a/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java b/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java index 36ded2f7f..93cc29e4f 100644 --- a/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java +++ b/src/java/org/apache/fop/render/awt/viewer/PreviewPanel.java @@ -320,7 +320,7 @@ public class PreviewPanel extends JPanel { // ***** MouseListener ***** - public void mousePressed(MouseEvent e) { + public synchronized void mousePressed(MouseEvent e) { startPosX = e.getX(); startPosY = e.getY(); } @@ -357,6 +357,7 @@ public class PreviewPanel extends JPanel { // This page intentionally left blank // Makes 0th/1st page on rhs gridPanel.add(new JLabel("")); + // @SuppressFBWarnings("SF_SWITCH_FALLTHROUGH") case CONTINUOUS: currentPage = 0; firstPage = 0; diff --git a/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java b/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java index e97c68bd1..16471fe9c 100644 --- a/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java +++ b/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java @@ -56,8 +56,8 @@ public class IFGraphicContext extends GraphicContext { /** * {@inheritDoc} */ + // @SuppressFBWarnings("CN_IDIOM_NO_SUPER_CALL") public Object clone() { - // FBOFF: CN_IDIOM_NO_SUPER_CALL return new IFGraphicContext(this); } diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java b/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java index 588d417fa..c3bf523d3 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java +++ b/src/java/org/apache/fop/render/java2d/Java2DGraphicsPainter.java @@ -261,11 +261,13 @@ class Java2DGraphicsPainter implements GraphicsPainter { closePath(); getG2D().fill(currentPath); currentPath = null; + break; case Constants.EN_NONE: // No rule is drawn break; default: + break; } // end switch restoreGraphicsState(); } diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java index ec837c65c..75957c396 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java +++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java @@ -893,11 +893,13 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem closePath(); state.getGraph().fill(currentPath); currentPath = null; + break; case EN_NONE: // No rule is drawn break; default: + break; } // end switch super.renderLeader(area); diff --git a/src/java/org/apache/fop/render/pcl/PCLGenerator.java b/src/java/org/apache/fop/render/pcl/PCLGenerator.java index 7b3878627..05045b7e7 100644 --- a/src/java/org/apache/fop/render/pcl/PCLGenerator.java +++ b/src/java/org/apache/fop/render/pcl/PCLGenerator.java @@ -715,6 +715,7 @@ public class PCLGenerator { boolean monochrome = isMonochromeImage(img); if (!monochrome) { //Transparency mask disabled. Doesn't work reliably + /* final boolean transparencyDisabled = true; RenderedImage mask = (transparencyDisabled ? null : getMask(img, effDim)); if (mask != null) { @@ -724,11 +725,12 @@ public class PCLGenerator { paintMonochromeBitmap(mask, effResolution); popCursorPos(); } + */ RenderedImage red = BitmapImageUtil.convertToMonochrome( img, effDim, this.ditheringQuality); selectCurrentPattern(0, 0); //Solid black - setTransparencyMode(sourceTransparency || mask != null, true); + setTransparencyMode(sourceTransparency /*|| mask != null*/, true); paintMonochromeBitmap(red, effResolution); } else { RenderedImage effImg = img; diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java index a71fe9417..13d61dc35 100644 --- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java +++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerSVG.java @@ -101,7 +101,6 @@ public class PDFImageHandlerSVG implements ImageHandler { GraphicsNode root; try { root = builder.build(ctx, clonedDoc); - builder = null; } catch (Exception e) { SVGEventProducer eventProducer = SVGEventProducer.Provider.get( context.getUserAgent().getEventBroadcaster()); diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java index b9784d69c..d487d3279 100644 --- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java +++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java @@ -147,7 +147,7 @@ public class NativeTextHandler implements PSTextHandler { final int l = text.length(); for (int i = 0; i < l; i++) { final char ch = text.charAt(i); - final char mch = this.font.mapChar(ch); + final char mch = font.mapChar(ch); PSGenerator.escapeChar(mch, target); } } @@ -157,13 +157,13 @@ public class NativeTextHandler implements PSTextHandler { } private void establishCurrentFont() throws IOException { - if ((currentFontName != this.font.getFontName()) - || (currentFontSize != this.font.getFontSize())) { + if (!currentFontName.equals(font.getFontName()) + || (currentFontSize != font.getFontSize())) { PSGenerator gen = getPSGenerator(); - gen.writeln("/" + this.font.getFontTriplet().getName() + " " + gen.writeln("/" + font.getFontTriplet().getName() + " " + gen.formatDouble(font.getFontSize() / 1000f) + " F"); - currentFontName = this.font.getFontName(); - currentFontSize = this.font.getFontSize(); + currentFontName = font.getFontName(); + currentFontSize = font.getFontSize(); } } diff --git a/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java b/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java index be479ec31..6d277f2f0 100644 --- a/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java +++ b/src/java/org/apache/fop/render/ps/PSImageHandlerSVG.java @@ -138,8 +138,6 @@ public class PSImageHandlerSVG implements ImageHandler { float sx = pos.width / w; float sy = pos.height / h; - ctx = null; - gen.commentln("%FOPBeginSVG"); gen.saveGraphicsState(); final boolean clip = false; diff --git a/src/java/org/apache/fop/render/ps/PSSVGHandler.java b/src/java/org/apache/fop/render/ps/PSSVGHandler.java index d6c47d84c..5e3fa1ca5 100644 --- a/src/java/org/apache/fop/render/ps/PSSVGHandler.java +++ b/src/java/org/apache/fop/render/ps/PSSVGHandler.java @@ -278,8 +278,6 @@ public class PSSVGHandler extends AbstractGenericSVGHandler float sx = psInfo.getWidth() / w; float sy = psInfo.getHeight() / h; - ctx = null; - try { gen.commentln("%FOPBeginSVG"); gen.saveGraphicsState(); diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index eeb1aff06..d9892ad83 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -1101,7 +1101,7 @@ public class RTFHandler extends FOEventHandler { } catch (ImageException ie) { ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get( getUserAgent().getEventBroadcaster()); - eventProducer.imageError(this, (info != null ? info.toString() : uri), ie, null); + eventProducer.imageError(this, uri, ie, null); } catch (FileNotFoundException fe) { ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get( getUserAgent().getEventBroadcaster()); diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java index 617ad2abc..4dfcd5bec 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageArea.java @@ -37,8 +37,6 @@ import java.io.Writer; public class RtfPageArea extends RtfContainer { private RtfPage currentPage; - private RtfNull nullChild; - private RtfAttributes childAttributes; /** Create an RTF element as a child of given container */ RtfPageArea(RtfFile f, Writer w) throws IOException { diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java index b0391e7cc..5a1615541 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java @@ -331,8 +331,8 @@ public class RtfTextrun extends RtfContainer { * @throws IOException for I/O problems */ public void addBookmark(String id) throws IOException { - if (id != "") { - // if id is not empty, add boormark + if (id.length() > 0) { + // if id is not empty, add bookmark new RtfBookmark(this, writer, id); } } |