diff options
Diffstat (limited to 'src/java/org/apache/fop/render/java2d')
9 files changed, 30 insertions, 22 deletions
diff --git a/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java b/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java index 29570e69f..fb88b8bce 100644 --- a/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java +++ b/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java @@ -95,7 +95,7 @@ public class ConfiguredFontCollection implements FontCollection { fontInfo.addMetrics(internalName, font); - List triplets = configFontInfo.getFontTriplets(); + List<FontTriplet> triplets = configFontInfo.getFontTriplets(); for (int c = 0; c < triplets.size(); c++) { FontTriplet triplet = (FontTriplet) triplets.get(c); diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java index 1d9d7d56e..6540d6e37 100644 --- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java +++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java @@ -16,6 +16,7 @@ */ /* $Id$ */ + package org.apache.fop.render.java2d; import java.awt.Font; @@ -29,6 +30,7 @@ import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import org.apache.fop.fonts.CustomFont; +import org.apache.fop.fonts.FontMetrics; import org.apache.fop.fonts.FontType; import org.apache.fop.fonts.LazyFont; import org.apache.fop.fonts.Typeface; @@ -36,7 +38,7 @@ import org.apache.fop.fonts.Typeface; /** * FontMetricsMapper that delegates most methods to an underlying * {@link FontMetrics} instance. This class was designed to allow - * the underlying {@link java.awt.Font} to be loaded from a + * the underlying {@link Font} to be loaded from a * user-configured file not registered in the current graphics environment. */ public class CustomFontMetricsMapper extends Typeface implements FontMetricsMapper { @@ -159,7 +161,7 @@ public class CustomFontMetricsMapper extends Typeface implements FontMetricsMapp } /** {@inheritDoc} */ - public final Set getFamilyNames() { + public final Set<String> getFamilyNames() { return typeface.getFamilyNames(); } diff --git a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java index 17073dd6c..806a07d6c 100644 --- a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java +++ b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java @@ -28,7 +28,7 @@ import org.apache.fop.fonts.FontMetrics; public interface FontMetricsMapper extends FontMetrics { /** - * Gets a {@link Font} instance of the font that this + * Gets a {@link java.awt.Font} instance of the font that this * {@link FontMetrics} describes in the desired size. * @param size font size * @return font with the desired characteristics. diff --git a/src/java/org/apache/fop/render/java2d/Java2DBorderPainter.java b/src/java/org/apache/fop/render/java2d/Java2DBorderPainter.java index c5e0a3f5c..b2b29188b 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DBorderPainter.java +++ b/src/java/org/apache/fop/render/java2d/Java2DBorderPainter.java @@ -47,6 +47,10 @@ public class Java2DBorderPainter extends BorderPainter { private GeneralPath currentPath = null; + /** + * Construct a java2d border painter. + * @param painter a painter + */ public Java2DBorderPainter(Java2DPainter painter) { this.painter = painter; } @@ -60,7 +64,8 @@ public class Java2DBorderPainter extends BorderPainter { } /** {@inheritDoc} */ - protected void drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, + protected void drawBorderLine( // CSOK: ParameterNumber + int x1, int y1, int x2, int y2, boolean horz, boolean startOrBefore, int style, Color color) { float w = x2 - x1; float h = y2 - y1; diff --git a/src/java/org/apache/fop/render/java2d/Java2DImageHandlerRenderedImage.java b/src/java/org/apache/fop/render/java2d/Java2DImageHandlerRenderedImage.java index c29684118..4bdd52162 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DImageHandlerRenderedImage.java +++ b/src/java/org/apache/fop/render/java2d/Java2DImageHandlerRenderedImage.java @@ -27,6 +27,7 @@ import java.awt.image.RenderedImage; import java.awt.image.WritableRaster; import java.io.IOException; +import org.apache.xmlgraphics.image.GraphicsConstants; import org.apache.xmlgraphics.image.loader.Image; import org.apache.xmlgraphics.image.loader.ImageFlavor; import org.apache.xmlgraphics.image.loader.ImageInfo; @@ -76,7 +77,7 @@ public class Java2DImageHandlerRenderedImage implements ImageHandler { //scaling because of image resolution //float sourceResolution = java2dContext.getUserAgent().getSourceResolution(); //source resolution seems to be a bad idea, not sure why - float sourceResolution = 72; + float sourceResolution = GraphicsConstants.DEFAULT_DPI; sourceResolution *= 1000; //we're working in the millipoint area sx *= sourceResolution / info.getSize().getDpiHorizontal(); sy *= sourceResolution / info.getSize().getDpiVertical(); diff --git a/src/java/org/apache/fop/render/java2d/Java2DPainter.java b/src/java/org/apache/fop/render/java2d/Java2DPainter.java index a2b9c9613..396645768 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DPainter.java +++ b/src/java/org/apache/fop/render/java2d/Java2DPainter.java @@ -33,9 +33,6 @@ import java.util.Stack; import org.w3c.dom.Document; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontTriplet; @@ -54,9 +51,6 @@ import org.apache.fop.util.CharUtilities; */ public class Java2DPainter extends AbstractIFPainter { - /** logging instance */ - private static Log log = LogFactory.getLog(Java2DPainter.class); - /** the IF context */ protected IFContext ifContext; diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java index 4cb0c988e..353aefa25 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java +++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java @@ -53,6 +53,7 @@ import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D; import org.apache.xmlgraphics.image.loader.impl.ImageRendered; import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM; import org.apache.xmlgraphics.image.loader.util.ImageUtil; +import org.apache.xmlgraphics.util.UnitConv; import org.apache.fop.ResourceEventProducer; import org.apache.fop.apps.FOPException; @@ -317,10 +318,10 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem } scaleX = scaleX - * (25.4f / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION) + * (UnitConv.IN2MM / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION) / userAgent.getTargetPixelUnitToMillimeter(); scaleY = scaleY - * (25.4f / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION) + * (UnitConv.IN2MM / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION) / userAgent.getTargetPixelUnitToMillimeter(); int bitmapWidth = (int) ((pageWidth * scaleX) + 0.5); int bitmapHeight = (int) ((pageHeight * scaleY) + 0.5); @@ -536,7 +537,8 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem } /** {@inheritDoc} */ - protected void drawBorderLine(float x1, float y1, float x2, float y2, + protected void drawBorderLine( // CSOK: ParameterNumber + float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, Color col) { Graphics2D g2d = state.getGraph(); float width = x2 - x1; diff --git a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java index de987af25..4c20a8959 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java +++ b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java @@ -81,16 +81,17 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler */ public static class Java2DInfo { /** see Java2D_STATE */ - public Java2DGraphicsState state; + public Java2DGraphicsState state; // CSOK: VisibilityModifier /** see Java2D_WIDTH */ - public int width; + public int width; // CSOK: VisibilityModifier /** see Java2D_HEIGHT */ - public int height; + public int height; // CSOK: VisibilityModifier /** see Java2D_XPOS */ - public int currentXPosition; + public int currentXPosition; // CSOK: VisibilityModifier /** see Java2D_YPOS */ - public int currentYPosition; - public boolean paintAsBitmap; + public int currentYPosition; // CSOK: VisibilityModifier + /** paint as bitmap */ + public boolean paintAsBitmap; // CSOK: VisibilityModifier /** {@inheritDoc} */ public String toString() { diff --git a/src/java/org/apache/fop/render/java2d/Java2DUtil.java b/src/java/org/apache/fop/render/java2d/Java2DUtil.java index aa2be78e0..7e11ab263 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DUtil.java +++ b/src/java/org/apache/fop/render/java2d/Java2DUtil.java @@ -30,7 +30,10 @@ import org.apache.fop.fonts.FontManager; /** * Rendering-related utilities for Java2D. */ -public class Java2DUtil { +public final class Java2DUtil { + + private Java2DUtil() { + } /** * Builds a default {@link FontInfo} object for use with output formats using the Java2D |