diff options
author | Jeremias Maerki <jeremias@apache.org> | 2010-08-14 17:17:00 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2010-08-14 17:17:00 +0000 |
commit | 29e8badcec8bd40eca2ef4940133f08eeefdda11 (patch) | |
tree | 7b44a2d058ae8a60ff278f5d26f243eb674e54c6 /src/java | |
parent | c81729764a0692e9f5e31ec28722403b603ee5aa (diff) | |
download | xmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.tar.gz xmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.zip |
Bugzilla #49733:
Resolved compilation (safe one), Checkstyle and many Javadoc warnings.
Submitted by: Glenn Adams <glenn.at.skynav.com>
Changes to patch:
- Restored the deprecated Graphics2DAdapter method (to be removed after Barcode4J 2.1 is released).
- Restored Renderer.startPageSequence(LineArea) pending discussion about removal.
- build.xml: set max VM to 1024MB instead of 2048MB to allow for 32-bit JVMs.
- build.xml: restored longer taskdef names.
- Restored Checkstyle 4 file for people running older IDEs.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@985537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
378 files changed, 3602 insertions, 1693 deletions
diff --git a/src/java/org/apache/fop/ResourceEventProducer.java b/src/java/org/apache/fop/ResourceEventProducer.java index a87b2d0ec..926b7c92b 100644 --- a/src/java/org/apache/fop/ResourceEventProducer.java +++ b/src/java/org/apache/fop/ResourceEventProducer.java @@ -39,7 +39,10 @@ public interface ResourceEventProducer extends EventProducer { /** * Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/afp/AFPBorderPainter.java b/src/java/org/apache/fop/afp/AFPBorderPainter.java index 85046dbed..958a955b8 100644 --- a/src/java/org/apache/fop/afp/AFPBorderPainter.java +++ b/src/java/org/apache/fop/afp/AFPBorderPainter.java @@ -40,7 +40,7 @@ public class AFPBorderPainter extends AbstractAFPPainter { } /** {@inheritDoc} */ - public void paint(PaintingInfo paintInfo) { + public void paint(PaintingInfo paintInfo) { // CSOK: MethodLength BorderPaintingInfo borderPaintInfo = (BorderPaintingInfo)paintInfo; float w = borderPaintInfo.getX2() - borderPaintInfo.getX1(); float h = borderPaintInfo.getY2() - borderPaintInfo.getY1(); @@ -60,6 +60,7 @@ public class AFPBorderPainter extends AbstractAFPPainter { float y2 = unitConv.pt2units(borderPaintInfo.getY2()); switch (paintingState.getRotation()) { + default: case 0: x1 += at.getTranslateX(); y1 += at.getTranslateY(); @@ -89,8 +90,8 @@ public class AFPBorderPainter extends AbstractAFPPainter { AFPLineDataInfo lineDataInfo = new AFPLineDataInfo(); lineDataInfo.setColor(borderPaintInfo.getColor()); lineDataInfo.setRotation(paintingState.getRotation()); - lineDataInfo.x1 = Math.round(x1); - lineDataInfo.y1 = Math.round(y1); + lineDataInfo.setX1 ( Math.round(x1) ); + lineDataInfo.setY1 ( Math.round(y1) ); float thickness; if (borderPaintInfo.isHorizontal()) { thickness = y2 - y1; @@ -105,83 +106,91 @@ public class AFPBorderPainter extends AbstractAFPPainter { int thickness3 = (int)Math.floor(thickness / 3f); lineDataInfo.setThickness(thickness3); if (borderPaintInfo.isHorizontal()) { - lineDataInfo.x2 = Math.round(x2); - lineDataInfo.y2 = lineDataInfo.y1; + lineDataInfo.setX2 ( Math.round(x2) ); + lineDataInfo.setY2 ( lineDataInfo.getY1() ); dataStream.createLine(lineDataInfo); int distance = thickness3 * 2; lineDataInfo = new AFPLineDataInfo(lineDataInfo); - lineDataInfo.y1 += distance; - lineDataInfo.y2 += distance; + lineDataInfo.setY1 ( lineDataInfo.getY1() + distance ); + lineDataInfo.setY2 ( lineDataInfo.getY2() + distance ); dataStream.createLine(lineDataInfo); } else { - lineDataInfo.x2 = lineDataInfo.x1; - lineDataInfo.y2 = Math.round(y2); + lineDataInfo.setX2 ( lineDataInfo.getX1() ); + lineDataInfo.setY2 ( Math.round(y2) ); dataStream.createLine(lineDataInfo); int distance = thickness3 * 2; lineDataInfo = new AFPLineDataInfo(lineDataInfo); - lineDataInfo.x1 += distance; - lineDataInfo.x2 += distance; + lineDataInfo.setX1 ( lineDataInfo.getX1() + distance ); + lineDataInfo.setX2 ( lineDataInfo.getX2() + distance ); dataStream.createLine(lineDataInfo); } break; case Constants.EN_DASHED: - int thick = lineDataInfo.thickness * 3; + int thick = lineDataInfo.getThickness() * 3; if (borderPaintInfo.isHorizontal()) { - lineDataInfo.x2 = lineDataInfo.x1 + thick; - lineDataInfo.y2 = lineDataInfo.y1; + lineDataInfo.setX2 ( lineDataInfo.getX1() + thick ); + lineDataInfo.setY2 ( lineDataInfo.getY1() ); int ex2 = Math.round(x2); - while (lineDataInfo.x1 + thick < ex2) { + while (lineDataInfo.getX1() + thick < ex2) { dataStream.createLine(lineDataInfo); - lineDataInfo.x1 += 2 * thick; - lineDataInfo.x2 = lineDataInfo.x1 + thick; + lineDataInfo.setX1 ( lineDataInfo.getX1() + 2 * thick ); + lineDataInfo.setX2 ( lineDataInfo.getX1() + thick ); } } else { - lineDataInfo.x2 = lineDataInfo.x1; - lineDataInfo.y2 = lineDataInfo.y1 + thick; + lineDataInfo.setX2 ( lineDataInfo.getX1() ); + lineDataInfo.setY2 ( lineDataInfo.getY1() + thick ); int ey2 = Math.round(y2); - while (lineDataInfo.y1 + thick < ey2) { + while (lineDataInfo.getY1() + thick < ey2) { dataStream.createLine(lineDataInfo); - lineDataInfo.y1 += 2 * thick; - lineDataInfo.y2 = lineDataInfo.y1 + thick; + lineDataInfo.setY1 ( lineDataInfo.getY1() + 2 * thick ); + lineDataInfo.setY2 ( lineDataInfo.getY1() + thick ); } } break; case Constants.EN_DOTTED: if (borderPaintInfo.isHorizontal()) { - lineDataInfo.x2 = lineDataInfo.x1 + lineDataInfo.thickness; - lineDataInfo.y2 = lineDataInfo.y1; + lineDataInfo.setX2 ( lineDataInfo.getX1() + lineDataInfo.getThickness() ); + lineDataInfo.setY2 ( lineDataInfo.getY1() ); int ex2 = Math.round(x2); - while (lineDataInfo.x1 + lineDataInfo.thickness < ex2) { + while (lineDataInfo.getX1() + lineDataInfo.getThickness() < ex2) { dataStream.createLine(lineDataInfo); - lineDataInfo.x1 += 3 * lineDataInfo.thickness; - lineDataInfo.x2 = lineDataInfo.x1 + lineDataInfo.thickness; + lineDataInfo.setX1 ( lineDataInfo.getX1() + 3 * lineDataInfo.getThickness() ); + lineDataInfo.setX2 ( lineDataInfo.getX1() + lineDataInfo.getThickness() ); } } else { - lineDataInfo.x2 = lineDataInfo.x1; - lineDataInfo.y2 = lineDataInfo.y1 + lineDataInfo.thickness; + lineDataInfo.setX2 ( lineDataInfo.getX1() ); + lineDataInfo.setY2 ( lineDataInfo.getY1() + lineDataInfo.getThickness() ); int ey2 = Math.round(y2); - while (lineDataInfo.y1 + lineDataInfo.thickness < ey2) { + while (lineDataInfo.getY1() + lineDataInfo.getThickness() < ey2) { dataStream.createLine(lineDataInfo); - lineDataInfo.y1 += 3 * lineDataInfo.thickness; - lineDataInfo.y2 = lineDataInfo.y1 + lineDataInfo.thickness; + lineDataInfo.setY1 ( lineDataInfo.getY1() + 3 * lineDataInfo.getThickness() ); + lineDataInfo.setY2 ( lineDataInfo.getY1() + lineDataInfo.getThickness() ); } } break; case Constants.EN_GROOVE: case Constants.EN_RIDGE: //TODO - lineDataInfo.x2 = Math.round(x2); + int yNew; + lineDataInfo.setX2 ( Math.round(x2) ); float colFactor = (borderPaintInfo.getStyle() == Constants.EN_GROOVE ? 0.4f : -0.4f); float h3 = (y2 - y1) / 3; - lineDataInfo.color = ColorUtil.lightenColor(borderPaintInfo.getColor(), -colFactor); - lineDataInfo.thickness = Math.round(h3); - lineDataInfo.y1 = lineDataInfo.y2 = Math.round(y1); + lineDataInfo.setColor + ( ColorUtil.lightenColor(borderPaintInfo.getColor(), -colFactor) ); + lineDataInfo.setThickness ( Math.round(h3) ); + yNew = Math.round(y1); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); dataStream.createLine(lineDataInfo); - lineDataInfo.color = borderPaintInfo.getColor(); - lineDataInfo.y1 = lineDataInfo.y2 = Math.round(y1 + h3); + lineDataInfo.setColor ( borderPaintInfo.getColor() ); + yNew = Math.round(y1 + h3); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); dataStream.createLine(lineDataInfo); - lineDataInfo.color = ColorUtil.lightenColor(borderPaintInfo.getColor(), colFactor); - lineDataInfo.y1 = lineDataInfo.y2 = Math.round(y1 + h3 + h3); + lineDataInfo.setColor ( ColorUtil.lightenColor(borderPaintInfo.getColor(), colFactor) ); + yNew = Math.round(y1 + h3 + h3); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); dataStream.createLine(lineDataInfo); break; case Constants.EN_HIDDEN: @@ -191,11 +200,11 @@ public class AFPBorderPainter extends AbstractAFPPainter { case Constants.EN_SOLID: default: if (borderPaintInfo.isHorizontal()) { - lineDataInfo.x2 = Math.round(x2); - lineDataInfo.y2 = lineDataInfo.y1; + lineDataInfo.setX2 ( Math.round(x2) ); + lineDataInfo.setY2 ( lineDataInfo.getY1() ); } else { - lineDataInfo.x2 = lineDataInfo.x1; - lineDataInfo.y2 = Math.round(y2); + lineDataInfo.setX2 ( lineDataInfo.getX1() ); + lineDataInfo.setY2 ( Math.round(y2) ); } dataStream.createLine(lineDataInfo); } diff --git a/src/java/org/apache/fop/afp/AFPDataObjectInfo.java b/src/java/org/apache/fop/afp/AFPDataObjectInfo.java index 158189b76..66ef8e595 100644 --- a/src/java/org/apache/fop/afp/AFPDataObjectInfo.java +++ b/src/java/org/apache/fop/afp/AFPDataObjectInfo.java @@ -29,7 +29,8 @@ import org.apache.fop.afp.modca.triplets.MappingOptionTriplet; * A list of parameters associated with an AFP data objects */ public class AFPDataObjectInfo { - private static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp"); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** the object area info */ private AFPObjectAreaInfo objectAreaInfo; @@ -197,9 +198,9 @@ public class AFPDataObjectInfo { } /** - * Sets the data width resolution + * Sets the data height resolution * - * @param dataWidthRes the data width resolution + * @param dataHeightRes the data height resolution */ public void setDataHeightRes(int dataHeightRes) { this.dataHeightRes = dataHeightRes; diff --git a/src/java/org/apache/fop/afp/AFPEventProducer.java b/src/java/org/apache/fop/afp/AFPEventProducer.java index 6e6cb529e..87f978add 100644 --- a/src/java/org/apache/fop/afp/AFPEventProducer.java +++ b/src/java/org/apache/fop/afp/AFPEventProducer.java @@ -28,7 +28,10 @@ import org.apache.fop.events.EventProducer; public interface AFPEventProducer extends EventProducer { /** Provider class for the event producer. */ - class Provider { + static final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java index fa9c0d7bf..5fa6bae2d 100644 --- a/src/java/org/apache/fop/afp/AFPGraphics2D.java +++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java @@ -75,7 +75,7 @@ import org.apache.fop.svg.NativeImageHandler; */ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHandler { - private static final Log log = LogFactory.getLog(AFPGraphics2D.class); + private static final Log log = LogFactory.getLog(AFPGraphics2D.class); // CSOK: ConstantName private static final int X = 0; diff --git a/src/java/org/apache/fop/afp/AFPLineDataInfo.java b/src/java/org/apache/fop/afp/AFPLineDataInfo.java index a056ebf1f..108b98596 100644 --- a/src/java/org/apache/fop/afp/AFPLineDataInfo.java +++ b/src/java/org/apache/fop/afp/AFPLineDataInfo.java @@ -25,25 +25,25 @@ import java.awt.Color; public class AFPLineDataInfo { /** the x1 coordinate */ - int x1; + private int x1; /** the y1 coordinate */ - int y1; + private int y1; /** the x2 coordinate */ - int x2; + private int x2; /** the y2 coordinate */ - int y2; + private int y2; /** the thickness */ - int thickness; + private int thickness; /** the painting color */ - Color color; + private Color color; /** the rotation */ - int rotation = 0; + private int rotation = 0; /** * Default constructor diff --git a/src/java/org/apache/fop/afp/AFPRectanglePainter.java b/src/java/org/apache/fop/afp/AFPRectanglePainter.java index 5b79a3f57..7b8a616da 100644 --- a/src/java/org/apache/fop/afp/AFPRectanglePainter.java +++ b/src/java/org/apache/fop/afp/AFPRectanglePainter.java @@ -42,6 +42,7 @@ public class AFPRectanglePainter extends AbstractAFPPainter { RectanglePaintingInfo rectanglePaintInfo = (RectanglePaintingInfo)paintInfo; int pageWidth = dataStream.getCurrentPage().getWidth(); int pageHeight = dataStream.getCurrentPage().getHeight(); + int yNew; AFPUnitConverter unitConv = paintingState.getUnitConverter(); float width = unitConv.pt2units(rectanglePaintInfo.getWidth()); @@ -52,31 +53,39 @@ public class AFPRectanglePainter extends AbstractAFPPainter { AffineTransform at = paintingState.getData().getTransform(); AFPLineDataInfo lineDataInfo = new AFPLineDataInfo(); - lineDataInfo.color = paintingState.getColor(); - lineDataInfo.rotation = paintingState.getRotation(); - lineDataInfo.thickness = Math.round(height); + lineDataInfo.setColor ( paintingState.getColor() ); + lineDataInfo.setRotation ( paintingState.getRotation() ); + lineDataInfo.setThickness ( Math.round(height) ); - switch (lineDataInfo.rotation) { + switch (lineDataInfo.getRotation()) { + default: case 0: - lineDataInfo.x1 = Math.round((float)at.getTranslateX() + x); - lineDataInfo.y1 = lineDataInfo.y2 = Math.round((float)at.getTranslateY() + y); - lineDataInfo.x2 = Math.round((float)at.getTranslateX() + x + width); + lineDataInfo.setX1 ( Math.round((float)at.getTranslateX() + x) ); + yNew = Math.round((float)at.getTranslateY() + y); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); + lineDataInfo.setX2 ( Math.round((float)at.getTranslateX() + x + width) ); break; case 90: - lineDataInfo.x1 = Math.round((float)at.getTranslateY() + x); - lineDataInfo.y1 = lineDataInfo.y2 - = pageWidth - Math.round((float)at.getTranslateX()) + Math.round(y); - lineDataInfo.x2 = Math.round(width + (float)at.getTranslateY() + x); + lineDataInfo.setX1 ( Math.round((float)at.getTranslateY() + x) ); + yNew = pageWidth - Math.round((float)at.getTranslateX()) + Math.round(y); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); + lineDataInfo.setX2 ( Math.round(width + (float)at.getTranslateY() + x) ); break; case 180: - lineDataInfo.x1 = pageWidth - Math.round((float)at.getTranslateX() - x); - lineDataInfo.y1 = lineDataInfo.y2 = pageHeight - Math.round((float)at.getTranslateY() - y); - lineDataInfo.x2 = pageWidth - Math.round((float)at.getTranslateX() - x - width); + lineDataInfo.setX1 ( pageWidth - Math.round((float)at.getTranslateX() - x) ); + yNew = pageHeight - Math.round((float)at.getTranslateY() - y); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); + lineDataInfo.setX2 ( pageWidth - Math.round((float)at.getTranslateX() - x - width) ); break; case 270: - lineDataInfo.x1 = pageHeight - Math.round((float)at.getTranslateY() - x); - lineDataInfo.y1 = lineDataInfo.y2 = Math.round((float)at.getTranslateX() + y); - lineDataInfo.x2 = pageHeight - Math.round((float)at.getTranslateY() - x - width); + lineDataInfo.setX1 ( pageHeight - Math.round((float)at.getTranslateY() - x) ); + yNew = Math.round((float)at.getTranslateX() + y); + lineDataInfo.setY1 ( yNew ); + lineDataInfo.setY2 ( yNew ); + lineDataInfo.setX2 ( pageHeight - Math.round((float)at.getTranslateY() - x - width) ); break; } dataStream.createLine(lineDataInfo); diff --git a/src/java/org/apache/fop/afp/AFPStreamer.java b/src/java/org/apache/fop/afp/AFPStreamer.java index 7e208bb6e..a24e90cbf 100644 --- a/src/java/org/apache/fop/afp/AFPStreamer.java +++ b/src/java/org/apache/fop/afp/AFPStreamer.java @@ -39,7 +39,7 @@ import org.apache.fop.afp.modca.StreamedResourceGroup; */ public class AFPStreamer implements Streamable { /** Static logging instance */ - private static final Log log = LogFactory.getLog(AFPStreamer.class); + private static final Log log = LogFactory.getLog(AFPStreamer.class); // CSOK: ConstantName private static final String AFPDATASTREAM_TEMP_FILE_PREFIX = "AFPDataStream_"; diff --git a/src/java/org/apache/fop/afp/AbstractAFPPainter.java b/src/java/org/apache/fop/afp/AbstractAFPPainter.java index 1358f8072..e0da25ff9 100644 --- a/src/java/org/apache/fop/afp/AbstractAFPPainter.java +++ b/src/java/org/apache/fop/afp/AbstractAFPPainter.java @@ -32,7 +32,9 @@ public abstract class AbstractAFPPainter { /** Static logging instance */ protected static Log log = LogFactory.getLog("org.apache.xmlgraphics.afp"); + /** data stream */ protected final DataStream dataStream; + /** painting state */ protected final AFPPaintingState paintingState; /** diff --git a/src/java/org/apache/fop/afp/DataStream.java b/src/java/org/apache/fop/afp/DataStream.java index 110fd2773..096c2e60e 100644 --- a/src/java/org/apache/fop/afp/DataStream.java +++ b/src/java/org/apache/fop/afp/DataStream.java @@ -65,7 +65,8 @@ import org.apache.fop.fonts.Font; public class DataStream { /** Static logging instance */ - protected static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp"); + protected static final Log log // CSOK: ConstantName + = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** Boolean completion indicator */ private boolean complete = false; @@ -359,8 +360,9 @@ public class DataStream { * @param charSet is the AFP Character Set to use with the text * @throws UnsupportedEncodingException thrown if character encoding is not supported */ - public void createText(final AFPTextDataInfo textDataInfo, final int letterSpacing, final int wordSpacing, - final Font font, final CharacterSet charSet) throws UnsupportedEncodingException { + public void createText + ( final AFPTextDataInfo textDataInfo, final int letterSpacing, final int wordSpacing, + final Font font, final CharacterSet charSet) throws UnsupportedEncodingException { int rotation = paintingState.getRotation(); if (rotation != 0) { textDataInfo.setRotation(rotation); diff --git a/src/java/org/apache/fop/afp/Factory.java b/src/java/org/apache/fop/afp/Factory.java index 9d9b83875..f29453cf5 100644 --- a/src/java/org/apache/fop/afp/Factory.java +++ b/src/java/org/apache/fop/afp/Factory.java @@ -66,7 +66,7 @@ import org.apache.fop.afp.util.StringUtils; public class Factory { /** Static logging instance */ - private static final Log log = LogFactory.getLog(Factory.class); + private static final Log log = LogFactory.getLog(Factory.class); // CSOK: ConstantName private static final String OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX = "OEG"; @@ -541,7 +541,10 @@ public class Factory { /** * Creates a new PTOCA {@link PresentationTextDescriptor} - * + * @param width presentation width + * @param height presentation height + * @param widthRes resolution of presentation width + * @param heightRes resolution of presentation height * @return a new {@link PresentationTextDescriptor} */ public PresentationTextDescriptor createPresentationTextDataDescriptor( diff --git a/src/java/org/apache/fop/afp/Startable.java b/src/java/org/apache/fop/afp/Startable.java index fd05b8455..62995d4d5 100644 --- a/src/java/org/apache/fop/afp/Startable.java +++ b/src/java/org/apache/fop/afp/Startable.java @@ -27,7 +27,7 @@ public interface Startable { /** * Sets whether or not this object has started or not * - * @param complete true if this object has started + * @param started true if this object has started */ void setStarted(boolean started); diff --git a/src/java/org/apache/fop/afp/fonts/CharacterSet.java b/src/java/org/apache/fop/afp/fonts/CharacterSet.java index fec2e6741..22cb52d4d 100644 --- a/src/java/org/apache/fop/afp/fonts/CharacterSet.java +++ b/src/java/org/apache/fop/afp/fonts/CharacterSet.java @@ -102,7 +102,8 @@ public class CharacterSet { * @param encoding the encoding of the font * @param name the character set name * @param path the path to the installed afp fonts - * @deprecated Please use {@link #CharacterSet(String, String, String, URI)} instead. + * @deprecated Please use + * {@link #CharacterSet(String, String, String, ResourceAccessor)} instead. */ public CharacterSet(String codePage, String encoding, String name, String path) { this(codePage, encoding, name, diff --git a/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java b/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java index 7d2c46bc6..d575e2ae1 100644 --- a/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java +++ b/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java @@ -114,8 +114,9 @@ public class CharacterSetBuilder { */ private final SoftMapCache characterSetsCache = new SoftMapCache(true); - - private CharacterSetBuilder() { } + /** Default constructor. */ + protected CharacterSetBuilder() { + } /** * Factory method for the single-byte implementation of AFPFontReader. diff --git a/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java b/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java index 84e4b7a69..b7246f35b 100644 --- a/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java +++ b/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java @@ -279,7 +279,7 @@ public class CharacterSetOrientation { * Returns the space increment. * @return the space increment */ - public int getSpaceIncrement(){ + public int getSpaceIncrement() { return this.spaceIncrement; } @@ -295,7 +295,7 @@ public class CharacterSetOrientation { * Returns the em space increment. * @return the em space increment */ - public int getEmSpaceIncrement(){ + public int getEmSpaceIncrement() { return this.emSpaceIncrement; } diff --git a/src/java/org/apache/fop/afp/fonts/DoubleByteFont.java b/src/java/org/apache/fop/afp/fonts/DoubleByteFont.java index 9f5dcbcf7..4514eac5d 100644 --- a/src/java/org/apache/fop/afp/fonts/DoubleByteFont.java +++ b/src/java/org/apache/fop/afp/fonts/DoubleByteFont.java @@ -36,7 +36,7 @@ public class DoubleByteFont extends AbstractOutlineFont { private static final Set IDEOGRAPHIC = new java.util.HashSet(); static { IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS); - //IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT); //Java 1.5 + //IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT);//Java 1.5 IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS); IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A); //IDEOGRAPHIC.add(Character.UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B); //Java 1.1 diff --git a/src/java/org/apache/fop/afp/fonts/OutlineFont.java b/src/java/org/apache/fop/afp/fonts/OutlineFont.java index 26488e54d..d4fd0624d 100644 --- a/src/java/org/apache/fop/afp/fonts/OutlineFont.java +++ b/src/java/org/apache/fop/afp/fonts/OutlineFont.java @@ -24,7 +24,11 @@ package org.apache.fop.afp.fonts; */ public class OutlineFont extends AbstractOutlineFont { - /** {@inheritDoc} */ + /** + * Construct outline font with specified name and character set. + * @param name font's name + * @param charSet font's character set + */ public OutlineFont(String name, CharacterSet charSet) { super(name, charSet); } diff --git a/src/java/org/apache/fop/afp/fonts/RasterFont.java b/src/java/org/apache/fop/afp/fonts/RasterFont.java index cba608471..6ad5375bf 100644 --- a/src/java/org/apache/fop/afp/fonts/RasterFont.java +++ b/src/java/org/apache/fop/afp/fonts/RasterFont.java @@ -37,7 +37,8 @@ import org.apache.commons.logging.LogFactory; public class RasterFont extends AFPFont { /** Static logging instance */ - protected static final Log log = LogFactory.getLog("org.apache.fop.afp.fonts"); + protected static final Log log // CSOK: ConstantName + = LogFactory.getLog("org.apache.fop.afp.fonts"); private final SortedMap/*<Integer,CharacterSet>*/ charSets = new java.util.TreeMap/*<Integer,CharacterSet>*/(); diff --git a/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java b/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java index 3c3442def..f5db5ce46 100644 --- a/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java +++ b/src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java @@ -32,6 +32,7 @@ public abstract class AbstractGraphicsCoord extends AbstractGraphicsDrawingOrder /** array of x/y coordinates */ protected int[] coords = null; + /** if true, then uses relative drawing order */ protected boolean relative = false; /** @@ -51,7 +52,7 @@ public abstract class AbstractGraphicsCoord extends AbstractGraphicsDrawingOrder * Constructor * * @param coords the x/y coordinates for this object - * @param relative + * @param relative true if relative drawing order */ public AbstractGraphicsCoord(int[] coords, boolean relative) { this(coords); diff --git a/src/java/org/apache/fop/afp/goca/GraphicsCharacterString.java b/src/java/org/apache/fop/afp/goca/GraphicsCharacterString.java index 6d6e44c97..dc61f1034 100644 --- a/src/java/org/apache/fop/afp/goca/GraphicsCharacterString.java +++ b/src/java/org/apache/fop/afp/goca/GraphicsCharacterString.java @@ -52,8 +52,6 @@ public class GraphicsCharacterString extends AbstractGraphicsCoord { * Constructor (relative positioning) * * @param str the character string - * @param x the x coordinate - * @param y the y coordinate */ public GraphicsCharacterString(String str) { super(null); diff --git a/src/java/org/apache/fop/afp/goca/GraphicsFillet.java b/src/java/org/apache/fop/afp/goca/GraphicsFillet.java index 9dad2fe1c..d935f6550 100644 --- a/src/java/org/apache/fop/afp/goca/GraphicsFillet.java +++ b/src/java/org/apache/fop/afp/goca/GraphicsFillet.java @@ -29,6 +29,7 @@ public final class GraphicsFillet extends AbstractGraphicsCoord { * Constructor * * @param coords the x/y coordinates for this object + * @param relative true if uses relative drawing order */ public GraphicsFillet(int[] coords, boolean relative) { super(coords, relative); diff --git a/src/java/org/apache/fop/afp/goca/GraphicsSetMix.java b/src/java/org/apache/fop/afp/goca/GraphicsSetMix.java index dfb5ae0d2..6551470cc 100644 --- a/src/java/org/apache/fop/afp/goca/GraphicsSetMix.java +++ b/src/java/org/apache/fop/afp/goca/GraphicsSetMix.java @@ -27,7 +27,10 @@ import java.io.OutputStream; */ public class GraphicsSetMix extends AbstractGraphicsDrawingOrder { + /** default mode */ public static final byte MODE_DEFAULT = 0x00; + + /** overpaint mode */ public static final byte MODE_OVERPAINT = 0x02; /** the mix mode value */ diff --git a/src/java/org/apache/fop/afp/goca/GraphicsSetPatternSymbol.java b/src/java/org/apache/fop/afp/goca/GraphicsSetPatternSymbol.java index e2cc081ce..e3968d824 100644 --- a/src/java/org/apache/fop/afp/goca/GraphicsSetPatternSymbol.java +++ b/src/java/org/apache/fop/afp/goca/GraphicsSetPatternSymbol.java @@ -84,7 +84,7 @@ public class GraphicsSetPatternSymbol extends AbstractGraphicsDrawingOrder { /** * Main constructor * - * @param symb the pattern symbol to use + * @param pattern the pattern symbol to use */ public GraphicsSetPatternSymbol(byte pattern) { this.pattern = pattern; diff --git a/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java b/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java index 5c1b9da94..b0cce02e1 100644 --- a/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java +++ b/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java @@ -85,9 +85,9 @@ public class IDEStructureParameter implements Streamable { } /** - * Sets - * @param numComponents - * @param bitsPerComponent + * Sets uniform bits per component. + * @param numComponents the number of components + * @param bitsPerComponent number of bits per component */ public void setUniformBitsPerComponent(int numComponents, int bitsPerComponent) { if (bitsPerComponent < 0 || bitsPerComponent >= 256) { diff --git a/src/java/org/apache/fop/afp/ioca/ImageRasterPattern.java b/src/java/org/apache/fop/afp/ioca/ImageRasterPattern.java index 789eeb950..9a5d4b402 100644 --- a/src/java/org/apache/fop/afp/ioca/ImageRasterPattern.java +++ b/src/java/org/apache/fop/afp/ioca/ImageRasterPattern.java @@ -26,7 +26,10 @@ package org.apache.fop.afp.ioca; * shades of grey (betweeen 0 and 16) the lower the number being the * darker the shade. The image data dimensions are 64 x 8. */ -public class ImageRasterPattern { +public final class ImageRasterPattern { + + private ImageRasterPattern() { + } /** * The Raster Pattern for Greyscale 16 diff --git a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java index 45239a6cf..be92ce0b6 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java @@ -38,11 +38,13 @@ import org.apache.fop.afp.util.BinaryUtils; public abstract class AbstractAFPObject implements Streamable { /** Static logging instance */ - protected static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp.modca"); + protected static final Log log // CSOK: ConstantName + = LogFactory.getLog("org.apache.xmlgraphics.afp.modca"); /** the structured field class id */ protected static final byte SF_CLASS = (byte)0xD3; + /** the structure field header */ protected static final byte[] SF_HEADER = new byte[] { 0x5A, // Structured field identifier 0x00, // Length byte 1 @@ -187,7 +189,8 @@ public abstract class AbstractAFPObject implements Streamable { protected String truncate(String str, int maxLength) { if (str.length() > maxLength) { str = str.substring(0, maxLength); - log.warn("truncated character string '" + str + "', longer than " + maxLength + " chars"); + log.warn("truncated character string '" + + str + "', longer than " + maxLength + " chars"); } return str; } diff --git a/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java b/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java index abc3aea87..19f2c94a3 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java +++ b/src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java @@ -88,6 +88,11 @@ public abstract class AbstractEnvironmentGroup extends AbstractNamedAFPObject { return (MapPageOverlay)getLastElement(this.mapPageOverlays); } + /** + * Get last element. + * @param list of elements + * @return last element or null if none + */ protected Object getLastElement(List list) { if (list != null && list.size() > 0) { return list.get(list.size() - 1); diff --git a/src/java/org/apache/fop/afp/modca/AbstractPageObject.java b/src/java/org/apache/fop/afp/modca/AbstractPageObject.java index af676410f..1454cf96d 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractPageObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractPageObject.java @@ -166,8 +166,7 @@ public abstract class AbstractPageObject extends AbstractNamedAFPObject implemen * Helper method to create text on the current page, this method delegates * to the presentation text object in order to construct the text. * - * @param textDataInfo - * the afp text data + * @param producer the producer * @throws UnsupportedEncodingException thrown if character encoding is not supported */ public void createText(PtocaProducer producer) throws UnsupportedEncodingException { @@ -258,6 +257,7 @@ public abstract class AbstractPageObject extends AbstractNamedAFPObject implemen * the x coordinate of the page segment. * @param y * the y coordinate of the page segment. + * @param hard true if hard page segment possible */ public void createIncludePageSegment(String name, int x, int y, boolean hard) { IncludePageSegment ips = factory.createIncludePageSegment(name, x, y); diff --git a/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java b/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java index ecdfa0157..4af687a92 100644 --- a/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java +++ b/src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java @@ -205,6 +205,10 @@ public final class ActiveEnvironmentGroup extends AbstractEnvironmentGroup { } } + /** + * Add map page segment. + * @param name of segment to add + */ public void addMapPageSegment(String name) { try { needMapPageSegment().addPageSegment(name); diff --git a/src/java/org/apache/fop/afp/modca/GraphicsObject.java b/src/java/org/apache/fop/afp/modca/GraphicsObject.java index b677a0f7c..11af83cab 100644 --- a/src/java/org/apache/fop/afp/modca/GraphicsObject.java +++ b/src/java/org/apache/fop/afp/modca/GraphicsObject.java @@ -98,7 +98,7 @@ public class GraphicsObject extends AbstractDataObject { getObjectEnvironmentGroup().setDataDescriptor(graphicsDataDescriptor); } - /** {@inheritDoc} */ + /** @param object the structured data */ public void addObject(StructuredData object) { if (currentData == null) { newData(); @@ -385,7 +385,11 @@ public class GraphicsObject extends AbstractDataObject { } /** the internal graphics state */ - private static class GraphicsState { + private static final class GraphicsState { + + private GraphicsState() { + } + /** the current color */ private Color color; diff --git a/src/java/org/apache/fop/afp/modca/ImageDataDescriptor.java b/src/java/org/apache/fop/afp/modca/ImageDataDescriptor.java index 386d2f40f..f11201c88 100644 --- a/src/java/org/apache/fop/afp/modca/ImageDataDescriptor.java +++ b/src/java/org/apache/fop/afp/modca/ImageDataDescriptor.java @@ -29,8 +29,11 @@ import org.apache.fop.afp.util.BinaryUtils; */ public class ImageDataDescriptor extends AbstractDescriptor { + /** function set fs10 */ public static final byte FUNCTION_SET_FS10 = 0x0A; + /** function set fs11 */ public static final byte FUNCTION_SET_FS11 = 0x0B; + /** function set fs45 */ public static final byte FUNCTION_SET_FS45 = 45; private byte functionSet = FUNCTION_SET_FS11; // FCNSET = IOCA FS 11 diff --git a/src/java/org/apache/fop/afp/modca/IncludeObject.java b/src/java/org/apache/fop/afp/modca/IncludeObject.java index 2dff6bd87..46b4a31f2 100644 --- a/src/java/org/apache/fop/afp/modca/IncludeObject.java +++ b/src/java/org/apache/fop/afp/modca/IncludeObject.java @@ -116,8 +116,9 @@ public class IncludeObject extends AbstractNamedAFPObject { /** * Sets the x and y offset of the content area to the object area - * used in conjunction with the {@link MappingOptionTriplet.POSITION} and - * {@link MappingOptionTriplet.POSITION_AND_TRIM}. + * used in conjunction with the + * {@link MappingOptionTriplet#POSITION} and + * {@link MappingOptionTriplet#POSITION_AND_TRIM}. * * @param x the X-axis origin defined in the object * @param y the Y-axis origin defined in the object diff --git a/src/java/org/apache/fop/afp/modca/MapCodedFont.java b/src/java/org/apache/fop/afp/modca/MapCodedFont.java index 084ae4b4c..8d99d8eaa 100644 --- a/src/java/org/apache/fop/afp/modca/MapCodedFont.java +++ b/src/java/org/apache/fop/afp/modca/MapCodedFont.java @@ -264,7 +264,10 @@ public class MapCodedFont extends AbstractStructuredObject { /** * Private utility class used as a container for font attributes */ - private class FontDefinition { + private static final class FontDefinition { + + private FontDefinition() { + } /** * The code page of the font diff --git a/src/java/org/apache/fop/afp/modca/ObjectContainer.java b/src/java/org/apache/fop/afp/modca/ObjectContainer.java index e5a57ebe9..515425906 100644 --- a/src/java/org/apache/fop/afp/modca/ObjectContainer.java +++ b/src/java/org/apache/fop/afp/modca/ObjectContainer.java @@ -113,9 +113,9 @@ public class ObjectContainer extends AbstractDataObject { } /** - * Sets the inputstream for the the object container data + * Sets the data for the the object container * - * @param inputStream the inputstream for the object container data + * @param data a byte array */ public void setData(byte[] data) { this.data = data; diff --git a/src/java/org/apache/fop/afp/modca/PageGroup.java b/src/java/org/apache/fop/afp/modca/PageGroup.java index f70b6fc52..895ec1259 100644 --- a/src/java/org/apache/fop/afp/modca/PageGroup.java +++ b/src/java/org/apache/fop/afp/modca/PageGroup.java @@ -100,6 +100,7 @@ public class PageGroup extends AbstractResourceEnvironmentGroupContainer { return this.getName(); } + /** @return the TLE sequence number */ public int getTleSequence() { return tleSequence; } diff --git a/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java b/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java index ff16e89b6..a7ce0ea0b 100644 --- a/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java +++ b/src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java @@ -60,9 +60,13 @@ public class PreprocessPresentationObject extends AbstractTripletStructuredObjec } } + /** 0 degrees orientation */ public static final byte ORIENTATION_ZERO_DEGREES = 1; + /** 90 degrees orientation */ public static final byte ORIENTATION_90_DEGREES = 2; + /** 180 degrees orientation */ public static final byte ORIENTATION_180_DEGREES = 4; + /** 270 degrees orientation */ public static final byte ORIENTATION_270_DEGREES = 8; /** diff --git a/src/java/org/apache/fop/afp/modca/triplets/CommentTriplet.java b/src/java/org/apache/fop/afp/modca/triplets/CommentTriplet.java index 9b15de8c1..ee48f86be 100644 --- a/src/java/org/apache/fop/afp/modca/triplets/CommentTriplet.java +++ b/src/java/org/apache/fop/afp/modca/triplets/CommentTriplet.java @@ -31,6 +31,11 @@ public class CommentTriplet extends AbstractTriplet { private final String commentString; + /** + * Construct a triplet. + * @param id the triplet identification number + * @param commentString a comment + */ public CommentTriplet(byte id, String commentString) { super(id); this.commentString = commentString; diff --git a/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java b/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java index 8430a47ee..df5d7553d 100644 --- a/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java +++ b/src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java @@ -182,7 +182,8 @@ public class ObjectClassificationTriplet extends AbstractTriplet { data[5] = 0x00; // reserved (must be zero) // StrucFlgs - Information on the structure of the object container - byte[] structureFlagsBytes = getStructureFlagsAsBytes(dataInContainer, containerHasOEG, dataInOCD); + byte[] structureFlagsBytes + = getStructureFlagsAsBytes(dataInContainer, containerHasOEG, dataInOCD); data[6] = structureFlagsBytes[0]; data[7] = structureFlagsBytes[1]; diff --git a/src/java/org/apache/fop/afp/modca/triplets/Triplet.java b/src/java/org/apache/fop/afp/modca/triplets/Triplet.java index 726727e3e..7234645f8 100644 --- a/src/java/org/apache/fop/afp/modca/triplets/Triplet.java +++ b/src/java/org/apache/fop/afp/modca/triplets/Triplet.java @@ -22,64 +22,123 @@ package org.apache.fop.afp.modca.triplets; import org.apache.fop.afp.Streamable; import org.apache.fop.afp.StructuredData; +/** + * Triplet interface. + */ public interface Triplet extends Streamable, StructuredData { + + /** maximum length */ int MAX_LENGTH = 254; + /** CODED_GRAPHIC_CHARACTER_SET_GLOBAL_IDENTIFIER identifier */ byte CODED_GRAPHIC_CHARACTER_SET_GLOBAL_IDENTIFIER = 0x01; - /** Triplet identifiers */ + /** FULLY_QUALIFIED_NAME triplet identifier */ byte FULLY_QUALIFIED_NAME = 0x02; + /** MAPPING_OPTION triplet identifier */ byte MAPPING_OPTION = 0x04; + /** OBJECT_CLASSIFICATION triplet identifier */ byte OBJECT_CLASSIFICATION = 0x10; + /** MODCA_INTERCHANGE_SET triplet identifier */ byte MODCA_INTERCHANGE_SET = 0x18; + /** FONT_DESCRIPTOR_SPECIFICATION triplet identifier */ byte FONT_DESCRIPTOR_SPECIFICATION = 0x1F; + /** OBJECT_FUNCTION_SET_SPECIFICATION triplet identifier */ byte OBJECT_FUNCTION_SET_SPECIFICATION = 0x21; + /** EXTENDED_RESOURCE_LOCAL_IDENTIFIER triplet identifier */ byte EXTENDED_RESOURCE_LOCAL_IDENTIFIER = 0x22; + /** RESOURCE_LOCAL_IDENTIFIER triplet identifier */ byte RESOURCE_LOCAL_IDENTIFIER = 0x24; + /** RESOURCE_SECTION_NUMBER triplet identifier */ byte RESOURCE_SECTION_NUMBER = 0x25; + /** CHARACTER_ROTATION triplet identifier */ byte CHARACTER_ROTATION = 0x26; + /** OBJECT_BYTE_OFFSET triplet identifier */ byte OBJECT_BYTE_OFFSET = 0x2D; + /** ATTRIBUTE_VALUE triplet identifier */ byte ATTRIBUTE_VALUE = 0x36; + /** DESCRIPTOR_POSITION triplet identifier */ byte DESCRIPTOR_POSITION = 0x43; + /** MEDIA_EJECT_CONTROL triplet identifier */ byte MEDIA_EJECT_CONTROL = 0x45; + /** PAGE_OVERLAY_CONDITIONAL_PROCESSING triplet identifier */ byte PAGE_OVERLAY_CONDITIONAL_PROCESSING = 0x46; + /** RESOURCE_USAGE_ATTRIBUTE triplet identifier */ byte RESOURCE_USAGE_ATTRIBUTE = 0x47; + /** MEASUREMENT_UNITS triplet identifier */ byte MEASUREMENT_UNITS = 0x4B; + /** OBJECT_AREA_SIZE triplet identifier */ byte OBJECT_AREA_SIZE = 0x4C; + /** AREA_DEFINITION triplet identifier */ byte AREA_DEFINITION = 0x4D; + /** COLOR_SPECIFICATION triplet identifier */ byte COLOR_SPECIFICATION = 0x4E; + /** ENCODING_SCHEME_ID triplet identifier */ byte ENCODING_SCHEME_ID = 0x50; + /** MEDIUM_MAP_PAGE_NUMBER triplet identifier */ byte MEDIUM_MAP_PAGE_NUMBER = 0x56; + /** OBJECT_BYTE_EXTENT triplet identifier */ byte OBJECT_BYTE_EXTENT = 0x57; + /** OBJECT_STRUCTURED_FIELD_OFFSET triplet identifier */ byte OBJECT_STRUCTURED_FIELD_OFFSET = 0x58; + /** OBJECT_STRUCTURED_FIELD_EXTENT triplet identifier */ byte OBJECT_STRUCTURED_FIELD_EXTENT = 0x59; + /** OBJECT_OFFSET triplet identifier */ byte OBJECT_OFFSET = 0x5A; + /** FONT_HORIZONTAL_SCALE_FACTOR triplet identifier */ byte FONT_HORIZONTAL_SCALE_FACTOR = 0x5D; + /** OBJECT_COUNT triplet identifier */ byte OBJECT_COUNT = 0x5E; + /** OBJECT_DATE_AND_TIMESTAMP triplet identifier */ byte OBJECT_DATE_AND_TIMESTAMP = 0x62; + /** COMMENT triplet identifier */ byte COMMENT = 0x65; + /** MEDIUM_ORIENTATION triplet identifier */ byte MEDIUM_ORIENTATION = 0x68; + /** RESOURCE_OBJECT_INCLUDE triplet identifier */ byte RESOURCE_OBJECT_INCLUDE = 0x6C; + /** PRESENTATION_SPACE_RESET_MIXING triplet identifier */ byte PRESENTATION_SPACE_RESET_MIXING = 0x70; + /** PRESENTATION_SPACE_MIXING_RULE triplet identifier */ byte PRESENTATION_SPACE_MIXING_RULE = 0x71; + /** UNIVERSAL_DATE_AND_TIMESTAMP triplet identifier */ byte UNIVERSAL_DATE_AND_TIMESTAMP = 0x72; + /** TONER_SAVER triplet identifier */ byte TONER_SAVER = 0x74; + /** COLOR_FIDELITY triplet identifier */ byte COLOR_FIDELITY = 0x75; + /** FONT_FIDELITY triplet identifier */ byte FONT_FIDELITY = 0x78; + /** ATTRIBUTE_QUALIFIER triplet identifier */ byte ATTRIBUTE_QUALIFIER = (byte)0x80; + /** PAGE_POSITION_INFORMATION triplet identifier */ byte PAGE_POSITION_INFORMATION = (byte)0x81; + /** PARAMETER_VALUE triplet identifier */ byte PARAMETER_VALUE = (byte)0x82; + /** PRESENTATION_CONTROL triplet identifier */ byte PRESENTATION_CONTROL = (byte)0x83; + /** FONT_RESOLUTION_AND_METRIC_TECHNOLOGY triplet identifier */ byte FONT_RESOLUTION_AND_METRIC_TECHNOLOGY = (byte)0x84; + /** FINISHING_OPERATION triplet identifier */ byte FINISHING_OPERATION = (byte)0x85; + /** TEXT_FIDELITY triplet identifier */ byte TEXT_FIDELITY = (byte)0x86; + /** MEDIA_FIDELITY triplet identifier */ byte MEDIA_FIDELITY = (byte)0x87; + /** FINISHING_FIDELITY triplet identifier */ byte FINISHING_FIDELITY = (byte)0x88; + /** DATA_OBJECT_FONT_DESCRIPTOR triplet identifier */ byte DATA_OBJECT_FONT_DESCRIPTOR = (byte)0x8B; + /** LOCALE_SELECTOR triplet identifier */ byte LOCALE_SELECTOR = (byte)0x8C; + /** UP3I_FINISHING_OPERATION triplet identifier */ byte UP3I_FINISHING_OPERATION = (byte)0x8E; + /** COLOR_MANAGEMENT_RESOURCE_DESCRIPTOR triplet identifier */ byte COLOR_MANAGEMENT_RESOURCE_DESCRIPTOR = (byte)0x91; + /** RENDERING_INTENT triplet identifier */ byte RENDERING_INTENT = (byte)0x95; + /** CMR_TAG_FIDELITY triplet identifier */ byte CMR_TAG_FIDELITY = (byte)0x96; + /** DEVICE_APPEARANCE triplet identifier */ byte DEVICE_APPEARANCE = (byte)0x97; } diff --git a/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java b/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java index c702d72a8..ad2a5d716 100644 --- a/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java +++ b/src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java @@ -32,7 +32,8 @@ import org.apache.fop.afp.AFPLineDataInfo; public class LineDataInfoProducer implements PtocaProducer, PtocaConstants { /** Static logging instance */ - private static final Log log = LogFactory.getLog(LineDataInfoProducer.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(LineDataInfoProducer.class); private AFPLineDataInfo lineDataInfo; diff --git a/src/java/org/apache/fop/afp/svg/AFPBridgeContext.java b/src/java/org/apache/fop/afp/svg/AFPBridgeContext.java index 48c1001ef..883414fda 100644 --- a/src/java/org/apache/fop/afp/svg/AFPBridgeContext.java +++ b/src/java/org/apache/fop/afp/svg/AFPBridgeContext.java @@ -60,22 +60,21 @@ public class AFPBridgeContext extends AbstractFOPBridgeContext { /** * Constructs a new bridge context. * @param userAgent the user agent - * @param loader the Document Loader to use for referenced documents. + * @param documentLoader the Document Loader to use for referenced documents. * @param fontInfo the font list for the text painter, may be null * in which case text is painted as shapes - * @param linkTransform AffineTransform to properly place links, - * may be null * @param imageManager an image manager * @param imageSessionContext an image session context * @param linkTransform AffineTransform to properly place links, * may be null - * @param an AFPGraphics 2D implementation + * @param g2d an AFPGraphics 2D implementation */ public AFPBridgeContext(UserAgent userAgent, DocumentLoader documentLoader, FontInfo fontInfo, ImageManager imageManager, ImageSessionContext imageSessionContext, AffineTransform linkTransform, AFPGraphics2D g2d) { - super(userAgent, documentLoader, fontInfo, imageManager, imageSessionContext, linkTransform); + super(userAgent, documentLoader, fontInfo, imageManager, + imageSessionContext, linkTransform); this.g2d = g2d; } diff --git a/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java b/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java index 832397ea6..b8ed5159a 100644 --- a/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java +++ b/src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java @@ -109,7 +109,8 @@ public class AFPGraphicsConfiguration extends GraphicsConfiguration { } } - private static final Log log = LogFactory.getLog(AFPGraphicsConfiguration.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(AFPGraphicsConfiguration.class); private AffineTransform defaultTransform = null; private AffineTransform normalizingTransform = null; diff --git a/src/java/org/apache/fop/afp/svg/AFPTextHandler.java b/src/java/org/apache/fop/afp/svg/AFPTextHandler.java index 975210375..13a32ee78 100644 --- a/src/java/org/apache/fop/afp/svg/AFPTextHandler.java +++ b/src/java/org/apache/fop/afp/svg/AFPTextHandler.java @@ -21,7 +21,6 @@ package org.apache.fop.afp.svg; import java.awt.Color; import java.awt.Graphics2D; -import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -34,13 +33,13 @@ import org.apache.fop.afp.fonts.AFPPageFonts; import org.apache.fop.afp.modca.GraphicsObject; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; -import org.apache.fop.svg.FOPTextHandler; +import org.apache.fop.svg.FOPTextHandlerAdapter; /** * Specialized TextHandler implementation that the AFPGraphics2D class delegates to to paint text * using AFP GOCA text operations. */ -public class AFPTextHandler implements FOPTextHandler { +public class AFPTextHandler extends FOPTextHandlerAdapter { /** logging instance */ private static Log log = LogFactory.getLog(AFPTextHandler.class); @@ -87,19 +86,13 @@ public class AFPTextHandler implements FOPTextHandler { return afpFontAttributes.getFontReference(); } - /** {@inheritDoc} */ - public void drawString(String text, float x, float y) throws IOException { - // TODO Remove me after removing the deprecated method in TextHandler. - throw new UnsupportedOperationException("Deprecated method!"); - } - /** * Add a text string to the current data object of the AFP datastream. * The text is painted using text operations. * * {@inheritDoc} */ - public void drawString(Graphics2D g, String str, float x, float y) throws IOException { + public void drawString(Graphics2D g, String str, float x, float y) { if (log.isDebugEnabled()) { log.debug("drawString() str=" + str + ", x=" + x + ", y=" + y); } diff --git a/src/java/org/apache/fop/afp/svg/AFPTextPainter.java b/src/java/org/apache/fop/afp/svg/AFPTextPainter.java index 3bf4983bb..3815c9eae 100644 --- a/src/java/org/apache/fop/afp/svg/AFPTextPainter.java +++ b/src/java/org/apache/fop/afp/svg/AFPTextPainter.java @@ -26,7 +26,7 @@ import org.apache.fop.svg.AbstractFOPTextPainter; import org.apache.fop.svg.FOPTextHandler; /** - * Renders the attributed character iterator of a {@link TextNode}. + * Renders the attributed character iterator of some text. * This class draws the text directly into the AFPGraphics2D so that * the text is not drawn using shapes. * If the text is simple enough to draw then it sets the font and calls diff --git a/src/java/org/apache/fop/afp/util/BinaryUtils.java b/src/java/org/apache/fop/afp/util/BinaryUtils.java index 2b2649415..2b4197b36 100644 --- a/src/java/org/apache/fop/afp/util/BinaryUtils.java +++ b/src/java/org/apache/fop/afp/util/BinaryUtils.java @@ -27,6 +27,9 @@ import java.io.ByteArrayOutputStream; */ public final class BinaryUtils { + private BinaryUtils() { + } + /** * Convert an int into the corresponding byte array by encoding each * two hexadecimal digits as a char. This will return a byte array diff --git a/src/java/org/apache/fop/afp/util/CubicBezierApproximator.java b/src/java/org/apache/fop/afp/util/CubicBezierApproximator.java index d3ed41c76..e5980c3dd 100644 --- a/src/java/org/apache/fop/afp/util/CubicBezierApproximator.java +++ b/src/java/org/apache/fop/afp/util/CubicBezierApproximator.java @@ -29,7 +29,10 @@ import java.awt.geom.Point2D.Double; * The various techniques are described here: * http://www.timotheegroleau.com/Flash/articles/cubic_bezier_in_flash.htm */ -public class CubicBezierApproximator { +public final class CubicBezierApproximator { + + private CubicBezierApproximator() { + } /** * This method will take in an array containing the x and y coordinates of the four control diff --git a/src/java/org/apache/fop/afp/util/StringUtils.java b/src/java/org/apache/fop/afp/util/StringUtils.java index ce68d27be..5014089da 100644 --- a/src/java/org/apache/fop/afp/util/StringUtils.java +++ b/src/java/org/apache/fop/afp/util/StringUtils.java @@ -23,7 +23,10 @@ package org.apache.fop.afp.util; * Library of utility methods useful in dealing with strings. * */ -public class StringUtils { +public final class StringUtils { + + private StringUtils() { + } /** * Padds the string to the left with the given character for diff --git a/src/java/org/apache/fop/area/AreaEventProducer.java b/src/java/org/apache/fop/area/AreaEventProducer.java index 325367199..c4f5a7a35 100644 --- a/src/java/org/apache/fop/area/AreaEventProducer.java +++ b/src/java/org/apache/fop/area/AreaEventProducer.java @@ -30,7 +30,10 @@ public interface AreaEventProducer extends EventProducer { /** * Provider class for the event producer. */ - class Provider { + static final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/area/AreaTreeParser.java b/src/java/org/apache/fop/area/AreaTreeParser.java index e41f5e873..31c0e04fc 100644 --- a/src/java/org/apache/fop/area/AreaTreeParser.java +++ b/src/java/org/apache/fop/area/AreaTreeParser.java @@ -228,8 +228,13 @@ public class AreaTreeParser { if (areaStack.size() > 0) { int pos = areaStack.size() - 1; Object obj = null; - while (pos >= 0 && !(clazz.isInstance(obj = areaStack.get(pos)))) { - pos--; + while ( pos >= 0 ) { + obj = areaStack.get(pos); + if ( clazz.isInstance ( obj ) ) { + break; + } else { + pos--; + } } if (pos >= 0) { return (Area)obj; diff --git a/src/java/org/apache/fop/area/Block.java b/src/java/org/apache/fop/area/Block.java index 5faec9f7a..ecb9c4990 100644 --- a/src/java/org/apache/fop/area/Block.java +++ b/src/java/org/apache/fop/area/Block.java @@ -58,6 +58,7 @@ public class Block extends BlockParent { private int stacking = TB; private int positioning = STACK; + /** if true, allow BPD update */ protected transient boolean allowBPDUpdate = true; // a block with may contain the dominant styling info in diff --git a/src/java/org/apache/fop/area/DestinationData.java b/src/java/org/apache/fop/area/DestinationData.java index cb2d6eccb..75b981fb7 100644 --- a/src/java/org/apache/fop/area/DestinationData.java +++ b/src/java/org/apache/fop/area/DestinationData.java @@ -98,7 +98,7 @@ public class DestinationData extends AbstractOffDocumentItem implements Resolvab * object that corresponds to the IDRef * * {@inheritDoc} List) - * @todo check to make sure it works if multiple bookmark-items + * @asf.todo check to make sure it works if multiple bookmark-items * have the same idref */ public void resolveIDRef(String id, List pages) { diff --git a/src/java/org/apache/fop/area/IDTracker.java b/src/java/org/apache/fop/area/IDTracker.java index b55ed7983..c0607d1bd 100644 --- a/src/java/org/apache/fop/area/IDTracker.java +++ b/src/java/org/apache/fop/area/IDTracker.java @@ -34,7 +34,8 @@ import org.apache.commons.logging.LogFactory; */ public class IDTracker { - private static final Log log = LogFactory.getLog(IDTracker.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(IDTracker.class); // HashMap of ID's whose area is located on one or more consecutive // PageViewports. Each ID has an arraylist of PageViewports that diff --git a/src/java/org/apache/fop/area/LineArea.java b/src/java/org/apache/fop/area/LineArea.java index bbf947499..0e6e6ac30 100644 --- a/src/java/org/apache/fop/area/LineArea.java +++ b/src/java/org/apache/fop/area/LineArea.java @@ -37,7 +37,7 @@ public class LineArea extends Area { * that can be used in order to re-compute adjustement and / or indents when a * page-number or a page-number-citation is resolved */ - private class LineAdjustingInfo implements Serializable { + private final class LineAdjustingInfo implements Serializable { private int lineAlignment; private int difference; private int availableStretch; diff --git a/src/java/org/apache/fop/area/Trait.java b/src/java/org/apache/fop/area/Trait.java index 27ce39252..42c5462e4 100644 --- a/src/java/org/apache/fop/area/Trait.java +++ b/src/java/org/apache/fop/area/Trait.java @@ -34,7 +34,10 @@ import org.apache.fop.util.ColorUtil; * Area traits used for rendering. * This class represents an area trait that specifies a value for rendering. */ -public class Trait implements Serializable { +public final class Trait implements Serializable { + + private Trait() { + } /** * Id reference line, not resolved. diff --git a/src/java/org/apache/fop/area/inline/AbstractTextArea.java b/src/java/org/apache/fop/area/inline/AbstractTextArea.java index e73a8355c..b50f53a24 100644 --- a/src/java/org/apache/fop/area/inline/AbstractTextArea.java +++ b/src/java/org/apache/fop/area/inline/AbstractTextArea.java @@ -140,12 +140,14 @@ public abstract class AbstractTextArea extends InlineParent { if (textWordSpaceAdjust < 0) { // from a negative adjustment to a positive one balancingFactor - = ((double) textAdjustingInfo.availableStretch / textAdjustingInfo.availableShrink) + = ((double) textAdjustingInfo.availableStretch + / textAdjustingInfo.availableShrink) * ((double) lineShrink / lineStretch); } else { // from a positive adjustment to a negative one balancingFactor - = ((double) textAdjustingInfo.availableShrink / textAdjustingInfo.availableStretch) + = ((double) textAdjustingInfo.availableShrink + / textAdjustingInfo.availableStretch) * ((double) lineStretch / lineShrink); } } diff --git a/src/java/org/apache/fop/area/inline/InlineArea.java b/src/java/org/apache/fop/area/inline/InlineArea.java index 5106fd5bc..30afc149b 100644 --- a/src/java/org/apache/fop/area/inline/InlineArea.java +++ b/src/java/org/apache/fop/area/inline/InlineArea.java @@ -218,6 +218,10 @@ public class InlineArea extends Area { return false; } + /** + * Apply IPD variation. + * @param ipdVariation the variation + */ public void handleIPDVariation(int ipdVariation) { increaseIPD(ipdVariation); notifyIPDVariation(ipdVariation); diff --git a/src/java/org/apache/fop/area/inline/SpaceArea.java b/src/java/org/apache/fop/area/inline/SpaceArea.java index 287f09dfc..202408deb 100644 --- a/src/java/org/apache/fop/area/inline/SpaceArea.java +++ b/src/java/org/apache/fop/area/inline/SpaceArea.java @@ -16,6 +16,7 @@ */ /* $Id$ */ + package org.apache.fop.area.inline; /** diff --git a/src/java/org/apache/fop/area/inline/WordArea.java b/src/java/org/apache/fop/area/inline/WordArea.java index 70d10ef9b..4737d81d3 100644 --- a/src/java/org/apache/fop/area/inline/WordArea.java +++ b/src/java/org/apache/fop/area/inline/WordArea.java @@ -16,6 +16,7 @@ */ /* $Id$ */ + package org.apache.fop.area.inline; /** diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index 011e84008..fb3b54c9c 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -961,10 +961,12 @@ public class CommandLineOptions { "FO output mode is only available if you use -xml and -xsl"); } else if (outputmode.equals(MimeConstants.MIME_FOP_AREA_TREE)) { throw new FOPException( - "Area Tree Output is not available if Intermediate Format is used as input!"); + "Area Tree Output is not available if Intermediate Format" + + " is used as input!"); } else if (outputmode.equals(MimeConstants.MIME_FOP_IF)) { throw new FOPException( - "Intermediate Output is not available if Intermediate Format is used as input!"); + "Intermediate Output is not available if Intermediate Format" + + " is used as input!"); } if (iffile != null && !iffile.exists()) { throw new FileNotFoundException("Error: intermediate format file " @@ -1151,7 +1153,8 @@ public class CommandLineOptions { + " -r relaxed/less strict validation (where available)\n" + " -dpi xxx target resolution in dots per inch (dpi) where xxx is a number\n" + " -s for area tree XML, down to block areas only\n" - + " -v run in verbose mode (currently simply print FOP version and continue)\n\n" + + " -v run in verbose mode (currently simply print FOP version" + + " and continue)\n\n" + " -o [password] PDF file will be encrypted with option owner password\n" + " -u [password] PDF file will be encrypted with option user password\n" + " -noprint PDF file will be encrypted without printing permission\n" @@ -1161,8 +1164,10 @@ public class CommandLineOptions { + " -a enables accessibility features (Tagged PDF etc., default off)\n" + " -pdfprofile prof PDF file will be generated with the specified profile\n" + " (Examples for prof: PDF/A-1b or PDF/X-3:2003)\n\n" - + " -conserve Enable memory-conservation policy (trades memory-consumption for disk I/O)\n" - + " (Note: currently only influences whether the area tree is serialized.)\n\n" + + " -conserve Enable memory-conservation policy (trades memory-consumption" + + " for disk I/O)\n" + + " (Note: currently only influences whether the area tree is" + + " serialized.)\n\n" + " [INPUT] \n" + " infile xsl:fo input file (the same as the next) \n" + " (use '-' for infile to pipe input from stdin)\n" @@ -1192,7 +1197,8 @@ public class CommandLineOptions { + " -at [mime] out representation of area tree as XML (outfile req'd) \n" + " specify optional mime output to allow the AT to be converted\n" + " to final format later\n" - + " -if [mime] out representation of document in intermediate format XML (outfile req'd)\n" + + " -if [mime] out representation of document in intermediate format XML" + + " (outfile req'd)\n" + " specify optional mime output to allow the IF to be converted\n" + " to final format later\n" + " -print input file will be rendered and sent to the printer \n" diff --git a/src/java/org/apache/fop/cli/InputHandler.java b/src/java/org/apache/fop/cli/InputHandler.java index e7109fcfa..f6389a25f 100644 --- a/src/java/org/apache/fop/cli/InputHandler.java +++ b/src/java/org/apache/fop/cli/InputHandler.java @@ -196,13 +196,14 @@ public class InputHandler implements ErrorListener, Renderable { * Creates a catalog resolver and uses it for XML parsing and XSLT URI resolution. * Tries the Apache Commons Resolver, and if unsuccessful, * tries the same built into Java 6. + * @param userAgent the user agent instance */ public void createCatalogResolver(FOUserAgent userAgent) { String[] classNames = new String[] { "org.apache.xml.resolver.tools.CatalogResolver", "com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver"}; - ResourceEventProducer eventProducer = - ResourceEventProducer.Provider.get(userAgent.getEventBroadcaster()); + ResourceEventProducer eventProducer + = ResourceEventProducer.Provider.get(userAgent.getEventBroadcaster()); Class resolverClass = null; for (int i = 0; i < classNames.length && resolverClass == null; ++i) { try { diff --git a/src/java/org/apache/fop/cli/Main.java b/src/java/org/apache/fop/cli/Main.java index c4393bb03..6ae81ea21 100644 --- a/src/java/org/apache/fop/cli/Main.java +++ b/src/java/org/apache/fop/cli/Main.java @@ -35,7 +35,10 @@ import org.apache.fop.apps.MimeConstants; /** * Main command-line class for Apache FOP. */ -public class Main { +public final class Main { + + private Main() { + } /** * @return the list of URLs to all libraries. diff --git a/src/java/org/apache/fop/datatypes/FODimension.java b/src/java/org/apache/fop/datatypes/FODimension.java index cf8acdbb5..e1a94d087 100644 --- a/src/java/org/apache/fop/datatypes/FODimension.java +++ b/src/java/org/apache/fop/datatypes/FODimension.java @@ -27,9 +27,9 @@ package org.apache.fop.datatypes; public class FODimension { /** distance (in millipoints) on the inline-progression-direction */ - public int ipd; + public int ipd; // CSOK: VisibilityModifier /** distance (in millipoints) on the block-progression-direction */ - public int bpd; + public int bpd; // CSOK: VisibilityModifier /** * Constructor @@ -41,6 +41,17 @@ public class FODimension { this.bpd = bpd; } + /** @return ipd */ + public int getIPD() { + return ipd; + } + + /** @return bpd */ + public int getBPD() { + return bpd; + } + + /** {@inheritDoc} */ public String toString() { StringBuffer sb = new StringBuffer(super.toString()); sb.append(" {ipd=").append(Integer.toString(ipd)); diff --git a/src/java/org/apache/fop/datatypes/Numeric.java b/src/java/org/apache/fop/datatypes/Numeric.java index 32ae78921..c26cacd7c 100644 --- a/src/java/org/apache/fop/datatypes/Numeric.java +++ b/src/java/org/apache/fop/datatypes/Numeric.java @@ -37,7 +37,7 @@ public interface Numeric { /** * Return the value of this Numeric * @return the computed value. - * @throws PropertyException + * @throws PropertyException if a propert exception occurs */ double getNumericValue() throws PropertyException; @@ -45,7 +45,7 @@ public interface Numeric { * Return the value of this Numeric * @param context The context for the length calculation (for percentage based lengths) * @return the computed value. - * @throws PropertyException + * @throws PropertyException if a propert exception occurs */ double getNumericValue(PercentBaseContext context) throws PropertyException; @@ -68,14 +68,14 @@ public interface Numeric { * Returns the value of this numeric as an int. * @return the value as an integer. */ - public int getValue(); + int getValue(); /** * Returns the value of this numeric as an int. * @param context the context for the length calculation (for percentage based lengths) * @return the value as an integer. */ - public int getValue(PercentBaseContext context); + int getValue(PercentBaseContext context); /** * Return the resolved value. This method will becalled during evaluation @@ -89,6 +89,7 @@ public interface Numeric { /** * Return the enum value that is stored in this numeric. + * @return the enum value */ - public int getEnum(); + int getEnum(); } diff --git a/src/java/org/apache/fop/datatypes/PercentBaseContext.java b/src/java/org/apache/fop/datatypes/PercentBaseContext.java index 9744f417e..b04f774cf 100644 --- a/src/java/org/apache/fop/datatypes/PercentBaseContext.java +++ b/src/java/org/apache/fop/datatypes/PercentBaseContext.java @@ -36,6 +36,6 @@ public interface PercentBaseContext { * @param fobj The FO object against which the percentage should be evaluated * @return The base length value of the given kind */ - public int getBaseLength(int lengthBase, FObj fobj); + int getBaseLength(int lengthBase, FObj fobj); } diff --git a/src/java/org/apache/fop/datatypes/URISpecification.java b/src/java/org/apache/fop/datatypes/URISpecification.java index 9311851ea..b1a1d84d4 100644 --- a/src/java/org/apache/fop/datatypes/URISpecification.java +++ b/src/java/org/apache/fop/datatypes/URISpecification.java @@ -25,7 +25,10 @@ import java.io.UnsupportedEncodingException; /** * This class contains method to deal with the <uri-specification> datatype from XSL-FO. */ -public class URISpecification { +public final class URISpecification { + + private URISpecification() { + } /** * Get the URL string from a wrapped URL. @@ -94,7 +97,7 @@ public class URISpecification { return false; } - private final static char[] HEX_DIGITS = { + private static final char[] HEX_DIGITS = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; diff --git a/src/java/org/apache/fop/events/EventExceptionManager.java b/src/java/org/apache/fop/events/EventExceptionManager.java index 1072600c9..f7d679282 100644 --- a/src/java/org/apache/fop/events/EventExceptionManager.java +++ b/src/java/org/apache/fop/events/EventExceptionManager.java @@ -27,7 +27,10 @@ import org.apache.xmlgraphics.util.Service; /** * This class is responsible for converting events into exceptions. */ -public class EventExceptionManager { +public final class EventExceptionManager { + + private EventExceptionManager() { + } private static final Map EXCEPTION_FACTORIES = new java.util.HashMap(); diff --git a/src/java/org/apache/fop/events/model/EventModelParser.java b/src/java/org/apache/fop/events/model/EventModelParser.java index ddb1bf663..be7c61790 100644 --- a/src/java/org/apache/fop/events/model/EventModelParser.java +++ b/src/java/org/apache/fop/events/model/EventModelParser.java @@ -40,10 +40,14 @@ import org.apache.fop.util.DefaultErrorListener; /** * This is a parser for the event model XML. */ -public class EventModelParser { +public final class EventModelParser { + + private EventModelParser() { + } /** Logger instance */ - protected static Log log = LogFactory.getLog(EventModelParser.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(EventModelParser.class); private static SAXTransformerFactory tFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance(); diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java index bbe3ce3a3..a6be832f0 100644 --- a/src/java/org/apache/fop/fo/FONode.java +++ b/src/java/org/apache/fop/fo/FONode.java @@ -633,8 +633,9 @@ public abstract class FONode implements Cloneable { * this method only in exceptional conditions because this method may perform quite extensive * information gathering inside the FO tree. * @return a String containing context information - * @deprecated Not localized! Should rename getContextInfoAlt() to getContextInfo() when done! */ + // [GA] remove deprecation - no alternative specified + // @deprecated Not localized! Should rename getContextInfoAlt() to getContextInfo() when done! public String getContextInfo() { StringBuffer sb = new StringBuffer(); if (getLocalName() != null) { @@ -797,8 +798,9 @@ public abstract class FONode implements Cloneable { /** * This method is overridden by extension elements and allows the extension element to return - * a {@link ContentHandlerFactory}. This factory can create ContentHandler implementations that handle - * foreign XML content by either building up a specific DOM, a Java object or something else. + * a {@link ContentHandlerFactory}. This factory can create ContentHandler implementations that + * handle foreign XML content by either building up a specific DOM, a Java object or something + * else. * * @return the <code>ContentHandlerFactory</code> or <code>null</code> if not applicable */ diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java index 07fb20fd8..8293180cf 100644 --- a/src/java/org/apache/fop/fo/FOPropertyMapping.java +++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java @@ -72,16 +72,20 @@ import org.apache.fop.fo.properties.XMLLangShorthandParser; * This class creates and returns an array of Property.Maker instances * indexed by the PR_* propId from Constants.java. * - * @todo Check multi-threading safety of the statics below + * @asf.todo Check multi-threading safety of the statics below */ public final class FOPropertyMapping implements Constants { - private static Map s_htPropNames = new HashMap(); - private static Map s_htSubPropNames = new HashMap(); - private static Map s_htPropIds = new HashMap(); - private static PropertyMaker[] s_generics = null; + private FOPropertyMapping() { + } + + private static Map propNames = new HashMap(); // CSOK: VisibilityModifier + private static Map subPropNames = new HashMap(); // CSOK: VisibilityModifier + private static Map propIds = new HashMap(); // CSOK: VisibilityModifier + + private static PropertyMaker[] generics = null; // CSOK: VisibilityModifier - // The rest is only used during the building of the s_generics array. + // The rest is only used during the building of the generics array. private Property[] enums = null; private PropertyMaker genericColor = null; @@ -154,7 +158,7 @@ public final class FOPropertyMapping implements Constants { genericPadding.setInherited(false); genericPadding.setDefault("0pt"); genericPadding.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH); - genericPadding.addShorthand(s_generics[PR_PADDING]); + genericPadding.addShorthand(generics[PR_PADDING]); // GenericCondBorderWidth genericCondBorderWidth = new CondLengthProperty.Maker(0); @@ -235,15 +239,15 @@ public final class FOPropertyMapping implements Constants { /** * Add a property maker to the generics array. - * Also creates the name <-> id mapping in s_htPropNames and s_htPropIds. + * Also creates the name <-> id mapping in propNames and propIds. * * @param name the name of the property maker. * @param maker the maker. */ private static void addPropertyMaker(String name, PropertyMaker maker) { - s_generics[maker.getPropId()] = maker; - s_htPropNames.put(name, new Integer(maker.getPropId())); - s_htPropIds.put(new Integer(maker.getPropId()), name); + generics[maker.getPropId()] = maker; + propNames.put(name, new Integer(maker.getPropId())); + propIds.put(new Integer(maker.getPropId()), name); } /** @@ -252,8 +256,8 @@ public final class FOPropertyMapping implements Constants { * @param id Id for the subproperty from CP_* in Constants.java. */ private static void addSubpropMakerName(String name, int id) { - s_htSubPropNames.put(name, new Integer(id)); - s_htPropIds.put(new Integer(id), name); + subPropNames.put(name, new Integer(id)); + propIds.put(new Integer(id), name); } /** @@ -278,9 +282,9 @@ public final class FOPropertyMapping implements Constants { */ public static PropertyMaker[] getGenericMappings() { - if (s_generics == null) { + if (generics == null) { /* this method was never called before */ - s_generics = new PropertyMaker[PROPERTY_COUNT + 1]; + generics = new PropertyMaker[PROPERTY_COUNT + 1]; FOPropertyMapping gp = new FOPropertyMapping(); /* Create the shorthand first. They are @@ -328,7 +332,7 @@ public final class FOPropertyMapping implements Constants { addSubpropMakerName("precedence", CP_PRECEDENCE); } - return s_generics; + return generics; } /** @@ -338,7 +342,7 @@ public final class FOPropertyMapping implements Constants { */ public static int getPropertyId(String name) { if (name != null) { - Integer i = (Integer) s_htPropNames.get(name); + Integer i = (Integer) propNames.get(name); if (i != null) { return i.intValue(); } @@ -353,7 +357,7 @@ public final class FOPropertyMapping implements Constants { */ public static int getSubPropertyId(String name) { if (name != null) { - Integer i = (Integer) s_htSubPropNames.get(name); + Integer i = (Integer) subPropNames.get(name); if (i != null) { return i.intValue(); } @@ -369,10 +373,10 @@ public final class FOPropertyMapping implements Constants { public static String getPropertyName(int id) { if (((id & Constants.COMPOUND_MASK) == 0) || ((id & Constants.PROPERTY_MASK) == 0)) { - return (String) s_htPropIds.get(new Integer(id)); + return (String) propIds.get(new Integer(id)); } else { - return s_htPropIds.get(new Integer(id & Constants.PROPERTY_MASK)) - + "." + s_htPropIds.get(new Integer(id & Constants.COMPOUND_MASK)); + return propIds.get(new Integer(id & Constants.PROPERTY_MASK)) + + "." + propIds.get(new Integer(id & Constants.COMPOUND_MASK)); } } @@ -403,7 +407,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED")); m.addEnum("absolute", getEnumProperty(EN_ABSOLUTE, "ABSOLUTE")); m.setDefault("auto"); - m.addShorthand(s_generics[PR_POSITION]); + m.addShorthand(generics[PR_POSITION]); addPropertyMaker("absolute-position", m); // top @@ -551,7 +555,7 @@ public final class FOPropertyMapping implements Constants { addPropertyMaker("volume", m); } - private void createBorderPaddingBackgroundProperties() { + private void createBorderPaddingBackgroundProperties() { // CSOK: MethodLength PropertyMaker m; BorderWidthPropertyMaker bwm; CorrespondingPropertyMaker corr; @@ -606,7 +610,7 @@ public final class FOPropertyMapping implements Constants { m.addKeyword("center", "50%"); m.addKeyword("right", "100%"); m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL); - m.addShorthand(s_generics[PR_BACKGROUND_POSITION]); + m.addShorthand(generics[PR_BACKGROUND_POSITION]); addPropertyMaker("background-position-horizontal", m); // background-position-vertical @@ -617,7 +621,7 @@ public final class FOPropertyMapping implements Constants { m.addKeyword("center", "50%"); m.addKeyword("bottom", "100%"); m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL); - m.addShorthand(s_generics[PR_BACKGROUND_POSITION]); + m.addShorthand(generics[PR_BACKGROUND_POSITION]); addPropertyMaker("background-position-vertical", m); // border-before-color @@ -745,9 +749,9 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericColor); m.setInherited(false); m.setDefault("black"); - m.addShorthand(s_generics[PR_BORDER_TOP]); - m.addShorthand(s_generics[PR_BORDER_COLOR]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_TOP]); + m.addShorthand(generics[PR_BORDER_COLOR]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_BEFORE_COLOR, PR_BORDER_BEFORE_COLOR, PR_BORDER_START_COLOR); @@ -756,9 +760,9 @@ public final class FOPropertyMapping implements Constants { // border-top-style m = new EnumProperty.Maker(PR_BORDER_TOP_STYLE); m.useGeneric(genericBorderStyle); - m.addShorthand(s_generics[PR_BORDER_TOP]); - m.addShorthand(s_generics[PR_BORDER_STYLE]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_TOP]); + m.addShorthand(generics[PR_BORDER_STYLE]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_BEFORE_STYLE, PR_BORDER_BEFORE_STYLE, PR_BORDER_START_STYLE); @@ -768,9 +772,9 @@ public final class FOPropertyMapping implements Constants { bwm = new BorderWidthPropertyMaker(PR_BORDER_TOP_WIDTH); bwm.useGeneric(genericBorderWidth); bwm.setBorderStyleId(PR_BORDER_TOP_STYLE); - bwm.addShorthand(s_generics[PR_BORDER_TOP]); - bwm.addShorthand(s_generics[PR_BORDER_WIDTH]); - bwm.addShorthand(s_generics[PR_BORDER]); + bwm.addShorthand(generics[PR_BORDER_TOP]); + bwm.addShorthand(generics[PR_BORDER_WIDTH]); + bwm.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(bwm); corr.setCorresponding(PR_BORDER_BEFORE_WIDTH, PR_BORDER_BEFORE_WIDTH, PR_BORDER_START_WIDTH); @@ -781,9 +785,9 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericColor); m.setInherited(false); m.setDefault("black"); - m.addShorthand(s_generics[PR_BORDER_BOTTOM]); - m.addShorthand(s_generics[PR_BORDER_COLOR]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_BOTTOM]); + m.addShorthand(generics[PR_BORDER_COLOR]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_AFTER_COLOR, PR_BORDER_AFTER_COLOR, PR_BORDER_END_COLOR); @@ -792,9 +796,9 @@ public final class FOPropertyMapping implements Constants { // border-bottom-style m = new EnumProperty.Maker(PR_BORDER_BOTTOM_STYLE); m.useGeneric(genericBorderStyle); - m.addShorthand(s_generics[PR_BORDER_BOTTOM]); - m.addShorthand(s_generics[PR_BORDER_STYLE]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_BOTTOM]); + m.addShorthand(generics[PR_BORDER_STYLE]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_AFTER_STYLE, PR_BORDER_AFTER_STYLE, PR_BORDER_END_STYLE); @@ -804,9 +808,9 @@ public final class FOPropertyMapping implements Constants { bwm = new BorderWidthPropertyMaker(PR_BORDER_BOTTOM_WIDTH); bwm.useGeneric(genericBorderWidth); bwm.setBorderStyleId(PR_BORDER_BOTTOM_STYLE); - bwm.addShorthand(s_generics[PR_BORDER_BOTTOM]); - bwm.addShorthand(s_generics[PR_BORDER_WIDTH]); - bwm.addShorthand(s_generics[PR_BORDER]); + bwm.addShorthand(generics[PR_BORDER_BOTTOM]); + bwm.addShorthand(generics[PR_BORDER_WIDTH]); + bwm.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(bwm); corr.setCorresponding(PR_BORDER_AFTER_WIDTH, PR_BORDER_AFTER_WIDTH, PR_BORDER_END_WIDTH); @@ -817,9 +821,9 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericColor); m.setInherited(false); m.setDefault("black"); - m.addShorthand(s_generics[PR_BORDER_LEFT]); - m.addShorthand(s_generics[PR_BORDER_COLOR]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_LEFT]); + m.addShorthand(generics[PR_BORDER_COLOR]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_START_COLOR, PR_BORDER_END_COLOR, PR_BORDER_AFTER_COLOR); @@ -828,9 +832,9 @@ public final class FOPropertyMapping implements Constants { // border-left-style m = new EnumProperty.Maker(PR_BORDER_LEFT_STYLE); m.useGeneric(genericBorderStyle); - m.addShorthand(s_generics[PR_BORDER_LEFT]); - m.addShorthand(s_generics[PR_BORDER_STYLE]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_LEFT]); + m.addShorthand(generics[PR_BORDER_STYLE]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_START_STYLE, PR_BORDER_END_STYLE, PR_BORDER_AFTER_STYLE); @@ -840,9 +844,9 @@ public final class FOPropertyMapping implements Constants { bwm = new BorderWidthPropertyMaker(PR_BORDER_LEFT_WIDTH); bwm.useGeneric(genericBorderWidth); bwm.setBorderStyleId(PR_BORDER_LEFT_STYLE); - bwm.addShorthand(s_generics[PR_BORDER_LEFT]); - bwm.addShorthand(s_generics[PR_BORDER_WIDTH]); - bwm.addShorthand(s_generics[PR_BORDER]); + bwm.addShorthand(generics[PR_BORDER_LEFT]); + bwm.addShorthand(generics[PR_BORDER_WIDTH]); + bwm.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(bwm); corr.setCorresponding(PR_BORDER_START_WIDTH, PR_BORDER_END_WIDTH, PR_BORDER_AFTER_WIDTH); @@ -853,9 +857,9 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericColor); m.setInherited(false); m.setDefault("black"); - m.addShorthand(s_generics[PR_BORDER_RIGHT]); - m.addShorthand(s_generics[PR_BORDER_COLOR]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_RIGHT]); + m.addShorthand(generics[PR_BORDER_COLOR]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_END_COLOR, PR_BORDER_START_COLOR, PR_BORDER_BEFORE_COLOR); @@ -864,9 +868,9 @@ public final class FOPropertyMapping implements Constants { // border-right-style m = new EnumProperty.Maker(PR_BORDER_RIGHT_STYLE); m.useGeneric(genericBorderStyle); - m.addShorthand(s_generics[PR_BORDER_RIGHT]); - m.addShorthand(s_generics[PR_BORDER_STYLE]); - m.addShorthand(s_generics[PR_BORDER]); + m.addShorthand(generics[PR_BORDER_RIGHT]); + m.addShorthand(generics[PR_BORDER_STYLE]); + m.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(m); corr.setCorresponding(PR_BORDER_END_STYLE, PR_BORDER_START_STYLE, PR_BORDER_BEFORE_STYLE); @@ -876,9 +880,9 @@ public final class FOPropertyMapping implements Constants { bwm = new BorderWidthPropertyMaker(PR_BORDER_RIGHT_WIDTH); bwm.useGeneric(genericBorderWidth); bwm.setBorderStyleId(PR_BORDER_RIGHT_STYLE); - bwm.addShorthand(s_generics[PR_BORDER_RIGHT]); - bwm.addShorthand(s_generics[PR_BORDER_WIDTH]); - bwm.addShorthand(s_generics[PR_BORDER]); + bwm.addShorthand(generics[PR_BORDER_RIGHT]); + bwm.addShorthand(generics[PR_BORDER_WIDTH]); + bwm.addShorthand(generics[PR_BORDER]); corr = new CorrespondingPropertyMaker(bwm); corr.setCorresponding(PR_BORDER_END_WIDTH, PR_BORDER_START_WIDTH, PR_BORDER_BEFORE_WIDTH); @@ -964,7 +968,7 @@ public final class FOPropertyMapping implements Constants { m = new FontFamilyProperty.Maker(PR_FONT_FAMILY); m.setInherited(true); m.setDefault("sans-serif,Symbol,ZapfDingbats"); - m.addShorthand(s_generics[PR_FONT]); + m.addShorthand(generics[PR_FONT]); addPropertyMaker("font-family", m); // font-selection-strategy @@ -990,7 +994,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("larger", getEnumProperty(EN_LARGER, "LARGER")); m.addEnum("smaller", getEnumProperty(EN_SMALLER, "SMALLER")); m.setPercentBase(LengthBase.INH_FONTSIZE); - m.addShorthand(s_generics[PR_FONT]); + m.addShorthand(generics[PR_FONT]); addPropertyMaker("font-size", m); // font-stretch @@ -1024,7 +1028,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("oblique", getEnumProperty(EN_OBLIQUE, "OBLIQUE")); m.addEnum("backslant", getEnumProperty(EN_BACKSLANT, "BACKSLANT")); m.setDefault("normal"); - m.addShorthand(s_generics[PR_FONT]); + m.addShorthand(generics[PR_FONT]); addPropertyMaker("font-style", m); // font-variant @@ -1033,7 +1037,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL")); m.addEnum("small-caps", getEnumProperty(EN_SMALL_CAPS, "SMALL_CAPS")); m.setDefault("normal"); - m.addShorthand(s_generics[PR_FONT]); + m.addShorthand(generics[PR_FONT]); addPropertyMaker("font-variant", m); // font-weight @@ -1053,7 +1057,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("800", getEnumProperty(EN_800, "800")); m.addEnum("900", getEnumProperty(EN_900, "900")); m.setDefault("400"); - m.addShorthand(s_generics[PR_FONT]); + m.addShorthand(generics[PR_FONT]); addPropertyMaker("font-weight", m); } @@ -1064,14 +1068,14 @@ public final class FOPropertyMapping implements Constants { m = new StringProperty.Maker(PR_COUNTRY); m.setInherited(true); m.setDefault("none"); - m.addShorthand(s_generics[PR_XML_LANG]); + m.addShorthand(generics[PR_XML_LANG]); addPropertyMaker("country", m); // language m = new StringProperty.Maker(PR_LANGUAGE); m.setInherited(true); m.setDefault("none"); - m.addShorthand(s_generics[PR_XML_LANG]); + m.addShorthand(generics[PR_XML_LANG]); addPropertyMaker("language", m); // script @@ -1114,7 +1118,7 @@ public final class FOPropertyMapping implements Constants { m = new LengthProperty.Maker(PR_MARGIN_TOP); m.setInherited(false); m.setDefault("0pt"); - m.addShorthand(s_generics[PR_MARGIN]); + m.addShorthand(generics[PR_MARGIN]); m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH); addPropertyMaker("margin-top", m); @@ -1122,7 +1126,7 @@ public final class FOPropertyMapping implements Constants { m = new LengthProperty.Maker(PR_MARGIN_BOTTOM); m.setInherited(false); m.setDefault("0pt"); - m.addShorthand(s_generics[PR_MARGIN]); + m.addShorthand(generics[PR_MARGIN]); m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH); addPropertyMaker("margin-bottom", m); @@ -1130,7 +1134,7 @@ public final class FOPropertyMapping implements Constants { m = new LengthProperty.Maker(PR_MARGIN_LEFT); m.setInherited(false); m.setDefault("0pt"); - m.addShorthand(s_generics[PR_MARGIN]); + m.addShorthand(generics[PR_MARGIN]); m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH); addPropertyMaker("margin-left", m); @@ -1138,7 +1142,7 @@ public final class FOPropertyMapping implements Constants { m = new LengthProperty.Maker(PR_MARGIN_RIGHT); m.setInherited(false); m.setDefault("0pt"); - m.addShorthand(s_generics[PR_MARGIN]); + m.addShorthand(generics[PR_MARGIN]); m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH); addPropertyMaker("margin-right", m); @@ -1218,7 +1222,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("static", getEnumProperty(EN_STATIC, "STATIC")); m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE")); m.setDefault("static"); - m.addShorthand(s_generics[PR_POSITION]); + m.addShorthand(generics[PR_POSITION]); addPropertyMaker("relative-position", m); } @@ -1242,7 +1246,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL")); m.setDefault("auto"); m.setPercentBase(LengthBase.ALIGNMENT_ADJUST); - m.addShorthand(s_generics[PR_VERTICAL_ALIGN]); + m.addShorthand(generics[PR_VERTICAL_ALIGN]); addPropertyMaker("alignment-adjust", m); // alignment-baseline @@ -1261,7 +1265,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING")); m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL")); m.setDefault("auto"); - m.addShorthand(s_generics[PR_VERTICAL_ALIGN]); + m.addShorthand(generics[PR_VERTICAL_ALIGN]); addPropertyMaker("alignment-baseline", m); // baseline-shift @@ -1271,7 +1275,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("sub", getEnumProperty(EN_SUB, "SUB")); m.addEnum("super", getEnumProperty(EN_SUPER, "SUPER")); m.setDefault("baseline"); - m.addShorthand(s_generics[PR_VERTICAL_ALIGN]); + m.addShorthand(generics[PR_VERTICAL_ALIGN]); m.setPercentBase(LengthBase.CUSTOM_BASE); addPropertyMaker("baseline-shift", m); @@ -1303,7 +1307,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE")); m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE")); m.setDefault("auto"); - m.addShorthand(s_generics[PR_VERTICAL_ALIGN]); + m.addShorthand(generics[PR_VERTICAL_ALIGN]); addPropertyMaker("dominant-baseline", m); // relative-align @@ -1315,7 +1319,7 @@ public final class FOPropertyMapping implements Constants { addPropertyMaker("relative-align", m); } - private void createAreaDimensionProperties() { + private void createAreaDimensionProperties() { // CSOK: MethodLength PropertyMaker m; LengthProperty.Maker l; DimensionPropertyMaker pdim; @@ -1464,8 +1468,10 @@ public final class FOPropertyMapping implements Constants { m = new EnumProperty.Maker(PR_SCALING_METHOD); m.setInherited(false); m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO")); - m.addEnum("integer-pixels", getEnumProperty(EN_INTEGER_PIXELS, "INTEGER_PIXELS")); - m.addEnum("resample-any-method", getEnumProperty(EN_RESAMPLE_ANY_METHOD, "RESAMPLE_ANY_METHOD")); + m.addEnum("integer-pixels", + getEnumProperty(EN_INTEGER_PIXELS, "INTEGER_PIXELS")); + m.addEnum("resample-any-method", + getEnumProperty(EN_RESAMPLE_ANY_METHOD, "RESAMPLE_ANY_METHOD")); m.setDefault("auto"); addPropertyMaker("scaling-method", m); @@ -1484,7 +1490,7 @@ public final class FOPropertyMapping implements Constants { addPropertyMaker("fox:block-progression-unit", l); } - private void createBlockAndLineProperties() { + private void createBlockAndLineProperties() { // CSOK: MethodLength PropertyMaker m; // hyphenation-keep @@ -1517,7 +1523,7 @@ public final class FOPropertyMapping implements Constants { m.addKeyword("normal", "1.2"); m.setPercentBase(LengthBase.FONTSIZE); m.setDefault("normal", true); - m.addShorthand(s_generics[PR_FONT]); + m.addShorthand(generics[PR_FONT]); addPropertyMaker("line-height", m); // line-height-shift-adjustment @@ -1543,9 +1549,11 @@ public final class FOPropertyMapping implements Constants { m.addEnum("ignore", getEnumProperty(EN_IGNORE, "IGNORE")); m.addEnum("preserve", getEnumProperty(EN_PRESERVE, "PRESERVE")); m.addEnum("treat-as-space", getEnumProperty(EN_TREAT_AS_SPACE, "TREAT_AS_SPACE")); - m.addEnum("treat-as-zero-width-space", getEnumProperty(EN_TREAT_AS_ZERO_WIDTH_SPACE, "TREAT_AS_ZERO_WIDTH_SPACE")); + m.addEnum("treat-as-zero-width-space", + getEnumProperty(EN_TREAT_AS_ZERO_WIDTH_SPACE, + "TREAT_AS_ZERO_WIDTH_SPACE")); m.setDefault("treat-as-space"); - m.addShorthand(s_generics[PR_WHITE_SPACE]); + m.addShorthand(generics[PR_WHITE_SPACE]); addPropertyMaker("linefeed-treatment", m); // white-space-treatment @@ -1553,11 +1561,17 @@ public final class FOPropertyMapping implements Constants { m.setInherited(true); m.addEnum("ignore", getEnumProperty(EN_IGNORE, "IGNORE")); m.addEnum("preserve", getEnumProperty(EN_PRESERVE, "PRESERVE")); - m.addEnum("ignore-if-before-linefeed", getEnumProperty(EN_IGNORE_IF_BEFORE_LINEFEED, "IGNORE_IF_BEFORE_LINEFEED")); - m.addEnum("ignore-if-after-linefeed", getEnumProperty(EN_IGNORE_IF_AFTER_LINEFEED, "IGNORE_IF_AFTER_LINEFEED")); - m.addEnum("ignore-if-surrounding-linefeed", getEnumProperty(EN_IGNORE_IF_SURROUNDING_LINEFEED, "IGNORE_IF_SURROUNDING_LINEFEED")); + m.addEnum("ignore-if-before-linefeed", + getEnumProperty(EN_IGNORE_IF_BEFORE_LINEFEED, + "IGNORE_IF_BEFORE_LINEFEED")); + m.addEnum("ignore-if-after-linefeed", + getEnumProperty(EN_IGNORE_IF_AFTER_LINEFEED, + "IGNORE_IF_AFTER_LINEFEED")); + m.addEnum("ignore-if-surrounding-linefeed", + getEnumProperty(EN_IGNORE_IF_SURROUNDING_LINEFEED, + "IGNORE_IF_SURROUNDING_LINEFEED")); m.setDefault("ignore-if-surrounding-linefeed"); - m.addShorthand(s_generics[PR_WHITE_SPACE]); + m.addShorthand(generics[PR_WHITE_SPACE]); addPropertyMaker("white-space-treatment", m); // text-align TODO: make it a StringProperty with enums. @@ -1637,7 +1651,7 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericBoolean); m.setInherited(true); m.setDefault("true"); - m.addShorthand(s_generics[PR_WHITE_SPACE]); + m.addShorthand(generics[PR_WHITE_SPACE]); addPropertyMaker("white-space-collapse", m); // wrap-option @@ -1646,7 +1660,7 @@ public final class FOPropertyMapping implements Constants { m.addEnum("wrap", getEnumProperty(EN_WRAP, "WRAP")); m.addEnum("no-wrap", getEnumProperty(EN_NO_WRAP, "NO_WRAP")); m.setDefault("wrap"); - m.addShorthand(s_generics[PR_WHITE_SPACE]); + m.addShorthand(generics[PR_WHITE_SPACE]); addPropertyMaker("wrap-option", m); } @@ -1750,9 +1764,11 @@ public final class FOPropertyMapping implements Constants { m.setInherited(false); m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO")); m.addEnum("perceptual", getEnumProperty(EN_PERCEPTUAL, "PERCEPTUAL")); - m.addEnum("relative-colorimetric", getEnumProperty(EN_RELATIVE_COLOMETRIC, "RELATIVE_COLOMETRIC")); + m.addEnum("relative-colorimetric", getEnumProperty(EN_RELATIVE_COLOMETRIC, + "RELATIVE_COLOMETRIC")); m.addEnum("saturation", getEnumProperty(EN_SATURATION, "SATURATION")); - m.addEnum("absolute-colorimetric", getEnumProperty(EN_ABSOLUTE_COLORMETRIC, "ABSOLUTE_COLORMETRIC")); + m.addEnum("absolute-colorimetric", getEnumProperty(EN_ABSOLUTE_COLORMETRIC, + "ABSOLUTE_COLORMETRIC")); m.setDefault("auto"); addPropertyMaker("rendering-intent", m); } @@ -1804,13 +1820,13 @@ public final class FOPropertyMapping implements Constants { // break-after m = new EnumProperty.Maker(PR_BREAK_AFTER); m.useGeneric(genericBreak); - m.addShorthand(s_generics[PR_PAGE_BREAK_AFTER]); + m.addShorthand(generics[PR_PAGE_BREAK_AFTER]); addPropertyMaker("break-after", m); // break-before m = new EnumProperty.Maker(PR_BREAK_BEFORE); m.useGeneric(genericBreak); - m.addShorthand(s_generics[PR_PAGE_BREAK_BEFORE]); + m.addShorthand(generics[PR_PAGE_BREAK_BEFORE]); addPropertyMaker("break-before", m); // keep-together @@ -1818,7 +1834,7 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericKeep); m.setInherited(true); m.setDefault("auto"); - m.addShorthand(s_generics[PR_PAGE_BREAK_INSIDE]); + m.addShorthand(generics[PR_PAGE_BREAK_INSIDE]); addPropertyMaker("keep-together", m); // keep-with-next @@ -1826,7 +1842,7 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericKeep); m.setInherited(false); m.setDefault("auto"); - m.addShorthand(s_generics[PR_PAGE_BREAK_AFTER]); + m.addShorthand(generics[PR_PAGE_BREAK_AFTER]); addPropertyMaker("keep-with-next", m); // keep-with-previous @@ -1834,7 +1850,7 @@ public final class FOPropertyMapping implements Constants { m.useGeneric(genericKeep); m.setInherited(false); m.setDefault("auto"); - m.addShorthand(s_generics[PR_PAGE_BREAK_BEFORE]); + m.addShorthand(generics[PR_PAGE_BREAK_BEFORE]); addPropertyMaker("keep-with-previous", m); // orphans @@ -2240,7 +2256,8 @@ public final class FOPropertyMapping implements Constants { m.setInherited(false); m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO")); m.addEnum("paginate", getEnumProperty(EN_PAGINATE, "PAGINATE")); - m.addEnum("bounded-in-one-dimension", getEnumProperty(EN_BOUNDED_IN_ONE_DIMENSION, "BOUNDED_IN_ONE_DIMENSION")); + m.addEnum("bounded-in-one-dimension", getEnumProperty(EN_BOUNDED_IN_ONE_DIMENSION, + "BOUNDED_IN_ONE_DIMENSION")); m.addEnum("unbounded", getEnumProperty(EN_UNBOUNDED, "UNBOUNDED")); m.setDefault("auto"); addPropertyMaker("media-usage", m); @@ -2330,7 +2347,7 @@ public final class FOPropertyMapping implements Constants { // border-separation m = new LengthPairProperty.Maker(PR_BORDER_SEPARATION); m.setInherited(true); - m.addShorthand(s_generics[PR_BORDER_SPACING]); + m.addShorthand(generics[PR_BORDER_SPACING]); sub = new LengthProperty.Maker(CP_BLOCK_PROGRESSION_DIRECTION); sub.setDefault("0pt"); @@ -2577,7 +2594,7 @@ public final class FOPropertyMapping implements Constants { addPropertyMaker("z-index", m); } - private void createShorthandProperties() { + private void createShorthandProperties() { // CSOK: MethodLength PropertyMaker m; // background diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index 08ffa40a3..5db11f731 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -489,10 +489,10 @@ public class FOText extends FONode implements CharSequence { private class TextCharIterator extends CharIterator { - int currentPosition = 0; + private int currentPosition = 0; - boolean canRemove = false; - boolean canReplace = false; + private boolean canRemove = false; + private boolean canReplace = false; /** {@inheritDoc} */ public boolean hasNext() { diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 133d932bc..244013c4d 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -44,7 +44,7 @@ import org.apache.fop.fo.properties.PropertyMaker; public abstract class FObj extends FONode implements Constants { /** the list of property makers */ - private static final PropertyMaker[] propertyListTable + private static final PropertyMaker[] propertyListTable // CSOK: ConstantName = FOPropertyMapping.getGenericMappings(); /** @@ -255,7 +255,7 @@ public abstract class FObj extends FONode implements Constants { /** * Check if this formatting object generates reference areas. * @return true if generates reference areas - * @todo see if needed + * @asf.todo see if needed */ public boolean generatesReferenceAreas() { return false; @@ -610,7 +610,7 @@ public abstract class FObj extends FONode implements Constants { return (super.toString() + "[@id=" + this.id + "]"); } - /** Basic {@link FONodeIterator} implementation */ + /** Basic {@link FONode.FONodeIterator} implementation */ public class FObjIterator implements FONodeIterator { private static final int F_NONE_ALLOWED = 0; diff --git a/src/java/org/apache/fop/fo/NullCharIterator.java b/src/java/org/apache/fop/fo/NullCharIterator.java index 2b2a2a9a0..db872caec 100644 --- a/src/java/org/apache/fop/fo/NullCharIterator.java +++ b/src/java/org/apache/fop/fo/NullCharIterator.java @@ -28,6 +28,10 @@ public class NullCharIterator extends CharIterator { private static CharIterator instance; + /** + * Obtain the singleton instance of the null character iterator. + * @return the char iterator + */ public static CharIterator getInstance() { if (instance == null) { instance = new NullCharIterator(); diff --git a/src/java/org/apache/fop/fo/PropertyListMaker.java b/src/java/org/apache/fop/fo/PropertyListMaker.java index e48541af5..ef8978b0c 100644 --- a/src/java/org/apache/fop/fo/PropertyListMaker.java +++ b/src/java/org/apache/fop/fo/PropertyListMaker.java @@ -23,6 +23,13 @@ package org.apache.fop.fo; * A PropertyListMaker is a factory that creates PropertyLists. */ public interface PropertyListMaker { + + /** + * Make a property list. + * @param fobj the FO from which the new property list is associated + * @param parentPropertyList the parent property list + * @return the new property list + */ PropertyList make(FObj fobj, PropertyList parentPropertyList); } diff --git a/src/java/org/apache/fop/fo/StaticPropertyList.java b/src/java/org/apache/fop/fo/StaticPropertyList.java index 5e6559e84..c3ab95b91 100644 --- a/src/java/org/apache/fop/fo/StaticPropertyList.java +++ b/src/java/org/apache/fop/fo/StaticPropertyList.java @@ -14,6 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* $Id$ */ + package org.apache.fop.fo; import org.apache.fop.fo.expr.PropertyException; @@ -62,14 +65,14 @@ public class StaticPropertyList extends PropertyList { /** * Override PropertyList.get() and provides fast caching of previously * retrieved property values. - * @param propId The property ID + * {@inheritDoc} */ public Property get(int propId, boolean bTryInherit, boolean bTryDefault) - throws PropertyException - { + throws PropertyException { Property p = values[propId]; if (p == null) { - p = values[propId] = super.get(propId, bTryInherit, bTryDefault); + p = super.get(propId, bTryInherit, bTryDefault); + values[propId] = p; } return p; } diff --git a/src/java/org/apache/fop/fo/ValidationException.java b/src/java/org/apache/fop/fo/ValidationException.java index 103c5fcc8..2285fbd19 100644 --- a/src/java/org/apache/fop/fo/ValidationException.java +++ b/src/java/org/apache/fop/fo/ValidationException.java @@ -26,10 +26,20 @@ import org.xml.sax.Locator; * Exception thrown during FO tree validation. */ public class ValidationException extends FOPException { + + /** + * Construct a validation exception instance. + * @param message a message + */ public ValidationException(String message) { super(message); } + /** + * Construct a validation exception instance. + * @param message a message + * @param locator a locator + */ public ValidationException(String message, Locator locator) { super(message, locator); } diff --git a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java index eb68b2a23..5307e75b0 100644 --- a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java +++ b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java @@ -47,8 +47,9 @@ public class BodyStartFunction extends FunctionBase { */ public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException { - Numeric distance = - pInfo.getPropertyList().get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getNumeric(); + Numeric distance + = pInfo.getPropertyList() + .get(Constants.PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getNumeric(); PropertyList pList = pInfo.getPropertyList(); while (pList != null && !(pList.getFObj() instanceof ListItem)) { diff --git a/src/java/org/apache/fop/fo/expr/NumericOp.java b/src/java/org/apache/fop/fo/expr/NumericOp.java index 9fe35d96d..d1f91d509 100644 --- a/src/java/org/apache/fop/fo/expr/NumericOp.java +++ b/src/java/org/apache/fop/fo/expr/NumericOp.java @@ -30,7 +30,11 @@ import org.apache.fop.datatypes.Numeric; * The evaluation of the operation can then occur when getNumericValue() is * called. */ -public class NumericOp { +public final class NumericOp { + + private NumericOp() { + } + /** * Add the two operands and return a new Numeric representing the result. * @param op1 The first operand. @@ -39,7 +43,8 @@ public class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric addition(Numeric op1, Numeric op2) throws PropertyException { + public static Numeric addition(Numeric op1, Numeric op2) + throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return addition2(op1, op2, null); } else { @@ -47,11 +52,23 @@ public class NumericOp { } } - public static Numeric addition2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { + /** + * Add the two operands with a percentage context + * and return a new Numeric representing the result. + * @param op1 The first operand. + * @param op2 The second operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric addition2(Numeric op1, Numeric op2, PercentBaseContext context) + throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Can't subtract Numerics of different dimensions"); } - return numeric(op1.getNumericValue(context) + op2.getNumericValue(context), op1.getDimension()); + return numeric(op1.getNumericValue(context) + + op2.getNumericValue(context), op1.getDimension()); } /** @@ -63,7 +80,8 @@ public class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric subtraction(Numeric op1, Numeric op2) throws PropertyException { + public static Numeric subtraction(Numeric op1, Numeric op2) + throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return subtraction2(op1, op2, null); } else { @@ -71,11 +89,23 @@ public class NumericOp { } } - public static Numeric subtraction2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { + /** + * Subtract the two operands with a percentage context + * and return a new Numeric representing the result. + * @param op1 The first operand. + * @param op2 The second operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric subtraction2(Numeric op1, Numeric op2, PercentBaseContext context) + throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Can't subtract Numerics of different dimensions"); } - return numeric(op1.getNumericValue(context) - op2.getNumericValue(context), op1.getDimension()); + return numeric(op1.getNumericValue(context) + - op2.getNumericValue(context), op1.getDimension()); } /** @@ -87,7 +117,8 @@ public class NumericOp { * @throws PropertyException If the dimension of the operand is different * from the dimension of this Numeric. */ - public static Numeric multiply(Numeric op1, Numeric op2) throws PropertyException { + public static Numeric multiply(Numeric op1, Numeric op2) + throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return multiply2(op1, op2, null); } else { @@ -95,7 +126,18 @@ public class NumericOp { } } - public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { + /** + * Multiply the two operands with a percentage context + * and return a new Numeric representing the result. + * @param op1 The first operand. + * @param op2 The second operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context) + throws PropertyException { return numeric(op1.getNumericValue(context) * op2.getNumericValue(context), op1.getDimension() + op2.getDimension()); } @@ -118,7 +160,18 @@ public class NumericOp { } } - public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { + /** + * Divide the two operands with a percentage context + * and return a new Numeric representing the result. + * @param op1 The first operand. + * @param op2 The second operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context) + throws PropertyException { return numeric(op1.getNumericValue(context) / op2.getNumericValue(context), op1.getDimension() - op2.getDimension()); } @@ -128,8 +181,10 @@ public class NumericOp { * @param op1 The first operand. * @param op2 The second operand. * @return A new Numeric object representing the absolute value. + * @throws PropertyException if a property exception occurs */ - public static Numeric modulo(Numeric op1, Numeric op2) throws PropertyException { + public static Numeric modulo(Numeric op1, Numeric op2) + throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return modulo2(op1, op2, null); } else { @@ -137,16 +192,29 @@ public class NumericOp { } } - public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { - return numeric(op1.getNumericValue(context) % op2.getNumericValue(context), op1.getDimension()); + /** + * Return the remainder of a division of the two operand Numeric. + * @param op1 The first operand. + * @param op2 The second operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context) + throws PropertyException { + return numeric(op1.getNumericValue(context) + % op2.getNumericValue(context), op1.getDimension()); } /** * Return the absolute value of a Numeric. * @param op the operand. * @return a new Numeric object representing the absolute value of the operand. + * @throws PropertyException if a property exception occurs */ - public static Numeric abs(Numeric op) throws PropertyException { + public static Numeric abs(Numeric op) + throws PropertyException { if (op.isAbsolute()) { return abs2(op, null); } else { @@ -154,7 +222,16 @@ public class NumericOp { } } - public static Numeric abs2(Numeric op, PercentBaseContext context) throws PropertyException { + /** + * Return the absolute value of a Numeric. + * @param op the operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric abs2(Numeric op, PercentBaseContext context) + throws PropertyException { return numeric(Math.abs(op.getNumericValue(context)), op.getDimension()); } @@ -162,8 +239,10 @@ public class NumericOp { * Return the negation of a Numeric. * @param op the operand. * @return a new Numeric object representing the negation of the operand. + * @throws PropertyException if a property exception occurs */ - public static Numeric negate(Numeric op) throws PropertyException { + public static Numeric negate(Numeric op) + throws PropertyException { if (op.isAbsolute()) { return negate2(op, null); } else { @@ -171,8 +250,18 @@ public class NumericOp { } } - public static Numeric negate2(Numeric op, PercentBaseContext context) throws PropertyException { - return numeric(- op.getNumericValue(context), op.getDimension()); + + /** + * Return the negation of a Numeric. + * @param op the operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric negate2(Numeric op, PercentBaseContext context) + throws PropertyException { + return numeric(-op.getNumericValue(context), op.getDimension()); } /** @@ -182,7 +271,8 @@ public class NumericOp { * @return a Numeric which is the maximum of the two operands. * @throws PropertyException if the dimensions or value types of the operands are different. */ - public static Numeric max(Numeric op1, Numeric op2) throws PropertyException { + public static Numeric max(Numeric op1, Numeric op2) + throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return max2(op1, op2, null); } else { @@ -190,7 +280,17 @@ public class NumericOp { } } - public static Numeric max2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { + /** + * Return the larger of the two Numerics. + * @param op1 The first operand. + * @param op2 The second operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric max2(Numeric op1, Numeric op2, PercentBaseContext context) + throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Arguments to max() must have same dimensions"); } @@ -204,7 +304,8 @@ public class NumericOp { * @return a Numeric which is the minimum of the two operands. * @throws PropertyException if the dimensions or value types of the operands are different. */ - public static Numeric min(Numeric op1, Numeric op2) throws PropertyException { + public static Numeric min(Numeric op1, Numeric op2) + throws PropertyException { if (op1.isAbsolute() && op2.isAbsolute()) { return min2(op1, op2, null); } else { @@ -212,7 +313,17 @@ public class NumericOp { } } - public static Numeric min2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { + /** + * Return the smaller of the two Numerics. + * @param op1 The first operand. + * @param op2 The second operand. + * @param context a percent base context + * @return A Numeric representing the result. + * @throws PropertyException If the dimension of the operand is different + * from the dimension of this Numeric. + */ + public static Numeric min2(Numeric op1, Numeric op2, PercentBaseContext context) + throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Arguments to min() must have same dimensions"); } @@ -221,8 +332,8 @@ public class NumericOp { /** * Create a new absolute numeric with the specified value and dimension. - * @param value - * @param dimension + * @param value of numeric + * @param dimension of numeric * @return a new absolute numeric. */ private static Numeric numeric(double value, int dimension) { diff --git a/src/java/org/apache/fop/fo/expr/PropertyInfo.java b/src/java/org/apache/fop/fo/expr/PropertyInfo.java index 2bce0793f..0463e2e1d 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyInfo.java +++ b/src/java/org/apache/fop/fo/expr/PropertyInfo.java @@ -58,6 +58,7 @@ public class PropertyInfo { * a percent specification. * Propagates to the Maker. * @return The PercentBase object or null if percentLengthOK()=false. + * @throws PropertyException if a property exception occurs */ public PercentBase getPercentBase() throws PropertyException { PercentBase pcbase = getFunctionPercentBase(); @@ -66,6 +67,7 @@ public class PropertyInfo { /** * @return the current font-size value as base units (milli-points). + * @throws PropertyException if a property exception occurs */ public Length currentFontSize() throws PropertyException { return plist.get(Constants.PR_FONT_SIZE).getLength(); diff --git a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java index 5baa0c4d8..3008dbebe 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java +++ b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java @@ -83,7 +83,7 @@ class PropertyTokenizer { boolean currentMaybeOperator = recognizeOperator; boolean bSawDecimal; recognizeOperator = true; - for (; ;) { + while ( true ) { if (exprIndex >= exprLength) { currentToken = TOK_EOF; return; @@ -273,8 +273,11 @@ class PropertyTokenizer { } private void scanRestOfName() { - while (++exprIndex < exprLength - && isNameChar(expr.charAt(exprIndex))) { } + while ( ++exprIndex < exprLength ) { + if ( !isNameChar ( expr.charAt ( exprIndex ) ) ) { + break; + } + } } /** @@ -320,8 +323,8 @@ class PropertyTokenizer { } - private static final String NAME_START_CHARS = - "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + private static final String NAME_START_CHARS + = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; private static final String NAME_CHARS = ".-0123456789"; private static final String DIGITS = "0123456789"; private static final String HEX_CHARS = DIGITS + "abcdefABCDEF"; @@ -331,7 +334,7 @@ class PropertyTokenizer { * decimal digit (0-9). * @param c The character to check */ - private static final boolean isDigit(char c) { + private static boolean isDigit(char c) { return DIGITS.indexOf(c) >= 0; } @@ -340,7 +343,7 @@ class PropertyTokenizer { * hexadecimal digit (0-9, A-F, a-f). * @param c The character to check */ - private static final boolean isHexDigit(char c) { + private static boolean isHexDigit(char c) { return HEX_CHARS.indexOf(c) >= 0; } @@ -349,15 +352,16 @@ class PropertyTokenizer { * as defined by XSL (space, newline, CR, tab). * @param c The character to check */ - private static final boolean isSpace(char c) { + private static boolean isSpace(char c) { switch (c) { case ' ': case '\r': case '\n': case '\t': return true; + default: + return false; } - return false; } /** @@ -365,7 +369,7 @@ class PropertyTokenizer { * start character, ie. can start a NAME as defined by XSL. * @param c The character to check */ - private static final boolean isNameStartChar(char c) { + private static boolean isNameStartChar(char c) { return NAME_START_CHARS.indexOf(c) >= 0 || c >= 0x80; } @@ -374,7 +378,7 @@ class PropertyTokenizer { * character, ie. can occur in a NAME as defined by XSL. * @param c The character to check */ - private static final boolean isNameChar(char c) { + private static boolean isNameChar(char c) { return NAME_START_CHARS.indexOf(c) >= 0 || NAME_CHARS.indexOf(c) >= 0 || c >= 0x80; } diff --git a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java index a4e257546..883070056 100644 --- a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java +++ b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java @@ -33,14 +33,23 @@ import org.apache.fop.fo.properties.TableColLength; * or getValue() is called. */ public class RelativeNumericProperty extends Property implements Length { + /** ADDITION */ public static final int ADDITION = 1; + /** SUBTRACTION */ public static final int SUBTRACTION = 2; + /** MULTIPLY */ public static final int MULTIPLY = 3; + /** DIVIDE */ public static final int DIVIDE = 4; + /** MODULO */ public static final int MODULO = 5; + /** NEGATE */ public static final int NEGATE = 6; + /** ABS */ public static final int ABS = 7; + /** MAX */ public static final int MAX = 8; + /** MIN */ public static final int MIN = 9; // Used in the toString() method, indexed by operation id. @@ -145,6 +154,7 @@ public class RelativeNumericProperty extends Property implements Length { /** * Return the dimension of the expression + * @return numeric value as dimension */ public int getDimension() { return dimension; @@ -153,6 +163,7 @@ public class RelativeNumericProperty extends Property implements Length { /** * Return false since an expression is only created when there is relative * numerics involved. + * @return true if expression is absolute */ public boolean isAbsolute() { return false; @@ -160,6 +171,7 @@ public class RelativeNumericProperty extends Property implements Length { /** * Cast this numeric as a Length. + * @return numeric value as length */ public Length getLength() { if (dimension == 1) { @@ -169,6 +181,7 @@ public class RelativeNumericProperty extends Property implements Length { return null; } + /** @return numeric value */ public Numeric getNumeric() { return this; } @@ -272,7 +285,8 @@ public class RelativeNumericProperty extends Property implements Length { return "min(" + op1 + ", " + op2 + ")"; case ABS: return "abs(" + op1 + ")"; + default: + return "unknown operation " + operation; } - return "unknown operation " + operation; } } diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java index f9a556167..32d0d745c 100644 --- a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java +++ b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java @@ -37,7 +37,8 @@ public class ExtensionElementMapping extends ElementMapping { /** The FOP extension namespace URI */ public static final String URI = "http://xmlgraphics.apache.org/fop/extensions"; - private static final Set propertyAttributes = new java.util.HashSet(); + private static final Set propertyAttributes // CSOK: ConstantName + = new java.util.HashSet(); static { //These are FOP's standard extension properties (fox:*) diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionObj.java b/src/java/org/apache/fop/fo/extensions/ExtensionObj.java index da732f421..4329f1a7e 100644 --- a/src/java/org/apache/fop/fo/extensions/ExtensionObj.java +++ b/src/java/org/apache/fop/fo/extensions/ExtensionObj.java @@ -47,13 +47,15 @@ public abstract class ExtensionObj extends FObj { */ public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) - throws FOPException - { - // Empty + throws FOPException { } /** * Create a default property list for this element. + * @param parent the parent property list + * @param foEventHandler an event handler + * @return property list + * @throws FOPException in case of exception */ protected PropertyList createPropertyList(PropertyList parent, FOEventHandler foEventHandler) throws FOPException { diff --git a/src/java/org/apache/fop/fo/extensions/ExternalDocument.java b/src/java/org/apache/fop/fo/extensions/ExternalDocument.java index 233714bd7..a6f5e7680 100644 --- a/src/java/org/apache/fop/fo/extensions/ExternalDocument.java +++ b/src/java/org/apache/fop/fo/extensions/ExternalDocument.java @@ -82,13 +82,18 @@ public class ExternalDocument extends AbstractPageSequence implements GraphicsPr } } + /** + * @throws FOPException in case of processing exception + * @see org.apache.fop.fo.FONode#startOfNode() + */ protected void startOfNode() throws FOPException { super.startOfNode(); getFOEventHandler().startExternalDocument(this); } /** - * @see org.apache.fop.fo.FONode#endOfNode + * @throws FOPException in case of processing exception + * @see org.apache.fop.fo.FONode#endOfNode() */ protected void endOfNode() throws FOPException { getFOEventHandler().endExternalDocument(this); @@ -96,8 +101,11 @@ public class ExternalDocument extends AbstractPageSequence implements GraphicsPr } /** + * @param loc a locator + * @param nsURI a namespace uri or null + * @param localName a local name + * @throws ValidationException if invalid child * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) - XSL/FOP: empty */ protected void validateChildNode(Locator loc, String nsURI, String localName) throws ValidationException { @@ -162,17 +170,26 @@ public class ExternalDocument extends AbstractPageSequence implements GraphicsPr return textAlign; } - /** @see org.apache.fop.fo.FONode#getNamespaceURI() */ + /** + * @return namespace uri + * @see org.apache.fop.fo.FONode#getNamespaceURI() + */ public String getNamespaceURI() { return ExtensionElementMapping.URI; } - /** @see org.apache.fop.fo.FONode#getNormalNamespacePrefix() */ + /** + * @return namespace prefix + * @see org.apache.fop.fo.FONode#getNormalNamespacePrefix() + */ public String getNormalNamespacePrefix() { return "fox"; } - /** @see org.apache.fop.fo.FONode#getLocalName() */ + /** + * @return local name + * @see org.apache.fop.fo.FONode#getLocalName() + */ public String getLocalName() { return "external-document"; } diff --git a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java index 2cc451b64..449258525 100644 --- a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java +++ b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java @@ -53,7 +53,7 @@ public class BatikExtensionElementMapping extends ElementMapping { * Batik classes that apparently need it (error messages, perhaps) * @return an XML parser classname */ - private final String getAParserClassName() { + private String getAParserClassName() { try { //TODO Remove when Batik uses JAXP instead of SAX directly. SAXParserFactory factory = SAXParserFactory.newInstance(); @@ -63,6 +63,7 @@ public class BatikExtensionElementMapping extends ElementMapping { } } + /** initialize mapping */ protected void initialize() { if (foObjs == null && batikAvail) { // this sets the parser that will be used diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGDOMContentHandlerFactory.java b/src/java/org/apache/fop/fo/extensions/svg/SVGDOMContentHandlerFactory.java index 6556c7251..67f6567c9 100644 --- a/src/java/org/apache/fop/fo/extensions/svg/SVGDOMContentHandlerFactory.java +++ b/src/java/org/apache/fop/fo/extensions/svg/SVGDOMContentHandlerFactory.java @@ -105,7 +105,7 @@ public class SVGDOMContentHandlerFactory implements ContentHandlerFactory { Class clazz = Class.forName( "org.apache.batik.dom.svg12.SVG12DOMImplementation"); return (DOMImplementation)clazz.getMethod( - "getDOMImplementation", null).invoke(null, null); + "getDOMImplementation", (Class[])null).invoke(null, (Object[])null); } catch (Exception e) { return SVGDOMImplementation.getDOMImplementation(); } diff --git a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java index 0f4575c5b..7bc0ff00c 100644 --- a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java +++ b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java @@ -109,7 +109,9 @@ public abstract class AbstractPageNumberCitation extends FObj } /** {@inheritDoc} */ - public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException { + public void processNode + (String elementName, Locator locator, Attributes attlist, PropertyList pList) + throws FOPException { super.processNode(elementName, locator, attlist, pList); if (!inMarker() && (refId == null || "".equals(refId))) { missingPropertyError("ref-id"); diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java index e3176464d..66e06db83 100644 --- a/src/java/org/apache/fop/fo/flow/Block.java +++ b/src/java/org/apache/fop/fo/flow/Block.java @@ -330,7 +330,8 @@ public class Block extends FObjMixed implements BreakPropertySet, StructurePoint /** * @return the "fox:disable-column-balancing" property, one of - * {@link Constants#EN_TRUE}, {@link Constants#EN_FALSE} + * {@link org.apache.fop.fo.Constants#EN_TRUE}, + * {@link org.apache.fop.fo.Constants#EN_FALSE} */ public int getDisableColumnBalancing() { return disableColumnBalancing; diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java index 2a8d73002..57cb6e5c6 100644 --- a/src/java/org/apache/fop/fo/flow/BlockContainer.java +++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java @@ -219,7 +219,8 @@ public class BlockContainer extends FObj implements BreakPropertySet { /** * @return the "fox:disable-column-balancing" property, one of - * {@link Constants#EN_TRUE}, {@link Constants#EN_FALSE} + * {@link org.apache.fop.fo.Constants#EN_TRUE}, + * {@link org.apache.fop.fo.Constants#EN_FALSE} */ public int getDisableColumnBalancing() { return disableColumnBalancing; diff --git a/src/java/org/apache/fop/fo/flow/Float.java b/src/java/org/apache/fop/fo/flow/Float.java index 815b30393..5d8fcdc2c 100644 --- a/src/java/org/apache/fop/fo/flow/Float.java +++ b/src/java/org/apache/fop/fo/flow/Float.java @@ -38,7 +38,7 @@ public class Float extends FObj { // private int clear; // End of property values - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/Footnote.java b/src/java/org/apache/fop/fo/flow/Footnote.java index e73701c3b..9967a54d8 100644 --- a/src/java/org/apache/fop/fo/flow/Footnote.java +++ b/src/java/org/apache/fop/fo/flow/Footnote.java @@ -76,9 +76,9 @@ public class Footnote extends FObj { /** * {@inheritDoc} * <br>XSL Content Model: (inline,footnote-body) - * @todo implement additional constraint: A fo:footnote is not permitted + * @asf.todo implement additional constraint: A fo:footnote is not permitted * to have a fo:float, fo:footnote, or fo:marker as a descendant. - * @todo implement additional constraint: A fo:footnote is not + * @asf.todo implement additional constraint: A fo:footnote is not * permitted to have as a descendant a fo:block-container that * generates an absolutely positioned area. */ diff --git a/src/java/org/apache/fop/fo/flow/Inline.java b/src/java/org/apache/fop/fo/flow/Inline.java index e6e8e9c01..d9ae63ec8 100644 --- a/src/java/org/apache/fop/fo/flow/Inline.java +++ b/src/java/org/apache/fop/fo/flow/Inline.java @@ -120,7 +120,8 @@ public class Inline extends InlineLevel implements StructurePointerPropertySet { } else if (!isBlockOrInlineItem(nsURI, localName)) { invalidChildError(loc, nsURI, localName); } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)) { - invalidChildError(loc, getParent().getName(), nsURI, getName(), "rule.inlineContent"); + invalidChildError(loc, getParent().getName(), nsURI, getName(), + "rule.inlineContent"); } else { blockOrInlineItemFound = true; } diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java index c25fc8cab..1b32e3f1e 100644 --- a/src/java/org/apache/fop/fo/flow/Leader.java +++ b/src/java/org/apache/fop/fo/flow/Leader.java @@ -30,7 +30,7 @@ import org.apache.fop.fo.properties.LengthRangeProperty; * <code>fo:leader</code></a> object. * The main property of <code>fo:leader</code> is leader-pattern. * The following patterns are treated: rule, space, dots and use-content. - * @todo implement validateChildNode() + * @asf.todo implement validateChildNode() */ public class Leader extends InlineLevel { // The value of properties relevant for fo:leader. diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java index f748bc15a..3f714dbd8 100644 --- a/src/java/org/apache/fop/fo/flow/ListItem.java +++ b/src/java/org/apache/fop/fo/flow/ListItem.java @@ -119,7 +119,7 @@ public class ListItem extends FObj implements BreakPropertySet { /** * {@inheritDoc} - * @todo see if can/should rely on base class for this + * @asf.todo see if can/should rely on base class for this * (i.e., add to childNodes instead) */ public void addChildNode(FONode child) { diff --git a/src/java/org/apache/fop/fo/flow/Marker.java b/src/java/org/apache/fop/fo/flow/Marker.java index 01863c0c7..e23a13f33 100644 --- a/src/java/org/apache/fop/fo/flow/Marker.java +++ b/src/java/org/apache/fop/fo/flow/Marker.java @@ -111,7 +111,7 @@ public class Marker extends FObjMixed { * <br><i>Additionally: "An fo:marker may contain any formatting objects that * are permitted as a replacement of any fo:retrieve-marker that retrieves * the fo:marker's children."</i> - * @todo implement "additional" constraint, possibly within fo:retrieve-marker + * @asf.todo implement "additional" constraint, possibly within fo:retrieve-marker */ protected void validateChildNode(Locator loc, String nsURI, String localName) throws ValidationException { @@ -199,17 +199,25 @@ public class Marker extends FObjMixed { name = attributes.getLocalName(i); value = attributes.getValue(i); - this.attribs[i] = - MarkerAttribute.getInstance(namespace, qname, name, value); + this.attribs[i] + = MarkerAttribute.getInstance(namespace, qname, name, value); } } - /** Null implementation; not used by this type of {@link PropertyList} */ + /** + * Null implementation; not used by this type of {@link PropertyList}. + * @param propId the propert id + * @param value the property value + */ public void putExplicit(int propId, Property value) { //nop } - /** Null implementation; not used by this type of {@link PropertyList} */ + /** + * Null implementation; not used by this type of {@link PropertyList}. + * @param propId the propert id + * @return the property id + */ public Property getExplicit(int propId) { return null; } @@ -259,7 +267,11 @@ public class Marker extends FObjMixed { } } - /** Default implementation; not used */ + /** + * Default implementation; not used. + * @param index a type index + * @return type string + */ public String getType(int index) { return "CDATA"; } @@ -305,12 +317,21 @@ public class Marker extends FObjMixed { return index; } - /** Default implementation; not used */ + /** + * Default implementation; not used + * @param name a type name + * @param namespace a type namespace + * @return type string + */ public String getType(String name, String namespace) { return "CDATA"; } - /** Default implementation; not used */ + /** + * Default implementation; not used + * @param qname a type name + * @return type string + */ public String getType(String qname) { return "CDATA"; } @@ -337,12 +358,16 @@ public class Marker extends FObjMixed { /** Convenience inner class */ public static final class MarkerAttribute { - private static PropertyCache attributeCache = - new PropertyCache(MarkerAttribute.class); + private static PropertyCache attributeCache + = new PropertyCache(MarkerAttribute.class); + /** namespace */ protected String namespace; + /** qualfied name */ protected String qname; + /** local name */ protected String name; + /** value */ protected String value; /** diff --git a/src/java/org/apache/fop/fo/flow/MultiCase.java b/src/java/org/apache/fop/fo/flow/MultiCase.java index b2d630ba7..76bded0be 100644 --- a/src/java/org/apache/fop/fo/flow/MultiCase.java +++ b/src/java/org/apache/fop/fo/flow/MultiCase.java @@ -27,7 +27,7 @@ import org.apache.fop.fo.PropertyList; /** * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_multi-case"> * <code>fo:multi-case</code></a> object. - * @todo implement validateChildNode() + * @asf.todo implement validateChildNode() */ public class MultiCase extends FObj { // The value of properties relevant for fo:multi-case. @@ -38,7 +38,7 @@ public class MultiCase extends FObj { // private CommonAccessibility commonAccessibility; // End of property values - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/MultiProperties.java b/src/java/org/apache/fop/fo/flow/MultiProperties.java index 091934203..3e2e57d97 100644 --- a/src/java/org/apache/fop/fo/flow/MultiProperties.java +++ b/src/java/org/apache/fop/fo/flow/MultiProperties.java @@ -37,11 +37,11 @@ public class MultiProperties extends FObj { // private CommonAccessibility commonAccessibility; // End of property values - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; // used for input FO validation - boolean hasMultiPropertySet = false; - boolean hasWrapper = false; + private boolean hasMultiPropertySet = false; + private boolean hasWrapper = false; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java index 96e73ec97..6e7c6a3e0 100644 --- a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java +++ b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java @@ -37,7 +37,7 @@ public class MultiPropertySet extends FObj { // private ToBeImplementedProperty activeState; // End of property values - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java index 1db72159e..aa18d6cdf 100644 --- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java +++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java @@ -39,7 +39,7 @@ public class MultiSwitch extends FObj { // private CommonAccessibility commonAccessibility; // End of property values - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/MultiToggle.java b/src/java/org/apache/fop/fo/flow/MultiToggle.java index aacfda8eb..10766680e 100644 --- a/src/java/org/apache/fop/fo/flow/MultiToggle.java +++ b/src/java/org/apache/fop/fo/flow/MultiToggle.java @@ -39,7 +39,7 @@ public class MultiToggle extends FObj { // public ToBeImplementedProperty prSwitchTo; // End of property values - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; /** * Base constructor diff --git a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java index c58ecc628..3fe977b21 100644 --- a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java +++ b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java @@ -16,6 +16,7 @@ */ /* $Id$ */ + package org.apache.fop.fo.flow; import org.apache.fop.fo.FONode; @@ -50,7 +51,9 @@ public class RetrieveTableMarker extends AbstractRetrieveMarker { * <i>NOTE: An <code>fo:retrieve-table-marker</code> is only permitted as a descendant * of an <code>fo:table-header</code> or an <code>fo:table-footer</code>.</i> */ - public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException { + public void processNode + (String elementName, Locator locator, Attributes attlist, PropertyList pList) + throws FOPException { if (findAncestor(FO_TABLE_HEADER) < 0 && findAncestor(FO_TABLE_FOOTER) < 0) { invalidChildError(locator, getParent().getName(), FO_URI, getName(), diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java index 74072da87..7fb412521 100644 --- a/src/java/org/apache/fop/fo/flow/Wrapper.java +++ b/src/java/org/apache/fop/fo/flow/Wrapper.java @@ -76,7 +76,8 @@ public class Wrapper extends FObjMixed { try { FONode.validateChildNode(this.parent, loc, nsURI, localName); } catch (ValidationException vex) { - invalidChildError(loc, getName(), FO_URI, localName, "rule.wrapperInvalidChildForParent"); + invalidChildError(loc, getName(), FO_URI, localName, + "rule.wrapperInvalidChildForParent"); } blockOrInlineItemFound = true; } else { diff --git a/src/java/org/apache/fop/fo/flow/table/ColumnNumberManager.java b/src/java/org/apache/fop/fo/flow/table/ColumnNumberManager.java index 1f73f5f10..9f3ed195d 100644 --- a/src/java/org/apache/fop/fo/flow/table/ColumnNumberManager.java +++ b/src/java/org/apache/fop/fo/flow/table/ColumnNumberManager.java @@ -77,8 +77,7 @@ public class ColumnNumberManager { for (int i = 0; i < pendingSpans.size(); i++) { pSpan = (PendingSpan) pendingSpans.get(i); if (pSpan != null) { - pSpan.rowsLeft--; - if (pSpan.rowsLeft == 0) { + if ( pSpan.decrRowsLeft() == 0 ) { pendingSpans.set(i, null); } else { usedColumnIndices.set(i); diff --git a/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java b/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java index 5ff01b7fa..b5cd56d47 100644 --- a/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java +++ b/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java @@ -36,20 +36,23 @@ import org.apache.fop.layoutmgr.table.CollapsingBorderModel; */ public class ConditionalBorder { + /** normal border */ public static final int NORMAL = 0; + /** leading and trailing border */ public static final int LEADING_TRAILING = 1; + /** all the rest */ public static final int REST = 2; /** Normal case, no break. */ - BorderSpecification normal; + BorderSpecification normal; // CSOK: VisibilityModifier /** Special case: the cell is at the top or the bottom of the page. */ - BorderSpecification leadingTrailing; + BorderSpecification leadingTrailing; // CSOK: VisibilityModifier /** Special case: break inside the cell. */ - BorderSpecification rest; + BorderSpecification rest; // CSOK: VisibilityModifier /** The model used to resolve borders. */ private CollapsingBorderModel collapsingBorderModel; diff --git a/src/java/org/apache/fop/fo/flow/table/GridUnit.java b/src/java/org/apache/fop/fo/flow/table/GridUnit.java index 229a7177f..37f3df37c 100644 --- a/src/java/org/apache/fop/fo/flow/table/GridUnit.java +++ b/src/java/org/apache/fop/fo/flow/table/GridUnit.java @@ -65,13 +65,13 @@ public class GridUnit { private byte flags = 0; /** the border-before specification */ - ConditionalBorder borderBefore; + ConditionalBorder borderBefore; // CSOK: VisibilityModifier /** the border-after specification */ - ConditionalBorder borderAfter; + ConditionalBorder borderAfter; // CSOK: VisibilityModifier /** the border-start specification */ - BorderSpecification borderStart; + BorderSpecification borderStart; // CSOK: VisibilityModifier /** the border-end specification */ - BorderSpecification borderEnd; + BorderSpecification borderEnd; // CSOK: VisibilityModifier /** The border model helper associated with the table */ protected CollapsingBorderModel collapsingBorderModel; diff --git a/src/java/org/apache/fop/fo/flow/table/PendingSpan.java b/src/java/org/apache/fop/fo/flow/table/PendingSpan.java index 321684fae..0a5a2b41a 100644 --- a/src/java/org/apache/fop/fo/flow/table/PendingSpan.java +++ b/src/java/org/apache/fop/fo/flow/table/PendingSpan.java @@ -27,7 +27,7 @@ class PendingSpan { /** * member variable holding the number of rows left */ - int rowsLeft; + private int rowsLeft; /** * Constructor @@ -37,4 +37,22 @@ class PendingSpan { public PendingSpan(int rows) { rowsLeft = rows; } + + /** @return number of rows spanned */ + public int getRowsLeft() { + return rowsLeft; + } + + /** + * Decrement rows spanned. + * @return number of rows spanned after decrementing + */ + public int decrRowsLeft() { + if ( rowsLeft > 0 ) { + return --rowsLeft; + } else { + return 0; + } + } + }
\ No newline at end of file diff --git a/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java b/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java index 9326d6cd4..529a6acc2 100644 --- a/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java +++ b/src/java/org/apache/fop/fo/flow/table/PrimaryGridUnit.java @@ -85,6 +85,10 @@ public class PrimaryGridUnit extends GridUnit { return (TablePart) node; } + /** + * Get cell's layout manager. + * @return the cell's layout manager + */ public TableCellLayoutManager getCellLM() { assert cellLM != null; return cellLM; @@ -109,6 +113,10 @@ public class PrimaryGridUnit extends GridUnit { this.elements = elements; } + /** + * Obtain the Knuth elements. + * @return a list of Knuth elements + */ public List getElements() { return this.elements; } @@ -247,6 +255,10 @@ public class PrimaryGridUnit extends GridUnit { return this.rows; } + /** + * Add a row. + * @param row the row to be added + */ public void addRow(GridUnit[] row) { if (rows == null) { rows = new java.util.ArrayList(); diff --git a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java index 919e73bfb..5ee5e78ad 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java +++ b/src/java/org/apache/fop/fo/flow/table/TableAndCaption.java @@ -30,7 +30,7 @@ import org.apache.fop.fo.ValidationException; /** * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_table-and-caption"> * <code>fo:table-and-caption</code></a> property. - * @todo needs implementation + * @asf.todo needs implementation */ public class TableAndCaption extends FObj /*implements BreakPropertySet*/ { // The value of properties relevant for fo:table-and-caption. @@ -50,7 +50,7 @@ public class TableAndCaption extends FObj /*implements BreakPropertySet*/ { // private int textAlign; // End of property values - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; /** used for FO validation */ private boolean tableCaptionFound = false; diff --git a/src/java/org/apache/fop/fo/flow/table/TableCaption.java b/src/java/org/apache/fop/fo/flow/table/TableCaption.java index bbc9b52bc..fc5d3d5b7 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableCaption.java +++ b/src/java/org/apache/fop/fo/flow/table/TableCaption.java @@ -49,7 +49,7 @@ public class TableCaption extends FObj { /** used for FO validation */ private boolean blockItemFound = false; - static boolean notImplementedWarningGiven = false; + private static boolean notImplementedWarningGiven = false; /** * Create a TableCaption instance with the given {@link FONode} diff --git a/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java b/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java index 9b4fe755f..41eab578f 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java +++ b/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java @@ -30,14 +30,26 @@ import org.apache.fop.fo.FONode; */ public abstract class TableCellContainer extends TableFObj implements ColumnNumberManagerHolder { + /** list of pending spans */ protected List pendingSpans; + /** column number manager */ protected ColumnNumberManager columnNumberManager; + /** + * Construct table cell container. + * @param parent the parent node of the cell container + */ public TableCellContainer(FONode parent) { super(parent); } + /** + * Add cell to current row. + * @param cell a table cell to add + * @param firstRow true is first row + * @throws FOPException if exception occurs + */ protected void addTableCellChild(TableCell cell, boolean firstRow) throws FOPException { int colNumber = cell.getColumnNumber(); int colSpan = cell.getNumberColumnsSpanned(); diff --git a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java index d6abf609e..792151360 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java +++ b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java @@ -32,7 +32,10 @@ import org.apache.fop.fo.expr.PropertyException; public interface TableEventProducer extends EventProducer { /** Provider class for the event producer. */ - class Provider { + static final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/fo/flow/table/TableFObj.java b/src/java/org/apache/fop/fo/flow/table/TableFObj.java index ab8676cb3..6ba763933 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableFObj.java +++ b/src/java/org/apache/fop/fo/flow/table/TableFObj.java @@ -50,12 +50,12 @@ public abstract class TableFObj extends FObj implements StructurePointerProperty private Numeric borderStartPrecedence; private String ptr; - ConditionalBorder borderBefore; - ConditionalBorder borderAfter; - BorderSpecification borderStart; - BorderSpecification borderEnd; + ConditionalBorder borderBefore; // CSOK: VisibilityModifier + ConditionalBorder borderAfter; // CSOK: VisibilityModifier + BorderSpecification borderStart; // CSOK: VisibilityModifier + BorderSpecification borderEnd; // CSOK: VisibilityModifier - CollapsingBorderModel collapsingBorderModel; + CollapsingBorderModel collapsingBorderModel; // CSOK: VisibilityModifier /** * Create a TableFObj instance that is a child @@ -205,9 +205,10 @@ public abstract class TableFObj extends FObj implements StructurePointerProperty int foId = propertyList.getFObj().getNameId(); if (i <= 0) { if (foId == FO_TABLE_CELL || foId == FO_TABLE_COLUMN) { - ColumnNumberManagerHolder parent = - (ColumnNumberManagerHolder) propertyList.getParentFObj(); - ColumnNumberManager columnIndexManager = parent.getColumnNumberManager(); + ColumnNumberManagerHolder parent + = (ColumnNumberManagerHolder) propertyList.getParentFObj(); + ColumnNumberManager columnIndexManager + = parent.getColumnNumberManager(); i = columnIndexManager.getCurrentColumnNumber(); } else { /* very exceptional case: @@ -216,10 +217,11 @@ public abstract class TableFObj extends FObj implements StructurePointerProperty */ i = 1; } - TableEventProducer eventProducer = - TableEventProducer.Provider.get(fo.getUserAgent().getEventBroadcaster()); - eventProducer.forceNextColumnNumber(this, propertyList.getFObj().getName(), - val, i, propertyList.getFObj().getLocator()); + TableEventProducer eventProducer + = TableEventProducer.Provider.get(fo.getUserAgent().getEventBroadcaster()); + eventProducer.forceNextColumnNumber + (this, propertyList.getFObj().getName(), + val, i, propertyList.getFObj().getLocator()); } return NumberProperty.getInstance(i); } @@ -229,7 +231,9 @@ public abstract class TableFObj extends FObj implements StructurePointerProperty } /** {@inheritDoc} */ - public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException { + public void processNode + (String elementName, Locator locator, Attributes attlist, PropertyList pList) + throws FOPException { super.processNode(elementName, locator, attlist, pList); Table table = getTable(); if (!inMarker() && !table.isSeparateBorderModel()) { diff --git a/src/java/org/apache/fop/fo/flow/table/TablePart.java b/src/java/org/apache/fop/fo/flow/table/TablePart.java index 5b04cddc7..3ab92cc94 100644 --- a/src/java/org/apache/fop/fo/flow/table/TablePart.java +++ b/src/java/org/apache/fop/fo/flow/table/TablePart.java @@ -46,10 +46,9 @@ public abstract class TablePart extends TableCellContainer { // private int visibility; // End of property values - /** - * used for validation - */ + /** table rows found */ protected boolean tableRowsFound = false; + /** table cells found */ protected boolean tableCellsFound = false; private boolean firstRow = true; @@ -124,6 +123,10 @@ public abstract class TablePart extends TableCellContainer { return this; } + /** + * Finish last row group. + * @throws ValidationException if content validation exception + */ protected void finishLastRowGroup() throws ValidationException { if (!inMarker()) { RowGroupBuilder rowGroupBuilder = getTable().getRowGroupBuilder(); @@ -214,6 +217,7 @@ public abstract class TablePart extends TableCellContainer { rowGroups.add(rowGroup); } + /** @return list of row groups */ public List getRowGroups() { return rowGroups; } diff --git a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java index dce36f95c..51b24b314 100644 --- a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java @@ -34,7 +34,9 @@ import org.apache.fop.fo.PropertyList; public abstract class AbstractPageSequence extends FObj { // The value of properties relevant for fo:page-sequence. + /** initial page number */ protected Numeric initialPageNumber; + /** forced page count */ protected int forcePageCount; private String format; private int letterValue; @@ -45,6 +47,7 @@ public abstract class AbstractPageSequence extends FObj { private PageNumberGenerator pageNumberGenerator; + /** starting page number */ protected int startingPageNumber = 0; /** diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 26812166d..01ca5863e 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -151,7 +151,7 @@ public class PageSequence extends AbstractPageSequence { /** * {@inheritDoc} - * @todo see if addChildNode() should also be called for fo's other than + * @asf.todo see if addChildNode() should also be called for fo's other than * fo:flow. */ public void addChildNode(FONode child) throws FOPException { @@ -254,10 +254,9 @@ public class PageSequence extends AbstractPageSequence { * @return the SimplePageMaster to use for this page * @throws PageProductionException if there's a problem determining the page master */ - public SimplePageMaster getNextSimplePageMaster(int page, - boolean isFirstPage, - boolean isLastPage, - boolean isBlank) throws PageProductionException { + public SimplePageMaster getNextSimplePageMaster + (int page, boolean isFirstPage, boolean isLastPage, boolean isBlank) + throws PageProductionException { if (pageSequenceMaster == null) { return simplePageMaster; diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java index 165bb4734..cb265706d 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java @@ -106,8 +106,10 @@ public class RegionBody extends Region { * Also the values are resolved relative to the page size * and reference orientation. */ - PercentBaseContext pageWidthContext = getPageWidthContext(LengthBase.CONTAINING_BLOCK_WIDTH); - PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CONTAINING_BLOCK_WIDTH); + PercentBaseContext pageWidthContext + = getPageWidthContext(LengthBase.CONTAINING_BLOCK_WIDTH); + PercentBaseContext pageHeightContext + = getPageHeightContext(LengthBase.CONTAINING_BLOCK_WIDTH); int start; int end; diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index fcbb54abd..2a634c24a 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -144,7 +144,11 @@ public class Root extends FObj { } - /** @inheritDoc */ + /** + * @param loc location in the source file + * @param child the {@link FONode} to validate against + * @throws ValidationException if the incoming node is not a valid child for the given FO + */ protected void validateChildNode(Locator loc, FONode child) throws ValidationException { if (child instanceof AbstractPageSequence) { pageSequenceFound = true; @@ -207,7 +211,8 @@ public class Root extends FObj { * @param additionalPages the total pages generated by the sequence (for statistics) * @throws IllegalArgumentException for negative additional page counts */ - public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) { + public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) + throws IllegalArgumentException { if (additionalPages >= 0) { totalPagesGenerated += additionalPages; diff --git a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java index 709fdf7f2..58f1ac210 100644 --- a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java +++ b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java @@ -57,7 +57,8 @@ public class BackgroundPositionShorthand extends ListProperty { * specified, <code>background-position-vertical</code> is set * to "50%". */ - public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException { + public Property make(PropertyList propertyList, String value, FObj fo) + throws PropertyException { Property p = super.make(propertyList, value, fo); if (p.getList().size() == 1) { /* only background-position-horizontal specified diff --git a/src/java/org/apache/fop/fo/properties/BorderSpacingShorthandParser.java b/src/java/org/apache/fop/fo/properties/BorderSpacingShorthandParser.java index 37cb2119c..7822db3f8 100644 --- a/src/java/org/apache/fop/fo/properties/BorderSpacingShorthandParser.java +++ b/src/java/org/apache/fop/fo/properties/BorderSpacingShorthandParser.java @@ -29,6 +29,7 @@ import org.apache.fop.fo.expr.PropertyException; */ public class BorderSpacingShorthandParser extends GenericShorthandParser { + /** {@inheritDoc} */ protected Property convertValueForProperty(int propId, Property property, PropertyMaker maker, PropertyList propertyList) throws PropertyException { diff --git a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java index 7c2854759..467682878 100644 --- a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java @@ -28,7 +28,8 @@ import org.apache.fop.fo.expr.PropertyException; * border width described in 7.7.20. */ public class BorderWidthPropertyMaker extends LengthProperty.Maker { - int borderStyleId = 0; + + private int borderStyleId = 0; /** * Create a length property which check the value of the border-*-style @@ -41,7 +42,7 @@ public class BorderWidthPropertyMaker extends LengthProperty.Maker { /** * Set the propId of the style property for the same side. - * @param borderStyleId + * @param borderStyleId the border style id */ public void setBorderStyleId(int borderStyleId) { this.borderStyleId = borderStyleId; @@ -55,8 +56,7 @@ public class BorderWidthPropertyMaker extends LengthProperty.Maker { public Property get(int subpropId, PropertyList propertyList, boolean bTryInherit, boolean bTryDefault) - throws PropertyException - { + throws PropertyException { Property p = super.get(subpropId, propertyList, bTryInherit, bTryDefault); diff --git a/src/java/org/apache/fop/fo/properties/CharacterProperty.java b/src/java/org/apache/fop/fo/properties/CharacterProperty.java index c078da0c7..71b70ebee 100644 --- a/src/java/org/apache/fop/fo/properties/CharacterProperty.java +++ b/src/java/org/apache/fop/fo/properties/CharacterProperty.java @@ -24,6 +24,8 @@ import org.apache.fop.fo.PropertyList; /** * Superclass for properties that wrap a character value + * @asf.todo convert character value to int in order to denote unicode scalar value + * instead of a single UTF-16 code element */ public final class CharacterProperty extends Property { @@ -39,6 +41,7 @@ public final class CharacterProperty extends Property { super(propId); } + /** {@inheritDoc} */ public Property make(PropertyList propertyList, String value, FObj fo) { char c = value.charAt(0); @@ -48,7 +51,8 @@ public final class CharacterProperty extends Property { } /** cache containing all canonical CharacterProperty instances */ - private static final PropertyCache cache = new PropertyCache(CharacterProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(CharacterProperty.class); private final char character; @@ -59,6 +63,11 @@ public final class CharacterProperty extends Property { this.character = character; } + /** + * Get character property instance for character. + * @param character the character + * @return the character property instance + */ public static CharacterProperty getInstance(char character) { return (CharacterProperty) cache.fetch( new CharacterProperty(character)); diff --git a/src/java/org/apache/fop/fo/properties/ColorProperty.java b/src/java/org/apache/fop/fo/properties/ColorProperty.java index 925d275af..95725f3e8 100644 --- a/src/java/org/apache/fop/fo/properties/ColorProperty.java +++ b/src/java/org/apache/fop/fo/properties/ColorProperty.java @@ -33,7 +33,8 @@ import org.apache.fop.util.ColorUtil; public final class ColorProperty extends Property { /** cache holding canonical ColorProperty instances */ - private static final PropertyCache cache = new PropertyCache(ColorProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(ColorProperty.class); /** * The color represented by this property. @@ -97,7 +98,8 @@ public final class ColorProperty extends Property { * @throws PropertyException if the value can't be parsed * @see ColorUtil#parseColorString(FOUserAgent, String) */ - public static ColorProperty getInstance(FOUserAgent foUserAgent, String value) throws PropertyException { + public static ColorProperty getInstance(FOUserAgent foUserAgent, String value) + throws PropertyException { ColorProperty instance = new ColorProperty( ColorUtil.parseColorString( foUserAgent, value)); diff --git a/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java b/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java index e32e9dbd9..f803439b9 100644 --- a/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java +++ b/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java @@ -33,31 +33,32 @@ public class CommonAbsolutePosition { /** * The "absolute-position" property. */ - public int absolutePosition; + public int absolutePosition; // CSOK: VisibilityModifier /** * The "top" property. */ - public Length top; + public Length top; // CSOK: VisibilityModifier /** * The "right" property. */ - public Length right; + public Length right; // CSOK: VisibilityModifier /** * The "bottom" property. */ - public Length bottom; + public Length bottom; // CSOK: VisibilityModifier /** * The "left" property. */ - public Length left; + public Length left; // CSOK: VisibilityModifier /** * Create a CommonAbsolutePosition object. * @param pList The PropertyList with propery values. + * @throws PropertyException if a property exception is raised */ public CommonAbsolutePosition(PropertyList pList) throws PropertyException { absolutePosition = pList.get(Constants.PR_ABSOLUTE_POSITION).getEnum(); @@ -67,6 +68,7 @@ public class CommonAbsolutePosition { right = pList.get(Constants.PR_RIGHT).getLength(); } + /** {@inheritDoc} */ public String toString() { StringBuffer sb = new StringBuffer("CommonAbsolutePosition{"); sb.append(" absPos="); diff --git a/src/java/org/apache/fop/fo/properties/CommonAccessibility.java b/src/java/org/apache/fop/fo/properties/CommonAccessibility.java index 74edf046b..dc17228d2 100644 --- a/src/java/org/apache/fop/fo/properties/CommonAccessibility.java +++ b/src/java/org/apache/fop/fo/properties/CommonAccessibility.java @@ -32,16 +32,17 @@ public class CommonAccessibility { /** * The "source-doc" property. */ - public String sourceDoc = null; + public String sourceDoc = null; // CSOK: VisibilityModifier /** * The "role" property. */ - public String role = null; + public String role = null; // CSOK: VisibilityModifier /** * Create a <code>CommonAccessibility</code> object. * @param pList The PropertyList with propery values. + * @throws PropertyException if a property exception is raised */ public CommonAccessibility(PropertyList pList) throws PropertyException { sourceDoc = pList.get(Constants.PR_SOURCE_DOCUMENT).getString(); diff --git a/src/java/org/apache/fop/fo/properties/CommonAural.java b/src/java/org/apache/fop/fo/properties/CommonAural.java index a47f183f1..c805ab4fe 100644 --- a/src/java/org/apache/fop/fo/properties/CommonAural.java +++ b/src/java/org/apache/fop/fo/properties/CommonAural.java @@ -30,92 +30,92 @@ public class CommonAural { /** * The "azimuth" property. */ - public int azimuth; + public int azimuth; // CSOK: VisibilityModifier /** * The "cueAfter" property. */ - public String cueAfter; + public String cueAfter; // CSOK: VisibilityModifier /** * The "cueBefore" property. */ - public String cueBefore; + public String cueBefore; // CSOK: VisibilityModifier /** * The "elevation" property. */ - public int elevation; + public int elevation; // CSOK: VisibilityModifier /** * The "pauseAfter" property. */ - public int pauseAfter; + public int pauseAfter; // CSOK: VisibilityModifier /** * The "pauseBefore" property. */ - public int pauseBefore; + public int pauseBefore; // CSOK: VisibilityModifier /** * The "pitch" property. */ - public int pitch; + public int pitch; // CSOK: VisibilityModifier /** * The "pitch-range" property. */ - public int pitchRange; + public int pitchRange; // CSOK: VisibilityModifier /** * The "playDuring" property. */ - public int playDuring; + public int playDuring; // CSOK: VisibilityModifier /** * The "richness" property. */ - public int richness; + public int richness; // CSOK: VisibilityModifier /** * The "speak" property. */ - public int speak; + public int speak; // CSOK: VisibilityModifier /** * The "speak-header" property. */ - public int speakHeader; + public int speakHeader; // CSOK: VisibilityModifier /** * The "speak-numeral" property. */ - public int speakNumeral; + public int speakNumeral; // CSOK: VisibilityModifier /** * The "speak-punctuation" property. */ - public int speakPunctuation; + public int speakPunctuation; // CSOK: VisibilityModifier /** * The "speech-rate" property. */ - public int speechRate; + public int speechRate; // CSOK: VisibilityModifier /** * The "stress" property. */ - public int stress; + public int stress; // CSOK: VisibilityModifier /** * The "voice-family" property. */ - public int voiceFamily; + public int voiceFamily; // CSOK: VisibilityModifier /** * The "volume" property. */ - public int volume; + public int volume; // CSOK: VisibilityModifier /** * Create a CommonAbsolutePosition object. diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java index 7e68bbcea..b3ae7d8cd 100644 --- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java +++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java @@ -42,45 +42,46 @@ import org.apache.fop.fo.expr.PropertyException; * Stores all common border and padding properties. * See Sec. 7.7 of the XSL-FO Standard. */ -public class CommonBorderPaddingBackground { +public class CommonBorderPaddingBackground { // CSOK: FinalClassCheck /** * cache holding all canonical instances * (w/ absolute background-position-* and padding-*) */ - private static final PropertyCache cache = new PropertyCache(CommonBorderPaddingBackground.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(CommonBorderPaddingBackground.class); private int hash = -1; /** * The "background-attachment" property. */ - public final int backgroundAttachment; + public final int backgroundAttachment; // CSOK: VisibilityModifier /** * The "background-color" property. */ - public final Color backgroundColor; + public final Color backgroundColor; // CSOK: VisibilityModifier /** * The "background-image" property. */ - public final String backgroundImage; + public final String backgroundImage; // CSOK: VisibilityModifier /** * The "background-repeat" property. */ - public final int backgroundRepeat; + public final int backgroundRepeat; // CSOK: VisibilityModifier /** * The "background-position-horizontal" property. */ - public final Length backgroundPositionHorizontal; + public final Length backgroundPositionHorizontal; // CSOK: VisibilityModifier /** * The "background-position-vertical" property. */ - public final Length backgroundPositionVertical; + public final Length backgroundPositionVertical; // CSOK: VisibilityModifier private ImageInfo backgroundImageInfo; @@ -96,12 +97,13 @@ public class CommonBorderPaddingBackground { public static final int END = 3; /** - * + * Utility class to express border info. */ - public static class BorderInfo { + public static final class BorderInfo { /** cache holding all canonical instances */ - private static final PropertyCache cache = new PropertyCache(BorderInfo.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(BorderInfo.class); private int mStyle; // Enum for border style private Color mColor; // Border color @@ -212,7 +214,7 @@ public class CommonBorderPaddingBackground { * A border info with style "none". Used as a singleton, in the collapsing-border model, * for elements which don't specify any border on some of their sides. */ - private static final BorderInfo defaultBorderInfo + private static final BorderInfo defaultBorderInfo // CSOK: ConstantName = BorderInfo.getInstance(Constants.EN_NONE, new ConditionalNullLength(), null); /** @@ -352,12 +354,18 @@ public class CommonBorderPaddingBackground { CommonBorderPaddingBackground cachedInstance = null; /* if padding-* and background-position-* resolve to absolute lengths * the whole instance can be cached */ - if ((newInstance.padding[BEFORE] == null || newInstance.padding[BEFORE].getLength().isAbsolute()) - && (newInstance.padding[AFTER] == null || newInstance.padding[AFTER].getLength().isAbsolute()) - && (newInstance.padding[START] == null || newInstance.padding[START].getLength().isAbsolute()) - && (newInstance.padding[END] == null || newInstance.padding[END].getLength().isAbsolute()) - && (newInstance.backgroundPositionHorizontal == null || newInstance.backgroundPositionHorizontal.isAbsolute()) - && (newInstance.backgroundPositionVertical == null || newInstance.backgroundPositionVertical.isAbsolute())) { + if ((newInstance.padding[BEFORE] == null + || newInstance.padding[BEFORE].getLength().isAbsolute()) + && (newInstance.padding[AFTER] == null + || newInstance.padding[AFTER].getLength().isAbsolute()) + && (newInstance.padding[START] == null + || newInstance.padding[START].getLength().isAbsolute()) + && (newInstance.padding[END] == null + || newInstance.padding[END].getLength().isAbsolute()) + && (newInstance.backgroundPositionHorizontal == null + || newInstance.backgroundPositionHorizontal.isAbsolute()) + && (newInstance.backgroundPositionVertical == null + || newInstance.backgroundPositionVertical.isAbsolute())) { cachedInstance = cache.fetch(newInstance); } @@ -515,6 +523,7 @@ public class CommonBorderPaddingBackground { } /** + * @param side the side to retrieve * @param discard indicates whether the .conditionality component should be * considered (end of a reference-area) * @return the width of the start-border, taking into account the specified conditionality @@ -755,8 +764,12 @@ public class CommonBorderPaddingBackground { hash = 37 * hash + backgroundAttachment; hash = 37 * hash + (backgroundColor == null ? 0 : backgroundColor.hashCode()); hash = 37 * hash + (backgroundImage == null ? 0 : backgroundImage.hashCode()); - hash = 37 * hash + (backgroundPositionHorizontal == null ? 0 : backgroundPositionHorizontal.hashCode()); - hash = 37 * hash + (backgroundPositionVertical == null ? 0 : backgroundPositionVertical.hashCode()); + hash = 37 * hash + + (backgroundPositionHorizontal == null + ? 0 : backgroundPositionHorizontal.hashCode()); + hash = 37 * hash + + (backgroundPositionVertical == null + ? 0 : backgroundPositionVertical.hashCode()); hash = 37 * hash + backgroundRepeat; hash = 37 * hash + (borderInfo[BEFORE] == null ? 0 : borderInfo[BEFORE].hashCode()); hash = 37 * hash + (borderInfo[AFTER] == null ? 0 : borderInfo[AFTER].hashCode()); diff --git a/src/java/org/apache/fop/fo/properties/CommonFont.java b/src/java/org/apache/fop/fo/properties/CommonFont.java index 55a2393fa..f3f7d3f69 100644 --- a/src/java/org/apache/fop/fo/properties/CommonFont.java +++ b/src/java/org/apache/fop/fo/properties/CommonFont.java @@ -37,7 +37,8 @@ public final class CommonFont { /** cache holding canonical CommonFont instances (only those with * absolute font-size and font-size-adjust) */ - private static final PropertyCache cache = new PropertyCache(CommonFont.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(CommonFont.class); /** hashcode of this instance */ private int hash = 0; @@ -61,10 +62,10 @@ public final class CommonFont { private final EnumProperty fontWeight; /** The "font-size" property. */ - public final Length fontSize; + public final Length fontSize; // CSOK: VisibilityModifier /** The "font-size-adjust" property. */ - public final Numeric fontSizeAdjust; + public final Numeric fontSizeAdjust; // CSOK: VisibilityModifier /** @@ -79,7 +80,7 @@ public final class CommonFont { * @param fontSize the font-size (possibly non-cached) * @param fontSizeAdjust the font-size-adjust (possibly non-cached) */ - private CommonFont(FontFamilyProperty fontFamily, + private CommonFont(FontFamilyProperty fontFamily, // CSOK: ParameterNumber EnumProperty fontSelectionStrategy, EnumProperty fontStretch, EnumProperty fontStyle, @@ -110,7 +111,8 @@ public final class CommonFont { */ public static CommonFont getInstance(PropertyList pList) throws PropertyException { FontFamilyProperty fontFamily = (FontFamilyProperty) pList.get(Constants.PR_FONT_FAMILY); - EnumProperty fontSelectionStrategy = (EnumProperty) pList.get(Constants.PR_FONT_SELECTION_STRATEGY); + EnumProperty fontSelectionStrategy + = (EnumProperty) pList.get(Constants.PR_FONT_SELECTION_STRATEGY); EnumProperty fontStretch = (EnumProperty) pList.get(Constants.PR_FONT_STRETCH); EnumProperty fontStyle = (EnumProperty) pList.get(Constants.PR_FONT_STYLE); EnumProperty fontVariant = (EnumProperty) pList.get(Constants.PR_FONT_VARIANT); @@ -183,23 +185,22 @@ public final class CommonFont { /** * Create and return an array of <code>FontTriplets</code> based on * the properties stored in the instance variables. - * - * @param fontInfo - * @return a Font object. + * @param fontInfo a font info object + * @return a font triplet */ public FontTriplet[] getFontState(FontInfo fontInfo) { - int font_weight; + int fw; switch (fontWeight.getEnum()) { - case Constants.EN_100: font_weight = 100; break; - case Constants.EN_200: font_weight = 200; break; - case Constants.EN_300: font_weight = 300; break; - case Constants.EN_400: font_weight = 400; break; - case Constants.EN_500: font_weight = 500; break; - case Constants.EN_600: font_weight = 600; break; - case Constants.EN_700: font_weight = 700; break; - case Constants.EN_800: font_weight = 800; break; - case Constants.EN_900: font_weight = 900; break; - default: font_weight = 400; + case Constants.EN_100: fw = 100; break; + case Constants.EN_200: fw = 200; break; + case Constants.EN_300: fw = 300; break; + case Constants.EN_400: fw = 400; break; + case Constants.EN_500: fw = 500; break; + case Constants.EN_600: fw = 600; break; + case Constants.EN_700: fw = 700; break; + case Constants.EN_800: fw = 800; break; + case Constants.EN_900: fw = 900; break; + default: fw = 400; } String style; @@ -221,7 +222,7 @@ public final class CommonFont { //int fontVariant = propertyList.get("font-variant").getEnum(); FontTriplet[] triplets = fontInfo.fontLookup( getFontFamily(), - style, font_weight); + style, fw); return triplets; } @@ -259,7 +260,8 @@ public final class CommonFont { hash = 37 * hash + (fontSize == null ? 0 : fontSize.hashCode()); hash = 37 * hash + (fontSizeAdjust == null ? 0 : fontSizeAdjust.hashCode()); hash = 37 * hash + (fontFamily == null ? 0 : fontFamily.hashCode()); - hash = 37 * hash + (fontSelectionStrategy == null ? 0 : fontSelectionStrategy.hashCode()); + hash = 37 * hash + (fontSelectionStrategy == null + ? 0 : fontSelectionStrategy.hashCode()); hash = 37 * hash + (fontStretch == null ? 0 : fontStretch.hashCode()); hash = 37 * hash + (fontStyle == null ? 0 : fontStyle.hashCode()); hash = 37 * hash + (fontVariant == null ? 0 : fontVariant.hashCode()); diff --git a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java index 0e32f250a..c65b5b616 100644 --- a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java +++ b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java @@ -36,32 +36,34 @@ import org.apache.fop.fonts.Typeface; public final class CommonHyphenation { /** Logger */ - protected static Log log = LogFactory.getLog(CommonHyphenation.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(CommonHyphenation.class); - private static final PropertyCache cache = new PropertyCache(CommonHyphenation.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(CommonHyphenation.class); private int hash = 0; /** The "language" property */ - public final StringProperty language; + public final StringProperty language; // CSOK: VisibilityModifier /** The "country" property */ - public final StringProperty country; + public final StringProperty country; // CSOK: VisibilityModifier /** The "script" property */ - public final StringProperty script; + public final StringProperty script; // CSOK: VisibilityModifier /** The "hyphenate" property */ - public final EnumProperty hyphenate; + public final EnumProperty hyphenate; // CSOK: VisibilityModifier /** The "hyphenation-character" property */ - public final CharacterProperty hyphenationCharacter; + public final CharacterProperty hyphenationCharacter; // CSOK: VisibilityModifier /** The "hyphenation-push-character-count" property */ - public final NumberProperty hyphenationPushCharacterCount; + public final NumberProperty hyphenationPushCharacterCount; // CSOK: VisibilityModifier /** The "hyphenation-remain-character-count" property*/ - public final NumberProperty hyphenationRemainCharacterCount; + public final NumberProperty hyphenationRemainCharacterCount; // CSOK: VisibilityModifier /** * Construct a CommonHyphenation object holding the given properties @@ -87,24 +89,26 @@ public final class CommonHyphenation { * Gets the canonical <code>CommonHyphenation</code> instance corresponding * to the values of the related properties present on the given * <code>PropertyList</code> - * * @param propertyList the <code>PropertyList</code> + * @return a common hyphenation instance + * @throws PropertyException if a a property exception occurs */ - public static CommonHyphenation getInstance(PropertyList propertyList) throws PropertyException { - StringProperty language = - (StringProperty) propertyList.get(Constants.PR_LANGUAGE); - StringProperty country = - (StringProperty) propertyList.get(Constants.PR_COUNTRY); - StringProperty script = - (StringProperty) propertyList.get(Constants.PR_SCRIPT); - EnumProperty hyphenate = - (EnumProperty) propertyList.get(Constants.PR_HYPHENATE); - CharacterProperty hyphenationCharacter = - (CharacterProperty) propertyList.get(Constants.PR_HYPHENATION_CHARACTER); - NumberProperty hyphenationPushCharacterCount = - (NumberProperty) propertyList.get(Constants.PR_HYPHENATION_PUSH_CHARACTER_COUNT); - NumberProperty hyphenationRemainCharacterCount = - (NumberProperty) propertyList.get(Constants.PR_HYPHENATION_REMAIN_CHARACTER_COUNT); + public static CommonHyphenation getInstance(PropertyList propertyList) + throws PropertyException { + StringProperty language + = (StringProperty) propertyList.get(Constants.PR_LANGUAGE); + StringProperty country + = (StringProperty) propertyList.get(Constants.PR_COUNTRY); + StringProperty script + = (StringProperty) propertyList.get(Constants.PR_SCRIPT); + EnumProperty hyphenate + = (EnumProperty) propertyList.get(Constants.PR_HYPHENATE); + CharacterProperty hyphenationCharacter + = (CharacterProperty) propertyList.get(Constants.PR_HYPHENATION_CHARACTER); + NumberProperty hyphenationPushCharacterCount + = (NumberProperty) propertyList.get(Constants.PR_HYPHENATION_PUSH_CHARACTER_COUNT); + NumberProperty hyphenationRemainCharacterCount + = (NumberProperty) propertyList.get(Constants.PR_HYPHENATION_REMAIN_CHARACTER_COUNT); CommonHyphenation instance = new CommonHyphenation( language, @@ -209,12 +213,15 @@ public final class CommonHyphenation { hash = 37 * hash + (script == null ? 0 : script.hashCode()); hash = 37 * hash + (country == null ? 0 : country.hashCode()); hash = 37 * hash + (hyphenate == null ? 0 : hyphenate.hashCode()); - hash = 37 * hash + - (hyphenationCharacter == null ? 0 : hyphenationCharacter.hashCode()); - hash = 37 * hash + - (hyphenationPushCharacterCount == null ? 0 : hyphenationPushCharacterCount.hashCode()); - hash = 37 * hash + - (hyphenationRemainCharacterCount == null ? 0 : hyphenationRemainCharacterCount.hashCode()); + hash = 37 * hash + + (hyphenationCharacter == null + ? 0 : hyphenationCharacter.hashCode()); + hash = 37 * hash + + (hyphenationPushCharacterCount == null + ? 0 : hyphenationPushCharacterCount.hashCode()); + hash = 37 * hash + + (hyphenationRemainCharacterCount == null + ? 0 : hyphenationRemainCharacterCount.hashCode()); this.hash = hash; } return this.hash; diff --git a/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java b/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java index 8d63b3d22..a45c09672 100644 --- a/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java +++ b/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java @@ -33,46 +33,47 @@ public class CommonMarginBlock { /** * The "margin-top" property. */ - public Length marginTop; + public Length marginTop; // CSOK: VisibilityModifier /** * The "margin-bottom" property. */ - public Length marginBottom; + public Length marginBottom; // CSOK: VisibilityModifier /** * The "margin-left" property. */ - public Length marginLeft; + public Length marginLeft; // CSOK: VisibilityModifier /** * The "margin-right" property. */ - public Length marginRight; + public Length marginRight; // CSOK: VisibilityModifier /** * The "space-before" property. */ - public SpaceProperty spaceBefore; + public SpaceProperty spaceBefore; // CSOK: VisibilityModifier /** * The "space-after" property. */ - public SpaceProperty spaceAfter; + public SpaceProperty spaceAfter; // CSOK: VisibilityModifier /** * The "start-indent" property. */ - public Length startIndent; + public Length startIndent; // CSOK: VisibilityModifier /** * The "end-indent" property. */ - public Length endIndent; + public Length endIndent; // CSOK: VisibilityModifier /** * Create a CommonMarginBlock object. * @param pList The PropertyList with propery values. + * @throws PropertyException if a property exception occurs */ public CommonMarginBlock(PropertyList pList) throws PropertyException { marginTop = pList.get(Constants.PR_MARGIN_TOP).getLength(); diff --git a/src/java/org/apache/fop/fo/properties/CommonMarginInline.java b/src/java/org/apache/fop/fo/properties/CommonMarginInline.java index c578e58b8..3b1d886ea 100644 --- a/src/java/org/apache/fop/fo/properties/CommonMarginInline.java +++ b/src/java/org/apache/fop/fo/properties/CommonMarginInline.java @@ -34,36 +34,37 @@ public class CommonMarginInline { /** * The "margin-top" property. */ - public Length marginTop; + public Length marginTop; // CSOK: VisibilityModifier /** * The "margin-bottom" property. */ - public Length marginBottom; + public Length marginBottom; // CSOK: VisibilityModifier /** * The "margin-left" property. */ - public Length marginLeft; + public Length marginLeft; // CSOK: VisibilityModifier /** * The "margin-right" property. */ - public Length marginRight; + public Length marginRight; // CSOK: VisibilityModifier /** * The "space-start" property. */ - public SpaceProperty spaceStart; + public SpaceProperty spaceStart; // CSOK: VisibilityModifier /** * The "space-end" property. */ - public SpaceProperty spaceEnd; + public SpaceProperty spaceEnd; // CSOK: VisibilityModifier /** * Create a CommonMarginInline object. * @param pList The PropertyList with propery values. + * @throws PropertyException if a property exception occurs */ public CommonMarginInline(PropertyList pList) throws PropertyException { marginTop = pList.get(Constants.PR_MARGIN_TOP).getLength(); diff --git a/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java b/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java index f28a3edb3..32d21133b 100644 --- a/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java +++ b/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java @@ -33,31 +33,32 @@ public class CommonRelativePosition { /** * The "relative-position" property. */ - public int relativePosition; + public int relativePosition; // CSOK: VisibilityModifier /** * The "top" property. */ - public Length top; + public Length top; // CSOK: VisibilityModifier /** * The "right" property. */ - public Length right; + public Length right; // CSOK: VisibilityModifier /** * The "bottom" property. */ - public Length bottom; + public Length bottom; // CSOK: VisibilityModifier /** * The "left" property. */ - public Length left; + public Length left; // CSOK: VisibilityModifier /** * Create a CommonRelativePosition object. * @param pList The PropertyList with propery values. + * @throws PropertyException if a property exception occurs */ public CommonRelativePosition(PropertyList pList) throws PropertyException { relativePosition = pList.get(Constants.PR_RELATIVE_POSITION).getEnum(); diff --git a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java index f7381dba7..3edb84009 100644 --- a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java @@ -32,8 +32,8 @@ public class CompoundPropertyMaker extends PropertyMaker { /** * The list of subproperty makers supported by this compound maker. */ - private PropertyMaker[] subproperties = - new PropertyMaker[Constants.COMPOUND_COUNT]; + private PropertyMaker[] subproperties + = new PropertyMaker[Constants.COMPOUND_COUNT]; /** * The first subproperty maker which has a setByShorthand of true. @@ -66,7 +66,7 @@ public class CompoundPropertyMaker extends PropertyMaker { /** * Add a subproperty to this maker. - * @param subproperty + * @param subproperty the sub property */ public void addSubpropMaker(PropertyMaker subproperty) { // Place the base propId in the propId of the subproperty. @@ -105,8 +105,7 @@ public class CompoundPropertyMaker extends PropertyMaker { * @return the array index. */ private int getSubpropIndex(int subpropertyId) { - return ((subpropertyId & Constants.COMPOUND_MASK) >> - Constants.COMPOUND_SHIFT)-1; + return ((subpropertyId & Constants.COMPOUND_MASK) >> Constants.COMPOUND_SHIFT) - 1; } /** @@ -137,11 +136,12 @@ public class CompoundPropertyMaker extends PropertyMaker { * @param propertyList The PropertyList object being built for this FO. * @param tryInherit true if inherited properties should be examined. * @param tryDefault true if the default value should be returned. + * @return the property + * @throws PropertyException if a property exception occurs */ public Property get(int subpropertyId, PropertyList propertyList, boolean tryInherit, boolean tryDefault) - throws PropertyException - { + throws PropertyException { Property p = super.get(subpropertyId, propertyList, tryInherit, tryDefault); if (subpropertyId != 0 && p != null) { p = getSubprop(p, subpropertyId); @@ -261,7 +261,8 @@ public class CompoundPropertyMaker extends PropertyMaker { PropertyMaker subpropertyMaker = subproperties[i]; if (subpropertyMaker != null) { Property subproperty = subpropertyMaker.make(propertyList); - data.setComponent(subpropertyMaker.getPropId() & Constants.COMPOUND_MASK, subproperty, true); + data.setComponent(subpropertyMaker.getPropId() + & Constants.COMPOUND_MASK, subproperty, true); } } return p; diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java index aa913d969..dc7d80c39 100644 --- a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java +++ b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java @@ -33,7 +33,8 @@ import org.apache.fop.fo.expr.PropertyException; public class CondLengthProperty extends Property implements CompoundDatatype { /** cache holding canonical instances (for absolute conditional lengths) */ - private static final PropertyCache cache = new PropertyCache(CondLengthProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(CondLengthProperty.class); /** components */ private Property length; diff --git a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java index 60237c53a..18c6f09a6 100644 --- a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java @@ -27,23 +27,38 @@ import org.apache.fop.fo.expr.PropertyException; /** */ public class CorrespondingPropertyMaker { + /** base property maker */ protected PropertyMaker baseMaker; - protected int lr_tb; - protected int rl_tb; - protected int tb_rl; + /** corresponding property for lr-tb writing mode */ + protected int lrtb; + /** corresponding property for rl-tb writing mode */ + protected int rltb; + /** corresponding property for tb-rl writing mode */ + protected int tbrl; + /** user parent property list */ protected boolean useParent; private boolean relative; + /** + * Construct a corresponding property maker. + * @param baseMaker the base property maker + */ public CorrespondingPropertyMaker(PropertyMaker baseMaker) { this.baseMaker = baseMaker; baseMaker.setCorresponding(this); } - public void setCorresponding(int lr_tb, int rl_tb, int tb_rl) { - this.lr_tb = lr_tb; - this.rl_tb = rl_tb; - this.tb_rl = tb_rl; + /** + * Set corresponding property identifiers. + * @param lrtb the property that corresponds with lr-tb writing mode + * @param rltb the property that corresponds with rl-tb writing mode + * @param tbrl the property that corresponds with tb-lr writing mode + */ + public void setCorresponding(int lrtb, int rltb, int tbrl) { + this.lrtb = lrtb; + this.rltb = rltb; + this.tbrl = tbrl; } /** @@ -55,6 +70,10 @@ public class CorrespondingPropertyMaker { this.useParent = useParent; } + /** + * Set relative flag. + * @param relative true if relative direction + */ public void setRelative(boolean relative) { this.relative = relative; } @@ -83,7 +102,7 @@ public class CorrespondingPropertyMaker { PropertyList pList = getWMPropertyList(propertyList); if (pList != null) { - int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl); + int correspondingId = pList.getWritingMode(lrtb, rltb, tbrl); if (pList.getExplicit(correspondingId) != null) { return true; @@ -100,14 +119,14 @@ public class CorrespondingPropertyMaker { * @param propertyList The PropertyList for the FO. * @return Property A computed Property value or null if no rules * are specified (in foproperties.xml) to compute the value. - * @throws FOPException for invalid or inconsistent FO input + * @throws PropertyException if a property exception occurs */ public Property compute(PropertyList propertyList) throws PropertyException { PropertyList pList = getWMPropertyList(propertyList); if (pList == null) { return null; } - int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl); + int correspondingId = pList.getWritingMode(lrtb, rltb, tbrl); Property p = propertyList.getExplicitOrShorthand(correspondingId); if (p != null) { @@ -120,6 +139,8 @@ public class CorrespondingPropertyMaker { /** * Return the property list to use for fetching writing mode depending property * ids. + * @param pList a property list + * @return the property list to use */ protected PropertyList getWMPropertyList(PropertyList pList) { if (useParent) { diff --git a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java index 29715fe66..df8583089 100644 --- a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java @@ -30,27 +30,44 @@ import org.apache.fop.fo.expr.PropertyException; * Window - Preferences - Java - Code Generation - Code and Comments */ public class DimensionPropertyMaker extends CorrespondingPropertyMaker { - int[][] extraCorresponding = null; + + private int[][] extraCorresponding = null; + /** + * Construct a dimension property maker. + * @param baseMaker the base property maker + */ public DimensionPropertyMaker(PropertyMaker baseMaker) { super(baseMaker); } + /** + * Set extra correspondences. + * @param extraCorresponding the extra correspondences + */ public void setExtraCorresponding(int[][] extraCorresponding) { this.extraCorresponding = extraCorresponding; } + /** + * Determine if corresponding property is forced. + * @param propertyList the property list to use + * @return true if it is forced + */ public boolean isCorrespondingForced(PropertyList propertyList) { - if (super.isCorrespondingForced(propertyList)) + if (super.isCorrespondingForced(propertyList)) { return true; + } for (int i = 0; i < extraCorresponding.length; i++) { int wmcorr = extraCorresponding[i][0]; //propertyList.getWritingMode()]; - if (propertyList.getExplicit(wmcorr) != null) + if (propertyList.getExplicit(wmcorr) != null) { return true; + } } return false; } + /** {@inheritDoc} */ public Property compute(PropertyList propertyList) throws PropertyException { // Based on [width|height] Property p = super.compute(propertyList); diff --git a/src/java/org/apache/fop/fo/properties/EnumLength.java b/src/java/org/apache/fop/fo/properties/EnumLength.java index 76fd0e5b7..d2480beb2 100644 --- a/src/java/org/apache/fop/fo/properties/EnumLength.java +++ b/src/java/org/apache/fop/fo/properties/EnumLength.java @@ -27,6 +27,10 @@ import org.apache.fop.datatypes.PercentBaseContext; public class EnumLength extends LengthProperty { private Property enumProperty; + /** + * Construct an enumerated length from an enum property. + * @param enumProperty the enumeration property + */ public EnumLength(Property enumProperty) { this.enumProperty = enumProperty; } @@ -38,6 +42,7 @@ public class EnumLength extends LengthProperty { return enumProperty.getEnum(); } + /** @return true if absolute */ public boolean isAbsolute() { return false; } diff --git a/src/java/org/apache/fop/fo/properties/EnumNumber.java b/src/java/org/apache/fop/fo/properties/EnumNumber.java index fdc359a06..6a2879479 100644 --- a/src/java/org/apache/fop/fo/properties/EnumNumber.java +++ b/src/java/org/apache/fop/fo/properties/EnumNumber.java @@ -29,7 +29,8 @@ import org.apache.fop.fo.expr.PropertyException; public final class EnumNumber extends Property implements Numeric { /** cache holding all canonical EnumNumber instances */ - private static final PropertyCache cache = new PropertyCache(EnumNumber.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(EnumNumber.class); private final EnumProperty enumProperty; diff --git a/src/java/org/apache/fop/fo/properties/EnumProperty.java b/src/java/org/apache/fop/fo/properties/EnumProperty.java index 07cfaadcc..db26cfdc6 100644 --- a/src/java/org/apache/fop/fo/properties/EnumProperty.java +++ b/src/java/org/apache/fop/fo/properties/EnumProperty.java @@ -29,7 +29,8 @@ import org.apache.fop.fo.expr.PropertyException; public final class EnumProperty extends Property { /** cache holding all canonical EnumProperty instances */ - private static final PropertyCache cache = new PropertyCache(EnumProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(EnumProperty.class); /** * Inner class for creating EnumProperty instances @@ -54,6 +55,14 @@ public final class EnumProperty extends Property { return super.checkEnumValues(value); } + /** + * Convert a property. + * @param p the property to convert + * @param propertyList the property list to use in conversion + * @param fo the FO to use in conversion + * @return the converted property + * @throws PropertyException if a property conversion exception occurs + */ public Property convertProperty(Property p, PropertyList propertyList, FObj fo) throws PropertyException { @@ -77,6 +86,12 @@ public final class EnumProperty extends Property { this.text = text; } + /** + * Construct an enumeration property. + * @param explicitValue the value + * @param text the text + * @return an enumeration property + */ public static EnumProperty getInstance(int explicitValue, String text) { return (EnumProperty) cache.fetch( new EnumProperty(explicitValue, text)); diff --git a/src/java/org/apache/fop/fo/properties/FixedLength.java b/src/java/org/apache/fop/fo/properties/FixedLength.java index 84d159edf..cc4d04c69 100644 --- a/src/java/org/apache/fop/fo/properties/FixedLength.java +++ b/src/java/org/apache/fop/fo/properties/FixedLength.java @@ -45,7 +45,8 @@ public final class FixedLength extends LengthProperty { public static final String MPT = "mpt"; /** cache holding all canonical FixedLength instances */ - private static final PropertyCache cache = new PropertyCache(FixedLength.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(FixedLength.class); /** canonical zero-length instance */ public static final FixedLength ZERO_FIXED_LENGTH = new FixedLength(0, FixedLength.MPT, 1.0f); diff --git a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java index 34a6b58d8..5b05aa959 100644 --- a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java +++ b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java @@ -31,7 +31,8 @@ import org.apache.fop.fo.expr.PropertyException; public final class FontFamilyProperty extends ListProperty { /** cache holding all canonical FontFamilyProperty instances */ - private static final PropertyCache cache = new PropertyCache(FontFamilyProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(FontFamilyProperty.class); private int hash = 0; @@ -50,7 +51,8 @@ public final class FontFamilyProperty extends ListProperty { /** * {@inheritDoc} */ - public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException { + public Property make(PropertyList propertyList, String value, FObj fo) + throws PropertyException { if ("inherit".equals(value)) { return super.make(propertyList, value, fo); } else { diff --git a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java index 5096d6160..60ef955ba 100644 --- a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java @@ -50,7 +50,8 @@ public class FontSizePropertyMaker * here already: if the property evaluates to a {@link PercentLength}, * it is immediately replaced by the resolved {@link FixedLength}. */ - public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException { + public Property make(PropertyList propertyList, String value, FObj fo) + throws PropertyException { Property p = super.make(propertyList, value, fo); if (p instanceof PercentLength) { Property pp = propertyList.getFromParent(this.propId); diff --git a/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java index 278fec862..6397813e6 100644 --- a/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java @@ -13,7 +13,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + */ + /* $Id$ */ package org.apache.fop.fo.properties; @@ -25,6 +26,9 @@ import org.apache.fop.fo.expr.PropertyException; import org.apache.fop.fo.expr.PropertyInfo; import org.apache.fop.fo.expr.PropertyParser; +/** + * Font weight property maker. + */ public class FontWeightPropertyMaker extends EnumProperty.Maker { /** @@ -45,10 +49,8 @@ public class FontWeightPropertyMaker extends EnumProperty.Maker { } else { String pValue = checkValueKeywords(value); Property newProp = checkEnumValues(pValue); - int enumValue = -1; - if (newProp != null - && ((enumValue = newProp.getEnum()) == Constants.EN_BOLDER - || enumValue == Constants.EN_LIGHTER)) { + int enumValue = ( newProp != null ) ? newProp.getEnum() : -1; + if (enumValue == Constants.EN_BOLDER || enumValue == Constants.EN_LIGHTER) { /* check for relative enum values, compute in relation to parent */ Property parentProp = pList.getInherited(Constants.PR_FONT_WEIGHT); if (enumValue == Constants.EN_BOLDER) { diff --git a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java index d976fc6ea..19c4675ed 100644 --- a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java @@ -68,6 +68,9 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker { /** * Calculate the corresponding value for start-indent and end-indent. + * @param propertyList the property list to use in the computation + * @return the computed indent property + * @throws PropertyException if a property exception occurs * @see CorrespondingPropertyMaker#compute(PropertyList) */ public Property compute(PropertyList propertyList) throws PropertyException { @@ -81,6 +84,9 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker { /** * Calculate the corresponding value for start-indent and end-indent. + * @param propertyList the property list to use in the computation + * @return the computed indent property + * @throws PropertyException if a property exception occurs * @see CorrespondingPropertyMaker#compute(PropertyList) */ public Property computeConforming(PropertyList propertyList) throws PropertyException { @@ -93,7 +99,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker { Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric(); Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric(); - int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl); + int marginProp = pList.getWritingMode(lrtb, rltb, tbrl); // Calculate the absolute margin. if (propertyList.getExplicitOrShorthand(marginProp) == null) { Property indent = propertyList.getExplicit(baseMaker.propId); @@ -136,6 +142,9 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker { * This method calculates indent following an alternative rule set that * tries to mimic many commercial solutions that chose to violate the * XSL specification. + * @param propertyList the property list to use in the computation + * @return the computed indent property + * @throws PropertyException if a property exception occurs * @see CorrespondingPropertyMaker#compute(PropertyList) */ public Property computeAlternativeRuleset(PropertyList propertyList) throws PropertyException { @@ -149,7 +158,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker { Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric(); Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric(); - int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl); + int marginProp = pList.getWritingMode(lrtb, rltb, tbrl); //Determine whether the nearest anscestor indent was specified through //start-indent|end-indent or through a margin property. diff --git a/src/java/org/apache/fop/fo/properties/KeepProperty.java b/src/java/org/apache/fop/fo/properties/KeepProperty.java index d2e2c70a7..7c5b6124f 100644 --- a/src/java/org/apache/fop/fo/properties/KeepProperty.java +++ b/src/java/org/apache/fop/fo/properties/KeepProperty.java @@ -30,7 +30,8 @@ import org.apache.fop.fo.expr.PropertyException; public final class KeepProperty extends Property implements CompoundDatatype { /** class holding all canonical KeepProperty instances*/ - private static final PropertyCache cache = new PropertyCache(KeepProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(KeepProperty.class); private boolean isCachedValue = false; private Property withinLine; @@ -61,8 +62,7 @@ public final class KeepProperty extends Property implements CompoundDatatype { * {@inheritDoc} */ public Property convertProperty(Property p, PropertyList propertyList, FObj fo) - throws PropertyException - { + throws PropertyException { if (p instanceof KeepProperty) { return p; } @@ -154,10 +154,10 @@ public final class KeepProperty extends Property implements CompoundDatatype { * @return String representation */ public String toString() { - return "Keep[" + - "withinLine:" + getWithinLine().getObject() + - ", withinColumn:" + getWithinColumn().getObject() + - ", withinPage:" + getWithinPage().getObject() + "]"; + return "Keep[" + + "withinLine:" + getWithinLine().getObject() + + ", withinColumn:" + getWithinColumn().getObject() + + ", withinPage:" + getWithinPage().getObject() + "]"; } /** diff --git a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java index 4b408e83b..1d79bb7af 100644 --- a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java @@ -64,6 +64,7 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker { /** * Recalculate the line-height value based on the nearest specified * value. + * {@inheritDoc} */ protected Property compute(PropertyList propertyList) throws PropertyException { // recalculate based on last specified value diff --git a/src/java/org/apache/fop/fo/properties/NumberProperty.java b/src/java/org/apache/fop/fo/properties/NumberProperty.java index 4d7c3b97b..d54161b8d 100644 --- a/src/java/org/apache/fop/fo/properties/NumberProperty.java +++ b/src/java/org/apache/fop/fo/properties/NumberProperty.java @@ -68,6 +68,9 @@ public final class NumberProperty extends Property implements Numeric { } + /** + * A positive integer property maker. + */ public static class PositiveIntegerMaker extends PropertyMaker { /** @@ -103,7 +106,8 @@ public final class NumberProperty extends Property implements Numeric { } /** cache holding all canonical NumberProperty instances */ - private static final PropertyCache cache = new PropertyCache(NumberProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(NumberProperty.class); private final Number number; diff --git a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java index 53a9c1286..919dd84d0 100644 --- a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java +++ b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java @@ -43,7 +43,13 @@ public class PageDimensionMaker extends LengthProperty.Maker { * Check the value of the page-width / page-height property. * Return the default or user-defined fallback in case the value * was specified as "auto" - * + * @param subpropId The subproperty id of the property being retrieved. + * Is 0 when retriving a base property. + * @param propertyList The PropertyList object being built for this FO. + * @param tryInherit true if inherited properties should be examined. + * @param tryDefault true if the default value should be returned. + * @return the property + * @throws PropertyException if a property exception occurs * @see PropertyMaker#get(int, PropertyList, boolean, boolean) */ public Property get(int subpropId, PropertyList propertyList, diff --git a/src/java/org/apache/fop/fo/properties/PercentLength.java b/src/java/org/apache/fop/fo/properties/PercentLength.java index f89007f34..66f1f175c 100644 --- a/src/java/org/apache/fop/fo/properties/PercentLength.java +++ b/src/java/org/apache/fop/fo/properties/PercentLength.java @@ -118,8 +118,7 @@ public class PercentLength extends LengthProperty { * @return the String equivalent of this */ public String toString() { - StringBuffer sb = - new StringBuffer(PercentLength.class.getName()) + StringBuffer sb = new StringBuffer(PercentLength.class.getName()) .append("[factor=").append(factor) .append(",lbase=").append(lbase).append("]"); return sb.toString(); diff --git a/src/java/org/apache/fop/fo/properties/PropertyCache.java b/src/java/org/apache/fop/fo/properties/PropertyCache.java index dc9abb023..920125796 100644 --- a/src/java/org/apache/fop/fo/properties/PropertyCache.java +++ b/src/java/org/apache/fop/fo/properties/PropertyCache.java @@ -98,8 +98,13 @@ public final class PropertyCache { } /* Wrapper objects to synchronize on */ - private static class CacheSegment { + private static final class CacheSegment { + CacheSegment() { + } private int count = 0; + int getCount() { + return count; + } } private void cleanSegment(int segmentIndex) { @@ -209,10 +214,11 @@ public final class PropertyCache { /* try non-synched first */ for (CacheEntry e = entry; e != null; e = e.nextEntry) { - if (e.hash == hash - && (q = e.get()) != null - && eq(q, o)) { - return q; + if ( e.hash == hash ) { + q = e.get(); + if ( ( q != null ) && eq ( q, o ) ) { + return q; + } } } @@ -223,10 +229,11 @@ public final class PropertyCache { synchronized (segment) { entry = table[index]; for (CacheEntry e = entry; e != null; e = e.nextEntry) { - if (e.hash == hash - && (q = e.get()) != null - && eq(q, o)) { - return q; + if ( e.hash == hash ) { + q = e.get(); + if ( ( q != null ) && eq ( q, o ) ) { + return q; + } } } } @@ -261,7 +268,8 @@ public final class PropertyCache { newLength--; for (int i = table.length; --i >= 0;) { for (CacheEntry c = table[i]; c != null; c = c.nextEntry) { - if ((o = c.get()) != null) { + o = c.get(); + if (o != null) { hash = c.hash; idx = hash & newLength; newTable[idx] = new CacheEntry(o, newTable[idx]); @@ -384,7 +392,7 @@ public final class PropertyCache { } /** - * Checks if the given {@link Marker.MarkerAttribute} is present + * Checks if the given {@link org.apache.fop.fo.flow.Marker.MarkerAttribute} is present * in the cache - if so, returns a reference to the cached instance. * Otherwise the given object is added to the cache and returned. * diff --git a/src/java/org/apache/fop/fo/properties/ShorthandParser.java b/src/java/org/apache/fop/fo/properties/ShorthandParser.java index f0ec0e6e9..f03c377fd 100644 --- a/src/java/org/apache/fop/fo/properties/ShorthandParser.java +++ b/src/java/org/apache/fop/fo/properties/ShorthandParser.java @@ -30,9 +30,11 @@ public interface ShorthandParser { /** * @param propId the property ID in the Constants interface + * @param property from which value is obtained * @param maker Maker object for the Property * @param propertyList list of properties * @return Property object corresponding to propName + * @throws PropertyException in case a property exception occurs */ Property getValueForProperty(int propId, Property property, diff --git a/src/java/org/apache/fop/fo/properties/SpaceProperty.java b/src/java/org/apache/fop/fo/properties/SpaceProperty.java index 49f76f874..641ec3baf 100644 --- a/src/java/org/apache/fop/fo/properties/SpaceProperty.java +++ b/src/java/org/apache/fop/fo/properties/SpaceProperty.java @@ -136,13 +136,14 @@ public class SpaceProperty extends LengthRangeProperty { return this.conditionality.getEnum() == Constants.EN_DISCARD; } + /** {@inheritDoc} */ public String toString() { - return "Space[" + - "min:" + getMinimum(null).getObject() + - ", max:" + getMaximum(null).getObject() + - ", opt:" + getOptimum(null).getObject() + - ", precedence:" + precedence.getObject() + - ", conditionality:" + conditionality.getObject() + "]"; + return "Space[" + + "min:" + getMinimum(null).getObject() + + ", max:" + getMaximum(null).getObject() + + ", opt:" + getOptimum(null).getObject() + + ", precedence:" + precedence.getObject() + + ", conditionality:" + conditionality.getObject() + "]"; } /** diff --git a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java index 19fa7baa7..3c51dd44a 100644 --- a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java @@ -41,6 +41,11 @@ public class SpacingPropertyMaker extends SpaceProperty.Maker { /** * Support for the 'normal' value. + * @param p the property to convert + * @param propertyList the property list to use in conversion + * @param fo the FO to use in conversion + * @return the converted property + * @throws PropertyException if a property conversion exception occurs */ public Property convertProperty(Property p, PropertyList propertyList, diff --git a/src/java/org/apache/fop/fo/properties/StringProperty.java b/src/java/org/apache/fop/fo/properties/StringProperty.java index ec7e1f841..ab4544c0a 100644 --- a/src/java/org/apache/fop/fo/properties/StringProperty.java +++ b/src/java/org/apache/fop/fo/properties/StringProperty.java @@ -83,7 +83,8 @@ public final class StringProperty extends Property { } /** cache containing all canonical StringProperty instances */ - private static final PropertyCache cache = new PropertyCache(StringProperty.class); + private static final PropertyCache cache // CSOK: ConstantName + = new PropertyCache(StringProperty.class); /** canonical instance for empty strings */ public static final StringProperty EMPTY_STRING_PROPERTY = new StringProperty(""); diff --git a/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java b/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java index 4a2fc92f4..b01ee22a0 100644 --- a/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java +++ b/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java @@ -24,7 +24,11 @@ import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.expr.PropertyException; -public class TableBorderPrecedence extends NumberProperty.Maker{ +/** + * A table border preference property maker. + */ +public class TableBorderPrecedence extends NumberProperty.Maker { + private static Property num0 = NumberProperty.getInstance(0); private static Property num1 = NumberProperty.getInstance(1); private static Property num2 = NumberProperty.getInstance(2); @@ -33,6 +37,10 @@ public class TableBorderPrecedence extends NumberProperty.Maker{ private static Property num5 = NumberProperty.getInstance(5); private static Property num6 = NumberProperty.getInstance(6); + /** + * Construct a table border preference property maker. + * @param propId the border's property id + */ public TableBorderPrecedence(int propId) { super(propId); } @@ -59,7 +67,8 @@ public class TableBorderPrecedence extends NumberProperty.Maker{ return num1; case Constants.FO_TABLE_FOOTER: return num0; + default: + return null; } - return null; } } diff --git a/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java b/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java index 3cbe56f00..bcd41fb20 100644 --- a/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java +++ b/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java @@ -14,6 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +/* $Id$ */ + package org.apache.fop.fo.properties; import java.util.Iterator; @@ -72,11 +75,11 @@ public class TextDecorationProperty extends ListProperty { if (prop instanceof EnumProperty) { //skip } else if (prop instanceof NCnameProperty) { - Property prop_enum = checkEnumValues(((NCnameProperty)prop).getString()); - if (prop_enum == null) { + Property propEnum = checkEnumValues(((NCnameProperty)prop).getString()); + if (propEnum == null) { throw new PropertyException("Illegal enum value: " + prop.getString()); } - l.set(i, prop_enum); + l.set(i, propEnum); } else { throw new PropertyException("Invalid content for text-decoration " + "property: " + prop); @@ -113,7 +116,8 @@ public class TextDecorationProperty extends ListProperty { case Constants.EN_UNDERLINE: case Constants.EN_NO_UNDERLINE: if (none) { - throw new PropertyException("'none' specified, no additional values allowed"); + throw new PropertyException + ("'none' specified, no additional values allowed"); } if (under) { throw new PropertyException("Invalid combination of values"); @@ -123,7 +127,8 @@ public class TextDecorationProperty extends ListProperty { case Constants.EN_OVERLINE: case Constants.EN_NO_OVERLINE: if (none) { - throw new PropertyException("'none' specified, no additional values allowed"); + throw new PropertyException + ("'none' specified, no additional values allowed"); } if (over) { throw new PropertyException("Invalid combination of values"); @@ -133,7 +138,8 @@ public class TextDecorationProperty extends ListProperty { case Constants.EN_LINE_THROUGH: case Constants.EN_NO_LINE_THROUGH: if (none) { - throw new PropertyException("'none' specified, no additional values allowed"); + throw new PropertyException + ("'none' specified, no additional values allowed"); } if (through) { throw new PropertyException("Invalid combination of values"); @@ -143,7 +149,8 @@ public class TextDecorationProperty extends ListProperty { case Constants.EN_BLINK: case Constants.EN_NO_BLINK: if (none) { - throw new PropertyException("'none' specified, no additional values allowed"); + throw new PropertyException + ("'none' specified, no additional values allowed"); } if (blink) { throw new PropertyException("Invalid combination of values"); diff --git a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java index c04b1a892..387355623 100644 --- a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java +++ b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java @@ -22,22 +22,33 @@ package org.apache.fop.fo.properties; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; +/** + * A special property for representing an as yet implemented implemented property. + */ public class ToBeImplementedProperty extends Property { + /** + * A to be implemented property maker instance. + */ public static class Maker extends PropertyMaker { + /** + * Instantiate a to be implemented property maker instance. + * @param propId a property id + */ public Maker(int propId) { super(propId); } + /** {@inheritDoc} */ public Property convertProperty(Property p, PropertyList propertyList, FObj fo) { if (p instanceof ToBeImplementedProperty) { return p; } - ToBeImplementedProperty val = - new ToBeImplementedProperty(getPropId()); + ToBeImplementedProperty val + = new ToBeImplementedProperty(getPropId()); return val; } } diff --git a/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java b/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java index c0950a794..8c0cec744 100644 --- a/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java +++ b/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java @@ -18,6 +18,7 @@ /* $Id$ */ package org.apache.fop.fo.properties; + import org.apache.fop.fo.Constants; import org.apache.fop.fo.PropertyList; @@ -47,6 +48,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } case EN_TOP: switch (propId) { @@ -58,6 +61,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } case EN_TEXT_TOP: switch (propId) { @@ -69,6 +74,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } case EN_MIDDLE: switch (propId) { @@ -80,6 +87,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } case EN_BOTTOM: switch (propId) { @@ -91,6 +100,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } case EN_TEXT_BOTTOM: switch (propId) { @@ -102,6 +113,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } case EN_SUB: switch (propId) { @@ -113,6 +126,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_SUB, "SUB")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } case EN_SUPER: switch (propId) { @@ -124,6 +139,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_SUPER, "SUPER")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } default: switch (propId) { @@ -135,6 +152,8 @@ public class VerticalAlignShorthandParser implements ShorthandParser, Constants return new EnumLength(EnumProperty.getInstance(EN_BASELINE, "BASELINE")); case PR_DOMINANT_BASELINE: return EnumProperty.getInstance(EN_AUTO, "AUTO"); + default: + break; } } return null; diff --git a/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java b/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java index efadd8957..d8b8dac27 100644 --- a/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java +++ b/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java @@ -13,7 +13,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + */ + /* $Id$ */ package org.apache.fop.fo.properties; @@ -22,6 +23,9 @@ import org.apache.fop.fo.Constants; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.expr.PropertyException; +/** + * A parser for the xml:lang property. + */ public class XMLLangShorthandParser extends GenericShorthandParser { private static final char HYPHEN_MINUS = '-'; diff --git a/src/java/org/apache/fop/fonts/CIDFontType.java b/src/java/org/apache/fop/fonts/CIDFontType.java index 24132ffc2..ce01fa629 100644 --- a/src/java/org/apache/fop/fonts/CIDFontType.java +++ b/src/java/org/apache/fop/fonts/CIDFontType.java @@ -38,6 +38,9 @@ public class CIDFontType extends ValuedEnum { /** + * Construct a CID font type. + * @param name a type name + * @param value a type value * @see org.apache.avalon.framework.Enum#Enum(String) */ protected CIDFontType(String name, int value) { diff --git a/src/java/org/apache/fop/fonts/CIDSubset.java b/src/java/org/apache/fop/fonts/CIDSubset.java index 6be4007ea..778521517 100644 --- a/src/java/org/apache/fop/fonts/CIDSubset.java +++ b/src/java/org/apache/fop/fonts/CIDSubset.java @@ -55,6 +55,9 @@ public class CIDSubset { */ private Map/*<Integer, Character>*/ usedCharsIndex = new java.util.HashMap(); + /** + * Default constructor. + */ public CIDSubset() { } diff --git a/src/java/org/apache/fop/fonts/FontSetup.java b/src/java/org/apache/fop/fonts/FontSetup.java index f7ad6fc65..7ceef5a9c 100644 --- a/src/java/org/apache/fop/fonts/FontSetup.java +++ b/src/java/org/apache/fop/fonts/FontSetup.java @@ -51,12 +51,16 @@ import org.apache.fop.fonts.base14.ZapfDingbats; * Assigns the font (with metrics) to internal names like "F1" and * assigns family-style-weight triplets to the fonts */ -public class FontSetup { +public final class FontSetup { + + private FontSetup() { + } /** * logging instance */ - protected static Log log = LogFactory.getLog(FontSetup.class); + private static Log log // CSOK: ConstantName + = LogFactory.getLog(FontSetup.class); /** * Sets up a font info diff --git a/src/java/org/apache/fop/fonts/FontType.java b/src/java/org/apache/fop/fonts/FontType.java index 95b594ca4..56039b519 100644 --- a/src/java/org/apache/fop/fonts/FontType.java +++ b/src/java/org/apache/fop/fonts/FontType.java @@ -54,6 +54,9 @@ public class FontType { /** + * Construct a font type. + * @param name a font type name + * @param value a font type value * @see org.apache.avalon.framework.Enum#Enum(String) */ protected FontType(String name, int value) { diff --git a/src/java/org/apache/fop/fonts/FontUtil.java b/src/java/org/apache/fop/fonts/FontUtil.java index 49f23c12f..b97e3a407 100644 --- a/src/java/org/apache/fop/fonts/FontUtil.java +++ b/src/java/org/apache/fop/fonts/FontUtil.java @@ -23,7 +23,10 @@ package org.apache.fop.fonts; /** * Font utilities. */ -public class FontUtil { +public final class FontUtil { + + private FontUtil() { + } /** * Parses an CSS2 (SVG and XSL-FO) font weight (normal, bold, 100-900) to diff --git a/src/java/org/apache/fop/fonts/Glyphs.java b/src/java/org/apache/fop/fonts/Glyphs.java index 4da95d575..dfc44675b 100644 --- a/src/java/org/apache/fop/fonts/Glyphs.java +++ b/src/java/org/apache/fop/fonts/Glyphs.java @@ -23,7 +23,10 @@ package org.apache.fop.fonts; * This class provides a number of constants for glyph management. * @deprecated Use the Glyphs class from XML Graphics Commons instead! */ -public class Glyphs { +public final class Glyphs { + + private Glyphs() { + } /** * Glyph name for the "notdef" glyph @@ -33,7 +36,7 @@ public class Glyphs { /** * Glyph names for Mac encoding */ - public static final String MAC_GLYPH_NAMES[] = { + public static final String[] MAC_GLYPH_NAMES = { /* 0x00 */ NOTDEF, ".null", "CR", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", @@ -1273,7 +1276,7 @@ public class Glyphs { * @param ch glyph to evaluate * @return the name of the glyph */ - public static final String charToGlyphName(char ch) { + public static String charToGlyphName(char ch) { return stringToGlyph(new Character(ch).toString()); } @@ -1286,7 +1289,7 @@ public class Glyphs { * TODO: javadocs for glyphToString and stringToGlyph are confused * TODO: Improve method names */ - public static final String glyphToString(String name) { + public static String glyphToString(String name) { for (int i = 0; i < UNICODE_GLYPHS.length; i += 2) { if (UNICODE_GLYPHS[i + 1].equals(name)) { return UNICODE_GLYPHS[i]; diff --git a/src/java/org/apache/fop/fonts/MultiByteFont.java b/src/java/org/apache/fop/fonts/MultiByteFont.java index 1e6bd4f84..b3b5d8639 100644 --- a/src/java/org/apache/fop/fonts/MultiByteFont.java +++ b/src/java/org/apache/fop/fonts/MultiByteFont.java @@ -241,7 +241,7 @@ public class MultiByteFont extends CIDFont { return subset.getSubsetGlyphs(); } - /** {@inheritDoc} */ + /** @return an array of the chars used */ public char[] getCharsUsed() { if (!isEmbeddable()) { return null; diff --git a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java index d12b19654..a6db7b6d0 100644 --- a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java +++ b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java @@ -317,6 +317,7 @@ public class FontFileReader { * Read an ISO-8859-1 string of len bytes. * * @param len The length of the string to read + * @param encodingID the string encoding id (presently ignored; always uses UTF-16BE) * @return A String * @throws IOException If EOF is reached */ diff --git a/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java index 171f71a76..897d5e2de 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java @@ -44,6 +44,17 @@ public class TTFCmapEntry { /** * {@inheritDoc} */ + public int hashCode() { + int hc = super.hashCode(); + hc ^= ( hc * 11 ) + unicodeStart; + hc ^= ( hc * 19 ) + unicodeEnd; + hc ^= ( hc * 23 ) + glyphStartIndex; + return hc; + } + + /** + * {@inheritDoc} + */ public boolean equals(Object o) { if (o instanceof TTFCmapEntry) { TTFCmapEntry ce = (TTFCmapEntry)o; diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFile.java b/src/java/org/apache/fop/fonts/truetype/TTFFile.java index 9fd6adbce..a049aaf04 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFFile.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFFile.java @@ -245,7 +245,8 @@ public class TTFFile { } } - private boolean readUnicodeCmap(FontFileReader in, long cmapUniOffset, int encodingID) + private boolean readUnicodeCmap // CSOK: MethodLength + (FontFileReader in, long cmapUniOffset, int encodingID) throws IOException { //Read CMAP table and correct mtxTab.index int mtxPtr = 0; @@ -961,7 +962,7 @@ public class TTFFile { * Read the "post" table * containing the PostScript names of the glyphs. */ - private final void readPostScript(FontFileReader in) throws IOException { + private void readPostScript(FontFileReader in) throws IOException { seekTab(in, "post", 0); postFormat = in.readTTFLong(); italicAngle = in.readTTFULong(); @@ -1133,7 +1134,7 @@ public class TTFFile { * @param in FontFileReader to read from * @throws IOException In case of a I/O problem */ - private final void readGlyf(FontFileReader in) throws IOException { + private void readGlyf(FontFileReader in) throws IOException { TTFDirTabEntry dirTab = (TTFDirTabEntry)dirTabs.get("glyf"); if (dirTab == null) { throw new IOException("glyf table not found, cannot continue"); @@ -1188,7 +1189,7 @@ public class TTFFile { * @param in FontFileReader to read from * @throws IOException In case of a I/O problem */ - private final void readName(FontFileReader in) throws IOException { + private void readName(FontFileReader in) throws IOException { seekTab(in, "name", 2); int i = in.getCurrentPos(); int n = in.readTTFUShort(); @@ -1259,7 +1260,7 @@ public class TTFFile { * @param in FontFileReader to read from * @throws IOException In case of a I/O problem */ - private final boolean readPCLT(FontFileReader in) throws IOException { + private boolean readPCLT(FontFileReader in) throws IOException { TTFDirTabEntry dirTab = (TTFDirTabEntry)dirTabs.get("PCLT"); if (dirTab != null) { in.seekSet(dirTab.getOffset() + 4 + 4 + 2); @@ -1403,7 +1404,7 @@ public class TTFFile { * @param in FontFileReader to read from * @throws IOException In case of a I/O problem */ - private final void readKerning(FontFileReader in) throws IOException { + private void readKerning(FontFileReader in) throws IOException { // Read kerning kerningTab = new java.util.HashMap(); ansiKerningTab = new java.util.HashMap(); diff --git a/src/java/org/apache/fop/fonts/type1/PFBParser.java b/src/java/org/apache/fop/fonts/type1/PFBParser.java index bd12c2c77..8cb90b146 100644 --- a/src/java/org/apache/fop/fonts/type1/PFBParser.java +++ b/src/java/org/apache/fop/fonts/type1/PFBParser.java @@ -161,7 +161,7 @@ public class PFBParser { } - private static final boolean byteCmp(byte[] src, int srcOffset, byte[] cmp) { + private static boolean byteCmp(byte[] src, int srcOffset, byte[] cmp) { for (int i = 0; i < cmp.length; i++) { // System.out.println("Compare: " + src[srcOffset + i] + " " + cmp[i]); if (src[srcOffset + i] != cmp[i]) { diff --git a/src/java/org/apache/fop/hyphenation/ByteVector.java b/src/java/org/apache/fop/hyphenation/ByteVector.java index 5a81a51ec..920089684 100644 --- a/src/java/org/apache/fop/hyphenation/ByteVector.java +++ b/src/java/org/apache/fop/hyphenation/ByteVector.java @@ -45,10 +45,17 @@ public class ByteVector implements Serializable { */ private int n; + /** + * Construct byte vector instance with default block size. + */ public ByteVector() { this(DEFAULT_BLOCK_SIZE); } + /** + * Construct byte vector instance. + * @param capacity initial block size + */ public ByteVector(int capacity) { if (capacity > 0) { blockSize = capacity; @@ -59,12 +66,25 @@ public class ByteVector implements Serializable { n = 0; } + /** + * Construct byte vector instance. + * @param a byte array to use + * @asf.todo should n should be initialized to a.length to be consistent with + * CharVector behavior? [GA] + */ public ByteVector(byte[] a) { blockSize = DEFAULT_BLOCK_SIZE; array = a; n = 0; } + /** + * Construct byte vector instance. + * @param a byte array to use + * @param capacity initial block size + * @asf.todo should n should be initialized to a.length to be consistent with + * CharVector behavior? [GA] + */ public ByteVector(byte[] a, int capacity) { if (capacity > 0) { blockSize = capacity; @@ -75,34 +95,52 @@ public class ByteVector implements Serializable { n = 0; } + /** + * Obtain byte vector array. + * @return byte array + */ public byte[] getArray() { return array; } /** - * return number of items in array + * Obtain number of items in array. + * @return number of items */ public int length() { return n; } /** - * returns current capacity of array + * Obtain capacity of array. + * @return current capacity of array */ public int capacity() { return array.length; } + /** + * Pet byte at index. + * @param index the index + * @param val a byte + */ public void put(int index, byte val) { array[index] = val; } + /** + * Get byte at index. + * @param index the index + * @return a byte + */ public byte get(int index) { return array[index]; } /** * This is to implement memory allocation in the array. Like malloc(). + * @param size to allocate + * @return previous length */ public int alloc(int size) { int index = n; @@ -116,6 +154,9 @@ public class ByteVector implements Serializable { return index; } + /** + * Trim byte vector to current length. + */ public void trimToSize() { if (n < array.length) { byte[] aux = new byte[n]; diff --git a/src/java/org/apache/fop/hyphenation/CharVector.java b/src/java/org/apache/fop/hyphenation/CharVector.java index ad8280f12..0ba42362b 100644 --- a/src/java/org/apache/fop/hyphenation/CharVector.java +++ b/src/java/org/apache/fop/hyphenation/CharVector.java @@ -45,10 +45,17 @@ public class CharVector implements Cloneable, Serializable { */ private int n; + /** + * Construct char vector instance with default block size. + */ public CharVector() { this(DEFAULT_BLOCK_SIZE); } + /** + * Construct char vector instance. + * @param capacity initial block size + */ public CharVector(int capacity) { if (capacity > 0) { blockSize = capacity; @@ -59,12 +66,21 @@ public class CharVector implements Cloneable, Serializable { n = 0; } + /** + * Construct char vector instance. + * @param a char array to use + */ public CharVector(char[] a) { blockSize = DEFAULT_BLOCK_SIZE; array = a; n = a.length; } + /** + * Construct char vector instance. + * @param a char array to use + * @param capacity initial block size + */ public CharVector(char[] a, int capacity) { if (capacity > 0) { blockSize = capacity; @@ -76,44 +92,66 @@ public class CharVector implements Cloneable, Serializable { } /** - * Reset Vector but don't resize or clear elements + * Reset length of vector, but don't clear contents. */ public void clear() { n = 0; } + /** {@inheritDoc} */ public Object clone() { CharVector cv = new CharVector((char[])array.clone(), blockSize); cv.n = this.n; return cv; } + /** + * Obtain char vector array. + * @return char array + */ public char[] getArray() { return array; } /** - * return number of items in array + * Obtain number of items in array. + * @return number of items */ public int length() { return n; } /** - * returns current capacity of array + * Obtain capacity of array. + * @return current capacity of array */ public int capacity() { return array.length; } + /** + * Pet char at index. + * @param index the index + * @param val a char + */ public void put(int index, char val) { array[index] = val; } + /** + * Get char at index. + * @param index the index + * @return a char + */ public char get(int index) { return array[index]; } + /** + * This is to implement memory allocation in the array. Like malloc(). + * @param size to allocate + * @return previous length + */ public int alloc(int size) { int index = n; int len = array.length; @@ -126,6 +164,9 @@ public class CharVector implements Cloneable, Serializable { return index; } + /** + * Trim char vector to current length. + */ public void trimToSize() { if (n < array.length) { char[] aux = new char[n]; diff --git a/src/java/org/apache/fop/hyphenation/Hyphen.java b/src/java/org/apache/fop/hyphenation/Hyphen.java index 268e3861d..ca876e1ec 100644 --- a/src/java/org/apache/fop/hyphenation/Hyphen.java +++ b/src/java/org/apache/fop/hyphenation/Hyphen.java @@ -34,23 +34,43 @@ import java.io.Serializable; * @author Carlos Villegas <cav@uniscope.co.jp> */ +/** + * Represents a hyphen. + */ public class Hyphen implements Serializable { - public String preBreak; - public String noBreak; - public String postBreak; + /** pre break string */ + public String preBreak; // CSOK: VisibilityModifier + + /** no break string */ + public String noBreak; // CSOK: VisibilityModifier + + /** post break string */ + public String postBreak; // CSOK: VisibilityModifier + + /** + * Construct a hyphen. + * @param pre break string + * @param no break string + * @param post break string + */ Hyphen(String pre, String no, String post) { preBreak = pre; noBreak = no; postBreak = post; } + /** + * Construct a hyphen. + * @param pre break string + */ Hyphen(String pre) { preBreak = pre; noBreak = null; postBreak = null; } + /** {@inheritDoc} */ public String toString() { if (noBreak == null && postBreak == null diff --git a/src/java/org/apache/fop/hyphenation/Hyphenation.java b/src/java/org/apache/fop/hyphenation/Hyphenation.java index fe4d6ba0c..b1e2f1cde 100644 --- a/src/java/org/apache/fop/hyphenation/Hyphenation.java +++ b/src/java/org/apache/fop/hyphenation/Hyphenation.java @@ -52,6 +52,7 @@ public class Hyphenation { } /** + * @param index an index position * @return the pre-break text, not including the hyphen character */ public String getPreHyphenText(int index) { @@ -59,6 +60,7 @@ public class Hyphenation { } /** + * @param index an index position * @return the post-break text */ public String getPostHyphenText(int index) { @@ -72,6 +74,7 @@ public class Hyphenation { return hyphenPoints; } + /** {@inheritDoc} */ public String toString() { StringBuffer str = new StringBuffer(); int start = 0; diff --git a/src/java/org/apache/fop/hyphenation/HyphenationException.java b/src/java/org/apache/fop/hyphenation/HyphenationException.java index 0a4e737c6..e109cadf9 100644 --- a/src/java/org/apache/fop/hyphenation/HyphenationException.java +++ b/src/java/org/apache/fop/hyphenation/HyphenationException.java @@ -20,12 +20,15 @@ package org.apache.fop.hyphenation; /** + * An hyphenation exception. * @author Carlos Villegas <cav@uniscope.co.jp> - * (todo) Derive from FOPException + * @asf.todo Derive from FOPException */ public class HyphenationException extends Exception { /** + * Construct a hyphenation exception. + * @param msg a message string * @see java.lang.Throwable#Throwable(String) */ public HyphenationException(String msg) { diff --git a/src/java/org/apache/fop/hyphenation/HyphenationTree.java b/src/java/org/apache/fop/hyphenation/HyphenationTree.java index 41d4cc63c..fa7d218d9 100644 --- a/src/java/org/apache/fop/hyphenation/HyphenationTree.java +++ b/src/java/org/apache/fop/hyphenation/HyphenationTree.java @@ -66,6 +66,7 @@ public class HyphenationTree extends TernaryTree */ private transient TernaryTree ivalues; + /** Default constructor. */ public HyphenationTree() { stoplist = new HashMap(23); // usually a small table classmap = new TernaryTree(); @@ -100,6 +101,11 @@ public class HyphenationTree extends TernaryTree return offset; } + /** + * Unpack values. + * @param k an integer + * @return a string + */ protected String unpackValues(int k) { StringBuffer buf = new StringBuffer(); byte v = vspace.get(k++); @@ -154,6 +160,11 @@ public class HyphenationTree extends TernaryTree ivalues = null; } + /** + * Find pattern. + * @param pat a pattern + * @return a string + */ public String findPattern(String pat) { int k = super.find(pat); if (k >= 0) { @@ -164,7 +175,12 @@ public class HyphenationTree extends TernaryTree /** * String compare, returns 0 if equal or - * t is a substring of s + * t is a substring of s. + * @param s first character array + * @param si starting index into first array + * @param t second character array + * @param ti starting index into second array + * @return an integer */ protected int hstrcmp(char[] s, int si, char[] t, int ti) { for (; s[si] == t[ti]; si++, ti++) { @@ -178,6 +194,11 @@ public class HyphenationTree extends TernaryTree return s[si] - t[ti]; } + /** + * Get values. + * @param k an integer + * @return a byte array + */ protected byte[] getValues(int k) { StringBuffer buf = new StringBuffer(); byte v = vspace.get(k++); @@ -352,12 +373,12 @@ public class HyphenationTree extends TernaryTree if (nc < 0) { // found a non-letter character ... if (i == (1 + iIgnoreAtBeginning)) { // ... before any letter character - iIgnoreAtBeginning ++; + iIgnoreAtBeginning++; } else { // ... after a letter character bEndOfLetters = true; } - iLength --; + iLength--; } else { if (!bEndOfLetters) { word[i - iIgnoreAtBeginning] = (char)nc; @@ -435,6 +456,7 @@ public class HyphenationTree extends TernaryTree * files use only lower case characters, in this case a class * for letter 'a', for example, should be defined as "aA", the first * character being the normalization char. + * @param chargroup a character class (group) */ public void addClass(String chargroup) { if (chargroup.length() > 0) { @@ -479,6 +501,9 @@ public class HyphenationTree extends TernaryTree insert(pattern, (char)k); } + /** + * Print statistics. + */ public void printStats() { System.out.println("Value space size = " + Integer.toString(vspace.length())); @@ -486,11 +511,16 @@ public class HyphenationTree extends TernaryTree } + /** + * Main entry point for this hyphenation utility application. + * @param argv array of command linee arguments + * @throws Exception in case an exception is raised but not caught + */ public static void main(String[] argv) throws Exception { HyphenationTree ht = null; int minCharCount = 2; - BufferedReader in = - new BufferedReader(new java.io.InputStreamReader(System.in)); + BufferedReader in + = new BufferedReader(new java.io.InputStreamReader(System.in)); while (true) { System.out.print("l:\tload patterns from XML\n" + "L:\tload patterns from serialized object\n" @@ -572,8 +602,8 @@ public class HyphenationTree extends TernaryTree long starttime = 0; int counter = 0; try { - BufferedReader reader = - new BufferedReader(new FileReader(token)); + BufferedReader reader + = new BufferedReader(new FileReader(token)); String line; starttime = System.currentTimeMillis(); diff --git a/src/java/org/apache/fop/hyphenation/Hyphenator.java b/src/java/org/apache/fop/hyphenation/Hyphenator.java index 401cc6e3b..230f2ae20 100644 --- a/src/java/org/apache/fop/hyphenation/Hyphenator.java +++ b/src/java/org/apache/fop/hyphenation/Hyphenator.java @@ -259,7 +259,8 @@ public class Hyphenator { if (source.getSystemId() != null) { in = new java.net.URL(source.getSystemId()).openStream(); } else { - throw new UnsupportedOperationException("Cannot load hyphenation pattern file" + throw new UnsupportedOperationException + ("Cannot load hyphenation pattern file" + " with the supplied Source object: " + source); } } @@ -377,7 +378,8 @@ public class Hyphenator { * @param rightMin the minimum number of characters after the hyphenation point * @return the hyphenation result */ - public static Hyphenation hyphenate(String lang, String country, + public static Hyphenation hyphenate(String lang, // CSOK: ParameterNumber + String country, HyphenationTreeResolver resolver, char[] word, int offset, int len, int leftMin, int rightMin) { diff --git a/src/java/org/apache/fop/hyphenation/PatternConsumer.java b/src/java/org/apache/fop/hyphenation/PatternConsumer.java index 6263b5534..5fb80dcaa 100644 --- a/src/java/org/apache/fop/hyphenation/PatternConsumer.java +++ b/src/java/org/apache/fop/hyphenation/PatternConsumer.java @@ -44,6 +44,8 @@ public interface PatternConsumer { * fails or the user wants to provide his own hyphenation. * A hyphenatedword is a vector of alternating String's and * {@link Hyphen Hyphen} instances + * @param word word to add as an exception + * @param hyphenatedword pre-hyphenated word */ void addException(String word, ArrayList hyphenatedword); diff --git a/src/java/org/apache/fop/hyphenation/PatternParser.java b/src/java/org/apache/fop/hyphenation/PatternParser.java index b34ab7ec8..4c4edd78e 100644 --- a/src/java/org/apache/fop/hyphenation/PatternParser.java +++ b/src/java/org/apache/fop/hyphenation/PatternParser.java @@ -61,6 +61,10 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { static final int ELEM_PATTERNS = 3; static final int ELEM_HYPHEN = 4; + /** + * Construct a pattern parser. + * @throws HyphenationException if a hyphenation exception is raised + */ public PatternParser() throws HyphenationException { this.consumer = this; token = new StringBuffer(); @@ -70,6 +74,11 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { hyphenChar = '-'; // default } + /** + * Construct a pattern parser. + * @param consumer a pattern consumer + * @throws HyphenationException if a hyphenation exception is raised + */ public PatternParser(PatternConsumer consumer) throws HyphenationException { this(); this.consumer = consumer; @@ -130,7 +139,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { } } - protected String readToken(StringBuffer chars) { + private String readToken(StringBuffer chars) { String word; boolean space = false; int i; @@ -175,7 +184,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { return null; } - protected static String getPattern(String word) { + private static String getPattern(String word) { StringBuffer pat = new StringBuffer(); int len = word.length(); for (int i = 0; i < len; i++) { @@ -186,7 +195,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { return pat.toString(); } - protected ArrayList normalizeException(ArrayList ex) { + private ArrayList normalizeException(ArrayList ex) { ArrayList res = new ArrayList(); for (int i = 0; i < ex.size(); i++) { Object item = ex.get(i); @@ -217,7 +226,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { return res; } - protected String getExceptionWord(ArrayList ex) { + private String getExceptionWord(ArrayList ex) { StringBuffer res = new StringBuffer(); for (int i = 0; i < ex.size(); i++) { Object item = ex.get(i); @@ -232,7 +241,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { return res.toString(); } - protected static String getInterletterValues(String pat) { + private static String getInterletterValues(String pat) { StringBuffer il = new StringBuffer(); String word = pat + "a"; // add dummy letter to serve as sentinel int len = word.length(); @@ -248,6 +257,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { return il.toString(); } + /** @throws SAXException if not caught */ protected void getExternalClasses() throws SAXException { XMLReader mainParser = parser; parser = createParser(); @@ -328,6 +338,8 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { case ELEM_HYPHEN: // nothing to do break; + default: + break; } if (currElement != ELEM_HYPHEN) { token.setLength(0); @@ -347,7 +359,7 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { /** * {@inheritDoc} */ - public void characters(char ch[], int start, int length) { + public void characters(char[] ch, int start, int length) { StringBuffer chars = new StringBuffer(length); chars.append(ch, start, length); String word = readToken(chars); @@ -368,6 +380,8 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { consumer.addPattern(getPattern(word), getInterletterValues(word)); break; + default: + break; } word = readToken(chars); } @@ -426,15 +440,26 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { } // getLocationString(SAXParseException):String - // PatternConsumer implementation for testing purposes + /** + * For testing purposes only. + * {@inheritDoc} + */ public void addClass(String c) { testOut.println("class: " + c); } + /** + * For testing purposes only. + * {@inheritDoc} + */ public void addException(String w, ArrayList e) { testOut.println("exception: " + w + " : " + e.toString()); } + /** + * For testing purposes only. + * {@inheritDoc} + */ public void addPattern(String p, String v) { testOut.println("pattern: " + p + " : " + v); } @@ -442,17 +467,26 @@ public class PatternParser extends DefaultHandler implements PatternConsumer { private PrintStream testOut = System.out; /** + * Set test out stream. * @param testOut the testOut to set */ public void setTestOut(PrintStream testOut) { this.testOut = testOut; } + /** + * Close test out file. + */ public void closeTestOut() { testOut.flush(); testOut.close(); } + /** + * Main entry point when used as an application. + * @param args array of command line arguments + * @throws Exception in case of uncaught exception + */ public static void main(String[] args) throws Exception { if (args.length > 0) { PatternParser pp = new PatternParser(); diff --git a/src/java/org/apache/fop/hyphenation/TernaryTree.java b/src/java/org/apache/fop/hyphenation/TernaryTree.java index 0824632a3..a3a823324 100644 --- a/src/java/org/apache/fop/hyphenation/TernaryTree.java +++ b/src/java/org/apache/fop/hyphenation/TernaryTree.java @@ -107,16 +107,22 @@ public class TernaryTree implements Cloneable, Serializable { */ protected CharVector kv; + /** root */ protected char root; + /** free node */ protected char freenode; - protected int length; // number of items in tree + /** number of items in tree */ + protected int length; - protected static final int BLOCK_SIZE = 2048; // allocation size for arrays + /** allocation size for arrays */ + protected static final int BLOCK_SIZE = 2048; + /** default constructor */ TernaryTree() { init(); } + /** initialize */ protected void init() { root = 0; freenode = 1; @@ -135,6 +141,8 @@ public class TernaryTree implements Cloneable, Serializable { * another key with same prefix * is inserted. This saves a lot of space, * specially for long keys. + * @param key the key + * @param val a value */ public void insert(String key, char val) { // make sure we have enough room in the arrays @@ -143,12 +151,18 @@ public class TernaryTree implements Cloneable, Serializable { if (freenode + len > eq.length) { redimNodeArrays(eq.length + BLOCK_SIZE); } - char strkey[] = new char[len--]; + char[] strkey = new char[len--]; key.getChars(0, len, strkey, 0); strkey[len] = 0; root = insert(root, strkey, 0, val); } + /** + * Insert key. + * @param key the key + * @param start offset into key array + * @param val a value + */ public void insert(char[] key, int start, char val) { int len = strlen(key) + 1; if (freenode + len > eq.length) { @@ -232,6 +246,11 @@ public class TernaryTree implements Cloneable, Serializable { /** * Compares 2 null terminated char arrays + * @param a a character array + * @param startA an index into character array + * @param b a character array + * @param startB an index into character array + * @return an integer */ public static int strcmp(char[] a, int startA, char[] b, int startB) { for (; a[startA] == b[startB]; startA++, startB++) { @@ -244,6 +263,10 @@ public class TernaryTree implements Cloneable, Serializable { /** * Compares a string with null terminated char array + * @param str a string + * @param a a character array + * @param start an index into character array + * @return an integer */ public static int strcmp(String str, char[] a, int start) { int i, d, len = str.length(); @@ -263,6 +286,12 @@ public class TernaryTree implements Cloneable, Serializable { } + /** + * @param dst a character array + * @param di an index into character array + * @param src a character array + * @param si an index into character array + */ public static void strcpy(char[] dst, int di, char[] src, int si) { while (src[si] != 0) { dst[di++] = src[si++]; @@ -270,6 +299,11 @@ public class TernaryTree implements Cloneable, Serializable { dst[di] = 0; } + /** + * @param a a character array + * @param start an index into character array + * @return an integer + */ public static int strlen(char[] a, int start) { int len = 0; for (int i = start; i < a.length && a[i] != 0; i++) { @@ -278,19 +312,34 @@ public class TernaryTree implements Cloneable, Serializable { return len; } + /** + * @param a a character array + * @return an integer + */ public static int strlen(char[] a) { return strlen(a, 0); } + /** + * Find key. + * @param key the key + * @return result + */ public int find(String key) { int len = key.length(); - char strkey[] = new char[len + 1]; + char[] strkey = new char[len + 1]; key.getChars(0, len, strkey, 0); strkey[len] = 0; return find(strkey, 0); } + /** + * Find key. + * @param key the key + * @param start offset into key array + * @return result + */ public int find(char[] key, int start) { int d; char p = root; @@ -322,6 +371,10 @@ public class TernaryTree implements Cloneable, Serializable { return -1; } + /** + * @param key a key + * @return trye if key present + */ public boolean knows(String key) { return (find(key) >= 0); } @@ -343,10 +396,12 @@ public class TernaryTree implements Cloneable, Serializable { sc = na; } + /** @return length */ public int size() { return length; } + /** {@inheritDoc} */ public Object clone() { TernaryTree t = new TernaryTree(); t.lo = (char[])this.lo.clone(); @@ -366,6 +421,10 @@ public class TernaryTree implements Cloneable, Serializable { * lower and upper halves, and so on in order to get a balanced * tree. The array of keys is assumed to be sorted in ascending * order. + * @param k array of keys + * @param v array of values + * @param offset where to insert + * @param n count to insert */ protected void insertBalanced(String[] k, char[] v, int offset, int n) { int m; @@ -453,37 +512,47 @@ public class TernaryTree implements Cloneable, Serializable { } } - + /** @return the keys */ public Enumeration keys() { return new Iterator(); } + /** an iterator */ public class Iterator implements Enumeration { /** * current node index */ - int cur; + int cur; // CSOK: VisibilityModifier /** * current key */ - String curkey; + String curkey; // CSOK: VisibilityModifier private class Item implements Cloneable { - char parent; - char child; + /** parent */ + char parent; // CSOK: VisibilityModifier + /** child */ + char child; // CSOK: VisibilityModifier + /** default constructor */ public Item() { parent = 0; child = 0; } + /** + * Construct item. + * @param p a char + * @param c a char + */ public Item(char p, char c) { parent = p; child = c; } + /** {@inheritDoc} */ public Object clone() { return new Item(parent, child); } @@ -493,13 +562,14 @@ public class TernaryTree implements Cloneable, Serializable { /** * Node stack */ - Stack ns; + Stack ns; // CSOK: VisibilityModifier /** * key stack implemented with a StringBuffer */ - StringBuffer ks; + StringBuffer ks; // CSOK: VisibilityModifier + /** default constructor */ public Iterator() { cur = -1; ns = new Stack(); @@ -507,6 +577,7 @@ public class TernaryTree implements Cloneable, Serializable { rewind(); } + /** rewind iterator */ public void rewind() { ns.removeAllElements(); ks.setLength(0); @@ -514,6 +585,7 @@ public class TernaryTree implements Cloneable, Serializable { run(); } + /** @return next element */ public Object nextElement() { String res = new String(curkey); cur = up(); @@ -521,6 +593,7 @@ public class TernaryTree implements Cloneable, Serializable { return res; } + /** @return value */ public char getValue() { if (cur >= 0) { return eq[cur]; @@ -528,6 +601,7 @@ public class TernaryTree implements Cloneable, Serializable { return 0; } + /** @return true if more elements */ public boolean hasMoreElements() { return (cur != -1); } @@ -633,6 +707,9 @@ public class TernaryTree implements Cloneable, Serializable { } + /** + * Print stats (for testing). + */ public void printStats() { System.out.println("Number of keys = " + Integer.toString(length)); System.out.println("Node count = " + Integer.toString(freenode)); @@ -653,6 +730,11 @@ public class TernaryTree implements Cloneable, Serializable { } + /** + * Main entry point for testing. + * @param args not used + * @throws Exception if not caught + */ public static void main(String[] args) throws Exception { TernaryTree tt = new TernaryTree(); tt.insert("Carlos", 'C'); diff --git a/src/java/org/apache/fop/image/loader/batik/BatikUtil.java b/src/java/org/apache/fop/image/loader/batik/BatikUtil.java index 20a7bf767..c5b6264b4 100644 --- a/src/java/org/apache/fop/image/loader/batik/BatikUtil.java +++ b/src/java/org/apache/fop/image/loader/batik/BatikUtil.java @@ -27,7 +27,10 @@ import org.apache.batik.dom.util.DOMUtilities; /** * Helper utilities for Apache Batik. */ -public class BatikUtil { +public final class BatikUtil { + + private BatikUtil() { + } /** * Checks whether Apache Batik is available in the classpath. diff --git a/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java b/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java index 5e4e37345..c675e3cfc 100644 --- a/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java +++ b/src/java/org/apache/fop/image/loader/batik/PreloaderSVG.java @@ -102,7 +102,11 @@ public class PreloaderSVG extends AbstractImagePreloader { * attempt to load Batik related classes when constructing the SVGPreloader * class. */ - class Loader { + private final class Loader { + + private Loader() { + } + private ImageInfo getImage(String uri, Source src, ImageContext context) { // parse document and get the size attributes of the svg element diff --git a/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.java b/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.java index 4e78f8193..8bda04903 100644 --- a/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.java +++ b/src/java/org/apache/fop/image/loader/batik/PreloaderWMF.java @@ -78,7 +78,11 @@ public class PreloaderWMF extends AbstractImagePreloader { * attempt to load Batik related classes when constructing the WMFPreloader * class. */ - class Loader { + private final class Loader { + + private Loader() { + } + private ImageInfo getImage(String uri, Source src, ImageContext context) { // parse document and get the size attributes of the svg element diff --git a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java index 07c2a3d36..cc18c5b36 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractBreaker.java @@ -42,15 +42,19 @@ public abstract class AbstractBreaker { /** logging instance */ protected static Log log = LogFactory.getLog(AbstractBreaker.class); + /** + * A page break position. + */ public static class PageBreakPosition extends LeafPosition { - double bpdAdjust; // Percentage to adjust (stretch or shrink) - int difference; - int footnoteFirstListIndex; - int footnoteFirstElementIndex; - int footnoteLastListIndex; - int footnoteLastElementIndex; - - PageBreakPosition(LayoutManager lm, int breakIndex, + // Percentage to adjust (stretch or shrink) + double bpdAdjust; // CSOK: VisibilityModifier + int difference; // CSOK: VisibilityModifier + int footnoteFirstListIndex; // CSOK: VisibilityModifier + int footnoteFirstElementIndex; // CSOK: VisibilityModifier + int footnoteLastListIndex; // CSOK: VisibilityModifier + int footnoteLastElementIndex; // CSOK: VisibilityModifier + + PageBreakPosition(LayoutManager lm, int breakIndex, // CSOK: ParameterNumber int ffli, int ffei, int flli, int flei, double bpdA, int diff) { super(lm, breakIndex); @@ -90,9 +94,9 @@ public abstract class AbstractBreaker { public class BlockSequence extends BlockKnuthSequence { /** Number of elements to ignore at the beginning of the list. */ - public int ignoreAtStart = 0; + int ignoreAtStart = 0; // CSOK: VisibilityModifier /** Number of elements to ignore at the end of the list. */ - public int ignoreAtEnd = 0; + int ignoreAtEnd = 0; // CSOK: VisibilityModifier /** * startOn represents where on the page/which page layout @@ -198,15 +202,34 @@ public abstract class AbstractBreaker { private List blockLists = null; + /** desired text alignment */ protected int alignment; + private int alignmentLast; + /** footnote separator length */ protected MinOptMax footnoteSeparatorLength = MinOptMax.ZERO; + /** @return current display alignment */ protected abstract int getCurrentDisplayAlign(); + + /** @return true if content not exhausted */ protected abstract boolean hasMoreContent(); + + /** + * Tell the layout manager to add all the child areas implied + * by Position objects which will be returned by the + * Iterator. + * + * @param posIter the position iterator + * @param context the context + */ protected abstract void addAreas(PositionIterator posIter, LayoutContext context); + + /** @return top level layout manager */ protected abstract LayoutManager getTopLevelLM(); + + /** @return current child layout manager */ protected abstract LayoutManager getCurrentChildLM(); /** @@ -244,13 +267,27 @@ public abstract class AbstractBreaker { return null; } - /* - * This method is to contain the logic to determine the LM's - * getNextKnuthElements() implementation(s) that are to be called. - * @return LinkedList of Knuth elements. + /** + * Get a sequence of KnuthElements representing the content + * of the node assigned to the LM + * + * @param context the LayoutContext used to store layout information + * @param alignment the desired text alignment + * @return the list of KnuthElements */ protected abstract List getNextKnuthElements(LayoutContext context, int alignment); + /** + * Get a sequence of KnuthElements representing the content + * of the node assigned to the LM + * + * @param context the LayoutContext used to store layout information + * @param alignment the desired text alignment + * @param positionAtIPDChange last element on the part before an IPD change + * @param restartAtLM the layout manager from which to restart, if IPD + * change occurs between two LMs + * @return the list of KnuthElements + */ protected List getNextKnuthElements(LayoutContext context, int alignment, Position positionAtIPDChange, LayoutManager restartAtLM) { throw new UnsupportedOperationException("TODO: implement acceptable fallback"); @@ -261,6 +298,11 @@ public abstract class AbstractBreaker { return (this.blockLists.isEmpty()); } + /** + * Start part. + * @param list a block sequence + * @param breakClass a break class + */ protected void startPart(BlockSequence list, int breakClass) { //nop } @@ -272,6 +314,11 @@ public abstract class AbstractBreaker { //nop } + /** + * Finish part. + * @param alg a page breaking algorithm + * @param pbp a page break posittion + */ protected abstract void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp); /** @@ -809,8 +856,8 @@ public abstract class AbstractBreaker { * @param availableBPD the available BPD * @return the effective list */ - private BlockSequence justifyBoxes(BlockSequence blockList, PageBreakingAlgorithm alg, - int availableBPD) { + private BlockSequence justifyBoxes // CSOK: MethodLength + (BlockSequence blockList, PageBreakingAlgorithm alg, int availableBPD) { int iOptPageNumber; alg.setConstantLineWidth(availableBPD); iOptPageNumber = alg.findBreakingPoints(blockList, /*availableBPD,*/ @@ -843,15 +890,18 @@ public abstract class AbstractBreaker { // inside the // while loop must be a box KnuthElement firstElement; - while (!(firstElement = (KnuthElement) sequenceIterator - .next()).isBox()) { - // - log.debug("PLM> ignoring glue or penalty element " - + "at the beginning of the sequence"); - if (firstElement.isGlue()) { - ((BlockLevelLayoutManager) firstElement - .getLayoutManager()) + while ( sequenceIterator.hasNext() ) { + firstElement = (KnuthElement) sequenceIterator.next(); + if ( !firstElement.isBox() ) { + log.debug("PLM> ignoring glue or penalty element " + + "at the beginning of the sequence"); + if (firstElement.isGlue()) { + ((BlockLevelLayoutManager) firstElement + .getLayoutManager()) .discardSpace((KnuthGlue) firstElement); + } + } else { + break; } } firstElementIndex = sequenceIterator.previousIndex(); @@ -904,8 +954,10 @@ public abstract class AbstractBreaker { // blockSpaceList KnuthGlue blockSpace = (KnuthGlue) unconfirmedList .removeFirst(); - spaceMaxAdjustment = spaceMaxAdjustment.plusMax(blockSpace.getStretch()); - spaceMaxAdjustment = spaceMaxAdjustment.minusMin(blockSpace.getShrink()); + spaceMaxAdjustment + = spaceMaxAdjustment.plusMax(blockSpace.getStretch()); + spaceMaxAdjustment + = spaceMaxAdjustment.minusMin(blockSpace.getShrink()); blockSpacesList.add(blockSpace); } } @@ -995,7 +1047,9 @@ public abstract class AbstractBreaker { + (((int)((float) partial * difference / total)) - adjustedDiff) + " / " + difference); } - int newAdjust = ((BlockLevelLayoutManager) blockSpace.getLayoutManager()).negotiateBPDAdjustment(((int) ((float) partial * difference / total)) - adjustedDiff, blockSpace); + int newAdjust = ((BlockLevelLayoutManager) blockSpace.getLayoutManager()) + .negotiateBPDAdjustment + (((int) ((float) partial * difference / total)) - adjustedDiff, blockSpace); adjustedDiff += newAdjust; } return adjustedDiff; @@ -1003,7 +1057,13 @@ public abstract class AbstractBreaker { private int adjustLineNumbers(LinkedList lineList, int difference, int total) { if (log.isDebugEnabled()) { - log.debug("AdjustLineNumbers: difference " + difference + " / " + total + " on " + lineList.size() + " elements"); + log.debug("AdjustLineNumbers: difference " + + difference + + " / " + + total + + " on " + + lineList.size() + + " elements"); } ListIterator lineListIterator = lineList.listIterator(); @@ -1012,7 +1072,9 @@ public abstract class AbstractBreaker { while (lineListIterator.hasNext()) { KnuthGlue line = (KnuthGlue)lineListIterator.next(); partial += (difference > 0 ? line.getStretch() : line.getShrink()); - int newAdjust = ((BlockLevelLayoutManager) line.getLayoutManager()).negotiateBPDAdjustment(((int) ((float) partial * difference / total)) - adjustedDiff, line); + int newAdjust = ((BlockLevelLayoutManager) line.getLayoutManager()) + .negotiateBPDAdjustment + (((int) ((float) partial * difference / total)) - adjustedDiff, line); adjustedDiff += newAdjust; } return adjustedDiff; diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 1f91cef1a..ae230e261 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -123,6 +123,10 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager return null; } + /** + * Set currently active child layout manager. + * @param childLM the child layout manager + */ protected void setCurrentChildLM(LayoutManager childLM) { curChildLM = childLM; childLMiter = new LMiter(this); diff --git a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java index 0fa046aee..f5c9d0779 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java @@ -275,8 +275,8 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa /** * Makes a new page * - * @param bIsBlank whether this page is blank or not - * @param bIsLast whether this page is the last page or not + * @param isBlank whether this page is blank or not + * @param isLast whether this page is the last page or not * @return a new page */ protected Page makeNewPage(boolean isBlank, boolean isLast) { diff --git a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java index 14183c52e..755be91d1 100644 --- a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java +++ b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java @@ -27,7 +27,10 @@ import org.apache.fop.layoutmgr.SpaceResolver.SpaceHandlingBreakPosition; /** * Utility class which provides common code for the addAreas stage. */ -public class AreaAdditionUtil { +public final class AreaAdditionUtil { + + private AreaAdditionUtil() { + } private static class StackingIter extends PositionIterator { StackingIter(Iterator parentIter) { diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java index 2bb499a36..a6fbdd49c 100644 --- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java @@ -21,6 +21,7 @@ package org.apache.fop.layoutmgr; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.fop.fo.Constants; import org.apache.fop.traits.MinOptMax; /** @@ -29,13 +30,33 @@ import org.apache.fop.traits.MinOptMax; */ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm { - private Log log = LogFactory.getLog(BalancingColumnBreakingAlgorithm.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(BalancingColumnBreakingAlgorithm.class); private int columnCount; private int fullLen; private int idealPartLen; - public BalancingColumnBreakingAlgorithm(LayoutManager topLevelLM, + /** + * Construct a balancing column breaking algorithm. + * @param topLevelLM the top level layout manager + * @param pageProvider the page provider + * @param layoutListener the layout listener + * @param alignment alignment of the paragraph/page. One of {@link Constants#EN_START}, + * {@link Constants#EN_JUSTIFY}, {@link Constants#EN_CENTER}, + * {@link Constants#EN_END}. + * For pages, {@link Constants#EN_BEFORE} and {@link Constants#EN_AFTER} + * are mapped to the corresponding inline properties, + * {@link Constants#EN_START} and {@link Constants#EN_END}. + * @param alignmentLast alignment of the paragraph's last line + * @param footnoteSeparatorLength length of footnote separator + * @param partOverflowRecovery {@code true} if too long elements should be moved to + * the next line/part + * @param columnCount number of columns + * @see PageBreakingAlgorithm + */ + public BalancingColumnBreakingAlgorithm // CSOK: ParameterNumber + (LayoutManager topLevelLM, PageProvider pageProvider, PageBreakingLayoutListener layoutListener, int alignment, int alignmentLast, diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java index 5ca2b567f..ee010efe5 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java @@ -187,7 +187,8 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager } /** {@inheritDoc} */ - public List getNextKnuthElements(LayoutContext context, int alignment) { + public List getNextKnuthElements // CSOK: MethodLength + (LayoutContext context, int alignment) { resetSpaces(); if (isAbsoluteOrFixed()) { return getNextKnuthElementsAbsolute(context, alignment); @@ -404,8 +405,9 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager } /** {@inheritDoc} */ - public List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack, - Position restartPosition, LayoutManager restartAtLM) { + public List getNextKnuthElements // CSOK: MethodLength + (LayoutContext context, int alignment, Stack lmStack, + Position restartPosition, LayoutManager restartAtLM) { resetSpaces(); if (isAbsoluteOrFixed()) { return getNextKnuthElementsAbsolute(context, alignment); @@ -990,8 +992,8 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager } /** {@inheritDoc} */ - public void addAreas(PositionIterator parentIter, - LayoutContext layoutContext) { + public void addAreas // CSOK: MethodLength + (PositionIterator parentIter, LayoutContext layoutContext) { getParentArea(null); // if this will create the first block area in a page diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index 69e07a404..62e89bdb0 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -234,8 +234,8 @@ public class BlockLayoutManager extends BlockStackingLayoutManager } /** {@inheritDoc} */ - public void addAreas(PositionIterator parentIter, - LayoutContext layoutContext) { + public void addAreas // CSOK: MethodLength + (PositionIterator parentIter, LayoutContext layoutContext) { getParentArea(null); // if this will create the first block area in a page diff --git a/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java index a1d43dd6f..8f2a4b214 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java @@ -26,8 +26,18 @@ import org.apache.fop.fo.properties.KeepProperty; */ public interface BlockLevelLayoutManager extends LayoutManager { + /** + * Negotiate BPD adjustment. + * @param adj amount to adjust + * @param lastElement the last knuth element + * @return the resulting adjusted BPD + */ int negotiateBPDAdjustment(int adj, KnuthElement lastElement); + /** + * Discard space. + * @param spaceGlue the space + */ void discardSpace(KnuthGlue spaceGlue); /** diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index 4636cb15a..fd9f2a822 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -55,6 +55,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager */ private static Log log = LogFactory.getLog(BlockStackingLayoutManager.class); + /** parent area */ protected BlockParent parentArea; /** Value of the block-progression-unit (non-standard property) */ @@ -360,7 +361,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager } /** {@inheritDoc} */ - public List getNextKnuthElements(LayoutContext context, int alignment, Stack lmStack, + public List getNextKnuthElements // CSOK: MethodLength + (LayoutContext context, int alignment, Stack lmStack, Position restartPosition, LayoutManager restartAtLM) { referenceIPD = context.getRefIPD(); updateContentAreaIPDwithOverconstrainedAdjust(); @@ -582,8 +584,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager /** * Adds a break element to the content list between individual child elements. - * @param contentList - * @param parentLC + * @param contentList the content list + * @param parentLC the parent layout context * @param childLC the currently active child layout context */ protected void addInBetweenBreak(List contentList, LayoutContext parentLC, @@ -758,7 +760,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager /** * {@inheritDoc} */ - public List getChangedKnuthElements(List oldList, int alignment) { + public List getChangedKnuthElements(List oldList, int alignment) { // CSOK: MethodLength /*LF*/ //log.debug(""); /*LF*/ //log.debug(" BLM.getChangedKnuthElements> inizio: oldList.size() = " // + oldList.size()); @@ -1377,7 +1379,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager }*/ } - protected List createUnitElements(List oldList) { + /** + * Create unit elements. + * @param oldList the old list + * @return the new list + */ + protected List createUnitElements(List oldList) { // CSOK: MethodLength //log.debug("Start conversion: " + oldList.size() // + " elements, space-before.min=" + layoutProps.spaceBefore.getSpace().min // + " space-after.min=" + layoutProps.spaceAfter.getSpace().min); @@ -1640,7 +1647,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager // insert the correct elements newList.addFirst(new KnuthBox(wrongBox.getWidth() - decreasedLength, wrongBox.getPosition(), false)); - newList.addFirst(new KnuthGlue(decreasedLength, 0, 0, Adjustment.SPACE_BEFORE_ADJUSTMENT, + newList.addFirst(new KnuthGlue(decreasedLength, 0, 0, + Adjustment.SPACE_BEFORE_ADJUSTMENT, wrongBox.getPosition(), false)); //log.debug(" rimosso box " + neededUnits(wrongBox.getWidth())); //log.debug(" aggiunto glue " + neededUnits(decreasedLength) + " 0 0"); @@ -1692,34 +1700,58 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager return newList; } + /** A stack iterator. */ protected static class StackingIter extends PositionIterator { + + /** + * Construct a stacking iterator. + * @param parentIter the parent iterator + */ StackingIter(Iterator parentIter) { super(parentIter); } + /** + * @param nextObj the next position + * @return the layout manager of the next position + */ protected LayoutManager getLM(Object nextObj) { return ((Position) nextObj).getLM(); } + /** + * @param nextObj the next position + * @return the next position + */ protected Position getPos(Object nextObj) { return ((Position) nextObj); } } + /** A mapping position. */ protected static class MappingPosition extends Position { + private int iFirstIndex; private int iLastIndex; + /** + * Construct mapping position. + * @param lm layout manager + * @param first position + * @param last position + */ public MappingPosition(LayoutManager lm, int first, int last) { super(lm); iFirstIndex = first; iLastIndex = last; } + /** @return first index */ public int getFirstIndex() { return iFirstIndex; } + /** @return last index */ public int getLastIndex() { return iLastIndex; } diff --git a/src/java/org/apache/fop/layoutmgr/BreakElement.java b/src/java/org/apache/fop/layoutmgr/BreakElement.java index 3eb96e9cd..7208a585f 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakElement.java +++ b/src/java/org/apache/fop/layoutmgr/BreakElement.java @@ -55,7 +55,8 @@ public class BreakElement extends UnresolvedListElement { * @param breakClass the break class * @param context the {@link LayoutContext} */ - public BreakElement(Position position, int penaltyValue, int breakClass, LayoutContext context) { + public BreakElement(Position position, int penaltyValue, int breakClass, + LayoutContext context) { this(position, 0, penaltyValue, breakClass, context); } diff --git a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java index 4516c8d97..f8d78d477 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java @@ -59,12 +59,18 @@ public abstract class BreakingAlgorithm { /** Holder for symbolic literals for the fitness classes */ static final class FitnessClasses { + + private FitnessClasses() { + } + static final int VERY_TIGHT = 0; static final int TIGHT = 1; static final int LOOSE = 2; static final int VERY_LOOSE = 3; - static final String[] NAMES = { "VERY TIGHT", "TIGHT", "LOOSE", "VERY LOOSE" }; + static final String[] NAMES = { + "VERY TIGHT", "TIGHT", "LOOSE", "VERY LOOSE" + }; /** * Figure out the fitness class of this line (tight, loose, @@ -178,6 +184,9 @@ public abstract class BreakingAlgorithm { */ protected int totalShrink = 0; + /** + * Best records. + */ protected BestRecords best; private boolean partOverflowRecoveryActivated = true; @@ -217,51 +226,67 @@ public abstract class BreakingAlgorithm { */ public class KnuthNode { /** index of the breakpoint represented by this node */ - public final int position; + public final int position; // CSOK: VisibilityModifier /** number of the line ending at this breakpoint */ - public final int line; + public final int line; // CSOK: VisibilityModifier /** fitness class of the line ending at this breakpoint. One of 0, 1, 2, 3. */ - public final int fitness; + public final int fitness; // CSOK: VisibilityModifier /** accumulated width of the KnuthElements up to after this breakpoint. */ - public final int totalWidth; + public final int totalWidth; // CSOK: VisibilityModifier /** accumulated stretchability of the KnuthElements up to after this breakpoint. */ - public final int totalStretch; + public final int totalStretch; // CSOK: VisibilityModifier /** accumulated shrinkability of the KnuthElements up to after this breakpoint. */ - public final int totalShrink; + public final int totalShrink; // CSOK: VisibilityModifier /** adjustment ratio if the line ends at this breakpoint */ - public final double adjustRatio; + public final double adjustRatio; // CSOK: VisibilityModifier /** available stretch of the line ending at this breakpoint */ - public final int availableShrink; + public final int availableShrink; // CSOK: VisibilityModifier /** available shrink of the line ending at this breakpoint */ - public final int availableStretch; + public final int availableStretch; // CSOK: VisibilityModifier /** difference between target and actual line width */ - public final int difference; + public final int difference; // CSOK: VisibilityModifier /** minimum total demerits up to this breakpoint */ - public double totalDemerits; + public double totalDemerits; // CSOK: VisibilityModifier /** best node for the preceding breakpoint */ - public KnuthNode previous; + public KnuthNode previous; // CSOK: VisibilityModifier /** next possible node in the same line */ - public KnuthNode next; + public KnuthNode next; // CSOK: VisibilityModifier /** * Holds the number of subsequent recovery attempty that are made to get content fit * into a line. */ - public int fitRecoveryCounter = 0; + public int fitRecoveryCounter = 0; // CSOK: VisibilityModifier - public KnuthNode(int position, int line, int fitness, + /** + * Construct node. + * @param position an integer + * @param line an integer + * @param fitness an integer + * @param totalWidth an integer + * @param totalStretch an integer + * @param totalShrink an integer + * @param adjustRatio a real number + * @param availableShrink an integer + * @param availableStretch an integer + * @param difference an integer + * @param totalDemerits a real number + * @param previous a node + */ + public KnuthNode // CSOK: ParameterNumber + (int position, int line, int fitness, int totalWidth, int totalStretch, int totalShrink, double adjustRatio, int availableShrink, int availableStretch, int difference, double totalDemerits, KnuthNode previous) { @@ -279,6 +304,7 @@ public abstract class BreakingAlgorithm { this.previous = previous; } + /** {@inheritDoc} */ public String toString() { return "<KnuthNode at " + position + " " + totalWidth + "+" + totalStretch + "-" + totalShrink @@ -303,6 +329,7 @@ public abstract class BreakingAlgorithm { /** Points to the fitness class which currently leads to the best demerits. */ private int bestIndex = -1; + /** default constructor */ public BestRecords() { reset(); } @@ -334,6 +361,7 @@ public abstract class BreakingAlgorithm { } } + /** @return true if has records (best index not -1) */ public boolean hasRecords() { return (bestIndex != -1); } @@ -347,30 +375,55 @@ public abstract class BreakingAlgorithm { return (bestDemerits[fitness] != INFINITE_DEMERITS); } + /** + * @param fitness to use + * @return best demerits + */ public double getDemerits(int fitness) { return bestDemerits[fitness]; } + /** + * @param fitness to use + * @return best node + */ public KnuthNode getNode(int fitness) { return bestNode[fitness]; } + /** + * @param fitness to use + * @return adjustment + */ public double getAdjust(int fitness) { return bestAdjust[fitness]; } + /** + * @param fitness to use + * @return available shrink + */ public int getAvailableShrink(int fitness) { return bestAvailableShrink[fitness]; } + /** + * @param fitness to use + * @return available stretch + */ public int getAvailableStretch(int fitness) { return bestAvailableStretch[fitness]; } + /** + * @param fitness to use + * @return difference + */ public int getDifference(int fitness) { return bestDifference[fitness]; } + /** @return minimum demerits */ public double getMinDemerits() { if (bestIndex != -1) { return getDemerits(bestIndex); @@ -427,11 +480,22 @@ public abstract class BreakingAlgorithm { KnuthSequence sequence, int total); + /** @param lineWidth the line width */ public void setConstantLineWidth(int lineWidth) { this.lineWidth = lineWidth; } - /** @see #findBreakingPoints(KnuthSequence, int, double, boolean, int) */ + /** + * @param par the paragraph to break + * @param threshold upper bound of the adjustment ratio + * @param force {@code true} if a set of breakpoints must be found, even + * if there are no feasible ones + * @param allowedBreaks the type(s) of breaks allowed. One of {@link #ONLY_FORCED_BREAKS}, + * {@link #NO_FLAGGED_PENALTIES} or {@link #ALL_BREAKS}. + * + * @return the number of effective breaks + * @see #findBreakingPoints(KnuthSequence, int, double, boolean, int) + */ public int findBreakingPoints(KnuthSequence par, double threshold, boolean force, @@ -538,10 +602,18 @@ public abstract class BreakingAlgorithm { return line; } + /** + * obtain ipd difference + * @return an integer + */ protected int getIPDdifference() { return 0; } + /** + * handle ipd change + * @return an integer + */ protected int handleIpdChange() { throw new IllegalStateException(); } @@ -572,8 +644,10 @@ public abstract class BreakingAlgorithm { this.totalWidth = 0; this.totalStretch = 0; this.totalShrink = 0; - this.lastTooShort = this.lastTooLong = null; - this.startLine = this.endLine = 0; + this.lastTooShort = null; + this.lastTooLong = null; + this.startLine = 0; + this.endLine = 0; this.activeLines = new KnuthNode[20]; } @@ -597,7 +671,8 @@ public abstract class BreakingAlgorithm { * @param previous active node for the preceding breakpoint * @return a new node */ - protected KnuthNode createNode(int position, int line, int fitness, + protected KnuthNode createNode // CSOK: ParameterNumber + (int position, int line, int fitness, int totalWidth, int totalStretch, int totalShrink, double adjustRatio, int availableShrink, int availableStretch, int difference, double totalDemerits, KnuthNode previous) { @@ -609,7 +684,17 @@ public abstract class BreakingAlgorithm { /** Creates a new active node for a break from the best active node of the given * fitness class to the element at the given position. - * @see #createNode(int, int, int, int, int, int, double, int, int, int, double, org.apache.fop.layoutmgr.BreakingAlgorithm.KnuthNode) + * @param position index of the element in the Knuth sequence + * @param line number of the line ending at the breakpoint + * @param fitness fitness class of the line ending at the breakpoint. One of 0, 1, 2, 3. + * @param totalWidth accumulated width of the KnuthElements up to after the breakpoint + * @param totalStretch accumulated stretchability of the KnuthElements up to after the + * breakpoint + * @param totalShrink accumulated shrinkability of the KnuthElements up to after the + * breakpoint + * @return a new node + * @see #createNode(int, int, int, int, int, int, double, int, int, int, double, + * org.apache.fop.layoutmgr.BreakingAlgorithm.KnuthNode) * @see BreakingAlgorithm.BestRecords */ protected KnuthNode createNode(int position, int line, int fitness, @@ -655,7 +740,7 @@ public abstract class BreakingAlgorithm { handleBox((KnuthBox) element); } else if (element.isGlue()) { handleGlueAt((KnuthGlue) element, position, previousIsBox, allowedBreaks); - } else if (element.isPenalty()){ + } else if (element.isPenalty()) { handlePenaltyAt((KnuthPenalty) element, position, allowedBreaks); } else { throw new IllegalArgumentException( @@ -875,7 +960,7 @@ public abstract class BreakingAlgorithm { * number. * @param element the element * @param line the line number - * @param difference + * @param difference an integer * @return {@code true} if the element can end the line */ protected boolean elementCanEndLine(KnuthElement element, int line, int difference) { @@ -896,7 +981,7 @@ public abstract class BreakingAlgorithm { * @param availableShrink the available amount of shrink * @param availableStretch tha available amount of stretch */ - protected void forceNode(KnuthNode node, + protected void forceNode(KnuthNode node, // CSOK: ParameterNumber int line, int elementIdx, int difference, @@ -1320,6 +1405,10 @@ public abstract class BreakingAlgorithm { return sb.toString(); } + /** + * Filter active nodes. + * @return an integer + */ protected abstract int filterActiveNodes(); /** diff --git a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java index 73a6d5be4..d5c6f5527 100644 --- a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java +++ b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java @@ -27,7 +27,10 @@ import java.util.List; * is mainly used for the purpose of automated testing. This implementation here does nothing. * Please see the subclass within the test code. */ -public class ElementListObserver { +public final class ElementListObserver { + + private ElementListObserver() { + } private static List activeObservers = null; diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index 67b9b4254..2e6f6926a 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -36,7 +36,7 @@ import org.apache.fop.fo.pagination.Flow; * Its parent LM is the PageSequenceLayoutManager. * This LM is responsible for getting columns of the appropriate size * and filling them with block-level areas generated by its children. - * @todo Reintroduce emergency counter (generate error to avoid endless loop) + * @asf.todo Reintroduce emergency counter (generate error to avoid endless loop) */ public class FlowLayoutManager extends BlockStackingLayoutManager implements BlockLevelLayoutManager { @@ -79,7 +79,16 @@ public class FlowLayoutManager extends BlockStackingLayoutManager return elements; } - /** {@inheritDoc} */ + /** + * Get a sequence of KnuthElements representing the content + * of the node assigned to the LM. + * @param context the LayoutContext used to store layout information + * @param alignment the desired text alignment + * @param positionAtIPDChange position at ipd change + * @param restartAtLM restart at this layout manager + * @return the list of KnuthElements + * @see LayoutManager#getNextKnuthElements(LayoutContext,int) + */ public List getNextKnuthElements(LayoutContext context, int alignment, Position positionAtIPDChange, LayoutManager restartAtLM) { diff --git a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java index 0d00b710a..63a2f7c5e 100644 --- a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java +++ b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java @@ -95,6 +95,9 @@ public class InlineKnuthSequence extends KnuthSequence { return this; } + /** + * Add letter space. + */ public void addALetterSpace() { KnuthBox prevBox = (KnuthBox) getLast(); if (prevBox.isAuxiliary() diff --git a/src/java/org/apache/fop/layoutmgr/Keep.java b/src/java/org/apache/fop/layoutmgr/Keep.java index 444448ae4..c53c5e41a 100644 --- a/src/java/org/apache/fop/layoutmgr/Keep.java +++ b/src/java/org/apache/fop/layoutmgr/Keep.java @@ -1,16 +1,18 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license - * agreements. See the NOTICE file distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file to You under the Apache - * License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software distributed under - * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /* $Id$ */ @@ -25,7 +27,7 @@ import org.apache.fop.fo.properties.Property; * Object representing a keep constraint, corresponding * to the XSL-FO <a href="http://www.w3.org/TR/xsl/#d0e26492">keep properties</a>. */ -public class Keep { +public final class Keep { /** The integer value for "auto" keep strength. */ private static final int STRENGTH_AUTO = Integer.MIN_VALUE; @@ -33,8 +35,10 @@ public class Keep { /** The integer value for "always" keep strength. */ private static final int STRENGTH_ALWAYS = Integer.MAX_VALUE; + /** keep auto */ public static final Keep KEEP_AUTO = new Keep(STRENGTH_AUTO, Constants.EN_AUTO); + /** keep always */ public static final Keep KEEP_ALWAYS = new Keep(STRENGTH_ALWAYS, Constants.EN_LINE); private int strength; diff --git a/src/java/org/apache/fop/layoutmgr/KnuthGlue.java b/src/java/org/apache/fop/layoutmgr/KnuthGlue.java index 2efea0e61..2b89c10d4 100644 --- a/src/java/org/apache/fop/layoutmgr/KnuthGlue.java +++ b/src/java/org/apache/fop/layoutmgr/KnuthGlue.java @@ -87,6 +87,16 @@ public class KnuthGlue extends KnuthElement { this.adjustmentClass = Adjustment.NO_ADJUSTMENT; } + /** + * Creates a new <code>KnuthGlue</code>. + * + * @param width the width of this glue + * @param stretch the stretchability of this glue + * @param shrink the shrinkability of this glue + * @param adjustmentClass the adjsutment class + * @param pos the Position stored in this glue + * @param auxiliary is this glue auxiliary? + */ public KnuthGlue(int width, int stretch, int shrink, Adjustment adjustmentClass, Position pos, boolean auxiliary) { super(width, pos, auxiliary); diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java b/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java index e7397babb..e69b991b3 100644 --- a/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java +++ b/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java @@ -21,6 +21,9 @@ package org.apache.fop.layoutmgr; import java.util.List; +/** + * A Knuth element position iterator. + */ public class KnuthPossPosIter extends PositionIterator { private int iterCount; @@ -46,9 +49,7 @@ public class KnuthPossPosIter extends PositionIterator { // Check position < endPos - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ protected boolean checkNext() { if (iterCount > 0) { return super.checkNext(); @@ -58,22 +59,26 @@ public class KnuthPossPosIter extends PositionIterator { } } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public Object next() { --iterCount; return super.next(); } + /** + * Peek at next, returning as ListElement. + * @return peek at next as ListElement + */ public ListElement getKE() { return (ListElement) peekNext(); } + /** {@inheritDoc} */ protected LayoutManager getLM(Object nextObj) { return ((ListElement) nextObj).getLayoutManager(); } + /** {@inheritDoc} */ protected Position getPos(Object nextObj) { return ((ListElement) nextObj).getPosition(); } diff --git a/src/java/org/apache/fop/layoutmgr/KnuthSequence.java b/src/java/org/apache/fop/layoutmgr/KnuthSequence.java index 7c712040a..1a9bb6534 100644 --- a/src/java/org/apache/fop/layoutmgr/KnuthSequence.java +++ b/src/java/org/apache/fop/layoutmgr/KnuthSequence.java @@ -182,13 +182,20 @@ public abstract class KnuthSequence extends ArrayList { ListElement element = null; int posIndex = startIndex; int lastIndex = size(); - while (posIndex < lastIndex - && !(element = getElement(posIndex)).isBox()) { - posIndex++; + while ( posIndex < lastIndex ) { + element = getElement(posIndex); + if ( !element.isBox() ) { + posIndex++; + } else { + break; + } } - if (posIndex != startIndex - && element.isBox()) { - return posIndex - 1; + if ( posIndex != startIndex ) { + if ( ( element != null ) && element.isBox() ) { + return posIndex - 1; + } else { + return startIndex; + } } else { return startIndex; } diff --git a/src/java/org/apache/fop/layoutmgr/LMiter.java b/src/java/org/apache/fop/layoutmgr/LMiter.java index 4fa5590dc..9f437df6a 100644 --- a/src/java/org/apache/fop/layoutmgr/LMiter.java +++ b/src/java/org/apache/fop/layoutmgr/LMiter.java @@ -23,27 +23,36 @@ import java.util.List; import java.util.ListIterator; import java.util.NoSuchElementException; +/** An iterator for layout managers. */ public class LMiter implements ListIterator { - + /** list of layout managers */ protected List listLMs; + /** current position in iteration */ protected int curPos = 0; /** The LayoutManager to which this LMiter is attached **/ private LayoutManager lp; + /** + * Construct a layout manager iterator. + * @param lp the associated layout manager (parent) + */ public LMiter(LayoutManager lp) { this.lp = lp; listLMs = lp.getChildLMs(); } + /** {@inheritDoc} */ public boolean hasNext() { return (curPos < listLMs.size()) ? true : lp.createNextChildLMs(curPos); } + /** {@inheritDoc} */ public boolean hasPrevious() { return (curPos > 0); } + /** {@inheritDoc} */ public Object previous() throws NoSuchElementException { if (curPos > 0) { return listLMs.get(--curPos); @@ -52,6 +61,7 @@ public class LMiter implements ListIterator { } } + /** {@inheritDoc} */ public Object next() throws NoSuchElementException { if (curPos < listLMs.size()) { return listLMs.get(curPos++); @@ -60,7 +70,8 @@ public class LMiter implements ListIterator { } } - public void remove() throws NoSuchElementException { + /** {@inheritDoc} */ + public void remove() throws NoSuchElementException { if (curPos > 0) { listLMs.remove(--curPos); // Note: doesn't actually remove it from the base! @@ -70,18 +81,22 @@ public class LMiter implements ListIterator { } - public void add(Object o) throws UnsupportedOperationException { + /** {@inheritDoc} */ + public void add(Object o) throws UnsupportedOperationException { throw new UnsupportedOperationException("LMiter doesn't support add"); } + /** {@inheritDoc} */ public void set(Object o) throws UnsupportedOperationException { throw new UnsupportedOperationException("LMiter doesn't support set"); } + /** {@inheritDoc} */ public int nextIndex() { return curPos; } + /** {@inheritDoc} */ public int previousIndex() { return curPos - 1; } diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java index 752ffd628..18059c5ca 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java @@ -33,12 +33,12 @@ import org.apache.fop.traits.MinOptMax; * method. It is set up by higher level LM and used by lower level LM. */ public class LayoutContext { - /** - * Values for flags. - */ + + /** linebreak at line feed only flag */ public static final int LINEBREAK_AT_LF_ONLY = 0x01; /** Generated break possibility is first in a new area */ public static final int NEW_AREA = 0x02; + /** ipd unknown flag */ public static final int IPD_UNKNOWN = 0x04; /** Signal to a Line LM that a higher level LM may provoke a change * in the reference area, thus ref area IPD. The LineLM should return @@ -51,10 +51,13 @@ public class LayoutContext { * not cause a mandatory break as this break was already handled by a parent layout manager. */ public static final int SUPPRESS_BREAK_BEFORE = 0x10; + /** first area flag */ public static final int FIRST_AREA = 0x20; + /** try hypenate flag */ public static final int TRY_HYPHENATE = 0x40; + /** last area flag */ public static final int LAST_AREA = 0x80; - + /** resolve leading space flag */ public static final int RESOLVE_LEADING_SPACE = 0x100; /** @@ -178,6 +181,7 @@ public class LayoutContext { trailingSpace = null; } + /** @param source from which pending marks are copied */ public void copyPendingMarksFrom(LayoutContext source) { if (source.pendingAfterMarks != null) { this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks); @@ -187,10 +191,15 @@ public class LayoutContext { } } + /** @param flags to set */ public void setFlags(int flags) { setFlags(flags, true); } + /** + * @param flags to set or clear + * @param bSet true to set, false to clear + */ public void setFlags(int flags, boolean bSet) { if (bSet) { this.flags |= flags; @@ -199,26 +208,32 @@ public class LayoutContext { } } + /** @param flags to clear */ public void unsetFlags(int flags) { setFlags(flags, false); } + /** @return true if new area is set */ public boolean isStart() { return ((this.flags & NEW_AREA) != 0); } + /** @return true if new area is set and leading space is non-null */ public boolean startsNewArea() { return ((this.flags & NEW_AREA) != 0 && leadingSpace != null); } + /** @return true if first area is set */ public boolean isFirstArea() { return ((this.flags & FIRST_AREA) != 0); } + /** @return true if last area is set */ public boolean isLastArea() { return ((this.flags & LAST_AREA) != 0); } + /** @return true if suppress break before is set */ public boolean suppressBreakBefore() { return ((this.flags & SUPPRESS_BREAK_BEFORE) != 0); } @@ -293,22 +308,27 @@ public class LayoutContext { return !getKeepWithPreviousPending().isAuto(); } + /** @param space leading space */ public void setLeadingSpace(SpaceSpecifier space) { leadingSpace = space; } + /** @return leading space */ public SpaceSpecifier getLeadingSpace() { return leadingSpace; } + /** @return true if resolve leading space is set */ public boolean resolveLeadingSpace() { return ((this.flags & RESOLVE_LEADING_SPACE) != 0); } + /** @param space trailing space */ public void setTrailingSpace(SpaceSpecifier space) { trailingSpace = space; } + /** @return trailing space */ public SpaceSpecifier getTrailingSpace() { return trailingSpace; } @@ -389,6 +409,7 @@ public class LayoutContext { /** * Sets the inline-progression-dimension of the nearest ancestor reference area. + * @param ipd of nearest ancestor reference area */ public void setRefIPD(int ipd) { refIPD = ipd; @@ -403,14 +424,17 @@ public class LayoutContext { return refIPD; } + /** @param hyph a hyphenation context */ public void setHyphContext(HyphContext hyph) { hyphContext = hyph; } + /** @return hyphenation context */ public HyphContext getHyphContext() { return hyphContext; } + /** @return true if try hyphenate is set */ public boolean tryHyphenate() { return ((this.flags & TRY_HYPHENATE) != 0); } @@ -428,30 +452,39 @@ public class LayoutContext { return this.bpAlignment; } + /** @param adjust space adjustment */ public void setSpaceAdjust(double adjust) { dSpaceAdjust = adjust; } + /** @return space adjustment */ public double getSpaceAdjust() { return dSpaceAdjust; } + /** @param ipdA ipd adjustment */ public void setIPDAdjust(double ipdA) { ipdAdjust = ipdA; } + /** @return ipd adjustment */ public double getIPDAdjust() { return ipdAdjust; } + /** @param alignmentContext alignment context */ public void setAlignmentContext(AlignmentContext alignmentContext) { this.alignmentContext = alignmentContext; } + /** @return alignment context */ public AlignmentContext getAlignmentContext() { return this.alignmentContext; } + /** + * Reset alignment context. + */ public void resetAlignmentContext() { if (this.alignmentContext != null) { this.alignmentContext = this.alignmentContext.getParentAlignmentContext(); diff --git a/src/java/org/apache/fop/layoutmgr/LayoutException.java b/src/java/org/apache/fop/layoutmgr/LayoutException.java index 822607020..280266003 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutException.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutException.java @@ -29,7 +29,7 @@ import org.apache.fop.events.EventExceptionManager.ExceptionFactory; * Exception thrown by FOP if an unrecoverable layout error occurs. An example: An area overflows * a viewport that has overflow="error-if-overflow". * - * @todo Discuss if this should become a checked exception. + * @asf.todo Discuss if this should become a checked exception. */ public class LayoutException extends RuntimeException { diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManager.java b/src/java/org/apache/fop/layoutmgr/LayoutManager.java index 454b8b366..985131bf1 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManager.java @@ -132,7 +132,7 @@ public interface LayoutManager extends PercentBaseContext { /** * Get a sequence of KnuthElements representing the content - * of the node assigned to the LM + * of the node assigned to the LM. * * @param context the LayoutContext used to store layout information * @param alignment the desired text alignment diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java index 8efe5ce65..e9e3fb6a7 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java @@ -16,6 +16,7 @@ */ /* $Id$ */ + package org.apache.fop.layoutmgr; import java.util.List; @@ -40,7 +41,7 @@ public interface LayoutManagerMaker { * @param node the FO node for which the LayoutManagers are made * @param lms the list to which the LayoutManagers are added */ - public void makeLayoutManagers(FONode node, List lms); + void makeLayoutManagers(FONode node, List lms); /** * Make a specific LayoutManager for the node. @@ -48,10 +49,8 @@ public interface LayoutManagerMaker { * an IllegalStateException is thrown. * @param node the FO node for which the LayoutManagers are made * @return The created LayoutManager - * @throws IllegalStateException if not exactly one - * LayoutManager is available for the requested node */ - public LayoutManager makeLayoutManager(FONode node); + LayoutManager makeLayoutManager(FONode node); /** * Make a PageSequenceLayoutManager object. @@ -59,7 +58,7 @@ public interface LayoutManagerMaker { * @param ps the fo:page-sequence object this PSLM will process * @return The created PageSequenceLayoutManager object */ - public PageSequenceLayoutManager makePageSequenceLayoutManager( + PageSequenceLayoutManager makePageSequenceLayoutManager( AreaTreeHandler ath, PageSequence ps); /** @@ -68,7 +67,7 @@ public interface LayoutManagerMaker { * @param ed the fox:external-document object to be processed * @return The created ExternalDocumentLayoutManager object */ - public ExternalDocumentLayoutManager makeExternalDocumentLayoutManager( + ExternalDocumentLayoutManager makeExternalDocumentLayoutManager( AreaTreeHandler ath, ExternalDocument ed); /** @@ -77,7 +76,7 @@ public interface LayoutManagerMaker { * @param flow the fo:flow object this FLM will process * @return The created FlowLayoutManager object */ - public FlowLayoutManager makeFlowLayoutManager( + FlowLayoutManager makeFlowLayoutManager( PageSequenceLayoutManager pslm, Flow flow); /** @@ -86,7 +85,7 @@ public interface LayoutManagerMaker { * @param title the fo:title object this CLM will process * @return The created ContentLayoutManager object */ - public ContentLayoutManager makeContentLayoutManager( + ContentLayoutManager makeContentLayoutManager( PageSequenceLayoutManager pslm, Title title); /** @@ -97,7 +96,7 @@ public interface LayoutManagerMaker { * needs to be processed. * @return The created StaticContentLayoutManager object */ - public StaticContentLayoutManager makeStaticContentLayoutManager( + StaticContentLayoutManager makeStaticContentLayoutManager( PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg); /** @@ -107,7 +106,7 @@ public interface LayoutManagerMaker { * @param block the Block area this SCLM must add its areas to * @return The created StaticContentLayoutManager object */ - public StaticContentLayoutManager makeStaticContentLayoutManager( + StaticContentLayoutManager makeStaticContentLayoutManager( PageSequenceLayoutManager pslm, StaticContent sc, Block block); } diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java index cab2dd0ba..1a31f8d49 100644 --- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java +++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java @@ -93,11 +93,13 @@ import org.apache.fop.util.CharUtilities; public class LayoutManagerMapping implements LayoutManagerMaker { /** logging instance */ - protected static Log log = LogFactory.getLog(LayoutManagerMapping.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(LayoutManagerMapping.class); /** The map of LayoutManagerMakers */ private Map makers = new HashMap(); + /** default constructor */ public LayoutManagerMapping() { initialize(); } @@ -152,9 +154,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker { makers.put(clazz, maker); } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public void makeLayoutManagers(FONode node, List lms) { Maker maker = (Maker) makers.get(node.getClass()); if (maker == null) { @@ -170,9 +170,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public LayoutManager makeLayoutManager(FONode node) { List lms = new ArrayList(); makeLayoutManagers(node, lms); @@ -188,30 +186,31 @@ public class LayoutManagerMapping implements LayoutManagerMaker { return (LayoutManager) lms.get(0); } + /** {@inheritDoc} */ public PageSequenceLayoutManager makePageSequenceLayoutManager( AreaTreeHandler ath, PageSequence ps) { return new PageSequenceLayoutManager(ath, ps); } - /* - * {@inheritDoc} - */ + /** {@inheritDoc} */ + public ExternalDocumentLayoutManager makeExternalDocumentLayoutManager( + AreaTreeHandler ath, ExternalDocument ed) { + return new ExternalDocumentLayoutManager(ath, ed); + } + + /** {@inheritDoc} */ public FlowLayoutManager makeFlowLayoutManager( PageSequenceLayoutManager pslm, Flow flow) { return new FlowLayoutManager(pslm, flow); } - /* - * {@inheritDoc} - */ + /** {@inheritDoc} */ public ContentLayoutManager makeContentLayoutManager(PageSequenceLayoutManager pslm, Title title) { return new ContentLayoutManager(pslm, title); } - /* - * {@inheritDoc} - */ + /** {@inheritDoc} */ public StaticContentLayoutManager makeStaticContentLayoutManager( PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg) { return new StaticContentLayoutManager(pslm, sc, reg); @@ -223,13 +222,21 @@ public class LayoutManagerMapping implements LayoutManagerMaker { return new StaticContentLayoutManager(pslm, sc, block); } + /** a layout manager maker base class */ public static class Maker { + /** + * Create a layout manager. + * @param node the associated FO node + * @param lms a list of layout managers to which new manager is to be added + */ public void make(FONode node, List lms) { // no layout manager } } + /** a layout manager maker */ public static class FOTextLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { FOText foText = (FOText) node; if (foText.length() > 0) { @@ -238,9 +245,11 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } + /** a layout manager maker */ public static class BidiOverrideLayoutManagerMaker extends Maker { - // public static class BidiOverrideLayoutManagerMaker extends FObjMixedLayoutManagerMaker { - public void make(BidiOverride node, List lms) { + /** {@inheritDoc} */ + public void make(FONode node, List lms) { + /* [GA] remove broken code if (false) { // this is broken; it does nothing // it should make something like an InlineStackingLM @@ -254,29 +263,36 @@ public class LayoutManagerMapping implements LayoutManagerMaker { LayoutManager lm = (LayoutManager) childList.get(count); if (lm instanceof InlineLevelLayoutManager) { LayoutManager blm = new BidiLayoutManager - (node, (InlineLayoutManager) lm); + ((BidiOverride) node, (InlineLayoutManager) lm); lms.add(blm); } else { lms.add(lm); } } } + */ } } + /** a layout manager maker */ public static class InlineLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new InlineLayoutManager((InlineLevel) node)); } } + /** a layout manager maker */ public static class FootnodeLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new FootnoteLayoutManager((Footnote) node)); } } + /** a layout manager maker */ public static class InlineContainerLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { ArrayList childList = new ArrayList(); super.make(node, childList); @@ -284,25 +300,33 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } + /** a layout manager maker */ public static class BasicLinkLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new BasicLinkLayoutManager((BasicLink) node)); } } + /** a layout manager maker */ public static class BlockLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new BlockLayoutManager((Block) node)); } } + /** a layout manager maker */ public static class LeaderLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new LeaderLayoutManager((Leader) node)); } } + /** a layout manager maker */ public static class CharacterLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { Character foCharacter = (Character) node; if (foCharacter.getCharacter() != CharUtilities.CODE_EOT) { @@ -311,7 +335,9 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } + /** a layout manager maker */ public static class ExternalGraphicLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { ExternalGraphic eg = (ExternalGraphic) node; if (!eg.getSrc().equals("")) { @@ -320,49 +346,65 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } + /** a layout manager maker */ public static class BlockContainerLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new BlockContainerLayoutManager((BlockContainer) node)); } } + /** a layout manager maker */ public static class ListItemLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new ListItemLayoutManager((ListItem) node)); } } + /** a layout manager maker */ public static class ListBlockLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new ListBlockLayoutManager((ListBlock) node)); } } + /** a layout manager maker */ public static class InstreamForeignObjectLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new InstreamForeignObjectLM((InstreamForeignObject) node)); } } + /** a layout manager maker */ public static class PageNumberLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new PageNumberLayoutManager((PageNumber) node)); } } + /** a layout manager maker */ public static class PageNumberCitationLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new PageNumberCitationLayoutManager((PageNumberCitation) node)); } } + /** a layout manager maker */ public static class PageNumberCitationLastLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { lms.add(new PageNumberCitationLastLayoutManager((PageNumberCitationLast) node)); } } + /** a layout manager maker */ public static class TableLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { Table table = (Table) node; TableLayoutManager tlm = new TableLayoutManager(table); @@ -370,7 +412,9 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } + /** a layout manager maker */ public class RetrieveMarkerLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { Iterator baseIter; baseIter = node.getChildNodes(); @@ -384,7 +428,9 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } + /** a layout manager maker */ public class WrapperLayoutManagerMaker extends Maker { + /** {@inheritDoc} */ public void make(FONode node, List lms) { //We insert the wrapper LM before it's children so an ID //on the node can be registered on a page. @@ -401,9 +447,4 @@ public class LayoutManagerMapping implements LayoutManagerMaker { } } - public ExternalDocumentLayoutManager makeExternalDocumentLayoutManager( - AreaTreeHandler ath, ExternalDocument ed) { - return new ExternalDocumentLayoutManager(ath, ed); - } - } diff --git a/src/java/org/apache/fop/layoutmgr/LeafPosition.java b/src/java/org/apache/fop/layoutmgr/LeafPosition.java index e1d5b2aaa..61ebfc5e7 100644 --- a/src/java/org/apache/fop/layoutmgr/LeafPosition.java +++ b/src/java/org/apache/fop/layoutmgr/LeafPosition.java @@ -19,24 +19,38 @@ package org.apache.fop.layoutmgr; +/** A leaf position. */ public class LeafPosition extends Position { private int leafPos; + /** + * Construct a leaf position. + * @param layoutManager the associated layout manager + * @param pos the leaf position + */ public LeafPosition(LayoutManager layoutManager, int pos) { super(layoutManager); leafPos = pos; } + /** + * Construct a leaf position. + * @param layoutManager the associated layout manager + * @param pos the leaf position + * @param index the index + */ public LeafPosition(LayoutManager layoutManager, int pos, int index) { super(layoutManager, index); leafPos = pos; } + /** @return leaf position */ public int getLeafPos() { return leafPos; } + /** {@inheritDoc} */ public boolean generatesAreas() { return getLM() != null; } diff --git a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java index 7089dabda..42908262f 100644 --- a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java +++ b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java @@ -19,19 +19,27 @@ package org.apache.fop.layoutmgr; +/** A non-leaf position. */ public class NonLeafPosition extends Position { private Position subPos; + /** + * Construct a leaf position. + * @param lm the associated layout manager + * @param sub the position + */ public NonLeafPosition(LayoutManager lm, Position sub) { super(lm); subPos = sub; } + /** @return the sub position */ public Position getPosition() { return subPos; } + /** {@inheritDoc} */ public boolean generatesAreas() { return (subPos != null ? subPos.generatesAreas() : false); } diff --git a/src/java/org/apache/fop/layoutmgr/PageBreaker.java b/src/java/org/apache/fop/layoutmgr/PageBreaker.java index 25ecd5a75..171b3fd4f 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreaker.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreaker.java @@ -54,6 +54,10 @@ public class PageBreaker extends AbstractBreaker { private StaticContentLayoutManager footnoteSeparatorLM = null; + /** + * Construct page breaker. + * @param pslm the page sequence layout manager + */ public PageBreaker(PageSequenceLayoutManager pslm) { this.pslm = pslm; this.pageProvider = pslm.getPageProvider(); @@ -382,7 +386,8 @@ public class PageBreaker extends AbstractBreaker { + " pageBreaks.size()= " + algRestart.getPageBreaks().size()); boolean fitsOnePage - = optimalPageCount <= pslm.getCurrentPV().getBodyRegion().getMainReference().getCurrentSpan().getColumnCount(); + = optimalPageCount <= pslm.getCurrentPV() + .getBodyRegion().getMainReference().getCurrentSpan().getColumnCount(); if (needColumnBalancing) { if (!fitsOnePage) { @@ -411,6 +416,7 @@ public class PageBreaker extends AbstractBreaker { addAreas(algRestart, optimalPageCount, originalList, effectiveList); } + /** {@inheritDoc} */ protected void startPart(BlockSequence list, int breakClass) { AbstractBreaker.log.debug("startPart() breakClass=" + getBreakClassName(breakClass)); if (pslm.getCurrentPage() == null) { @@ -442,6 +448,7 @@ public class PageBreaker extends AbstractBreaker { pslm.getCurrentPV().getPage().fakeNonEmpty(); } + /** {@inheritDoc} */ protected void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp) { // add footnote areas if (pbp.footnoteFirstListIndex < pbp.footnoteLastListIndex @@ -473,7 +480,7 @@ public class PageBreaker extends AbstractBreaker { pslm.getCurrentPV().getCurrentSpan().notifyFlowsFinished(); } - /** @return the current child flow layout manager */ + /** {@inheritDoc} */ protected LayoutManager getCurrentChildLM() { return childFLM; } @@ -546,7 +553,8 @@ public class PageBreaker extends AbstractBreaker { * @param breakVal - value of break-before or break-after trait. */ private boolean needBlankPageBeforeNew(int breakVal) { - if (breakVal == Constants.EN_PAGE || (pslm.getCurrentPage().getPageViewport().getPage().isEmpty())) { + if (breakVal == Constants.EN_PAGE + || (pslm.getCurrentPage().getPageViewport().getPage().isEmpty())) { // any page is OK or we already have an empty page return false; } else { diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index 8f60e51b7..e0b0cae11 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -103,8 +103,26 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { private int currentKeepContext = Constants.EN_AUTO; private KnuthNode lastBeforeKeepContextSwitch; - - public PageBreakingAlgorithm(LayoutManager topLevelLM, + /** + * Construct a page breaking algorithm. + * @param topLevelLM the top level layout manager + * @param pageProvider the page provider + * @param layoutListener the layout listener + * @param alignment alignment of the paragraph/page. One of {@link Constants#EN_START}, + * {@link Constants#EN_JUSTIFY}, {@link Constants#EN_CENTER}, + * {@link Constants#EN_END}. + * For pages, {@link Constants#EN_BEFORE} and {@link Constants#EN_AFTER} + * are mapped to the corresponding inline properties, + * {@link Constants#EN_START} and {@link Constants#EN_END}. + * @param alignmentLast alignment of the paragraph's last line + * @param footnoteSeparatorLength length of footnote separator + * @param partOverflowRecovery {@code true} if too long elements should be moved to + * the next line/part + * @param autoHeight true if auto height + * @param favorSinglePart true if favoring single part + * @see BreakingAlgorithm + */ + public PageBreakingAlgorithm(LayoutManager topLevelLM, // CSOK: ParameterNumber PageProvider pageProvider, PageBreakingLayoutListener layoutListener, int alignment, int alignmentLast, @@ -128,15 +146,16 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { protected class KnuthPageNode extends KnuthNode { /** Additional length due to footnotes. */ - public int totalFootnotes; + public int totalFootnotes; // CSOK: VisibilityModifier /** Index of the last inserted footnote. */ - public int footnoteListIndex; + public int footnoteListIndex; // CSOK: VisibilityModifier /** Index of the last inserted element of the last inserted footnote. */ - public int footnoteElementIndex; + public int footnoteElementIndex; // CSOK: VisibilityModifier - public KnuthPageNode(int position, int line, int fitness, + public KnuthPageNode(int position, // CSOK: ParameterNumber + int line, int fitness, int totalWidth, int totalStretch, int totalShrink, int totalFootnotes, int footnoteListIndex, int footnoteElementIndex, double adjustRatio, int availableShrink, int availableStretch, @@ -206,7 +225,8 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { log.debug("Recovering from too long: " + lastTooLong); log.debug("\tlastTooShort = " + getLastTooShort()); log.debug("\tlastBeforeKeepContextSwitch = " + lastBeforeKeepContextSwitch); - log.debug("\tcurrentKeepContext = " + AbstractBreaker.getBreakClassName(currentKeepContext)); + log.debug("\tcurrentKeepContext = " + + AbstractBreaker.getBreakClassName(currentKeepContext)); } if (lastBeforeKeepContextSwitch == null @@ -261,7 +281,8 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { } /** {@inheritDoc} */ - protected KnuthNode createNode(int position, int line, int fitness, + protected KnuthNode createNode(int position, // CSOK: ParameterNumber + int line, int fitness, int totalWidth, int totalStretch, int totalShrink, double adjustRatio, int availableShrink, int availableStretch, int difference, double totalDemerits, KnuthNode previous) { @@ -473,7 +494,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { KnuthPageNode pageNode = (KnuthPageNode) activeNode; int actualWidth = totalWidth - pageNode.totalWidth; int footnoteSplit = 0; - boolean canDeferOldFootnotes; + boolean canDeferOldFN; if (element.isPenalty()) { actualWidth += element.getWidth(); } @@ -492,11 +513,12 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { footnoteListIndex = footnotesList.size() - 1; footnoteElementIndex = getFootnoteList(footnoteListIndex).size() - 1; - } else if (((canDeferOldFootnotes - = checkCanDeferOldFootnotes(pageNode, elementIndex)) + } else if (((canDeferOldFN = canDeferOldFootnotes // CSOK: InnerAssignment + (pageNode, elementIndex)) || newFootnotes) - && (footnoteSplit = getFootnoteSplit(pageNode, - getLineWidth(activeNode.line) - actualWidth, canDeferOldFootnotes)) > 0) { + && (footnoteSplit = getFootnoteSplit // CSOK: InnerAssignment + (pageNode, getLineWidth(activeNode.line) - actualWidth, + canDeferOldFN)) > 0) { // it is allowed to break or even defer footnotes if either: // - there are new footnotes in the last piece of content, and // there is space to add at least a piece of the first one @@ -541,7 +563,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { * @param contentElementIndex index of the Knuth element considered for the * current page break */ - private boolean checkCanDeferOldFootnotes(KnuthPageNode node, int contentElementIndex) { + private boolean canDeferOldFootnotes(KnuthPageNode node, int contentElementIndex) { return (noBreakBetween(node.position, contentElementIndex) && deferredFootnotes(node.footnoteListIndex, node.footnoteElementIndex, node.totalFootnotes)); @@ -584,7 +606,8 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { index++) { if (par.getElement(index).isGlue() && par.getElement(index - 1).isBox() || par.getElement(index).isPenalty() - && ((KnuthElement) par.getElement(index)).getPenalty() < KnuthElement.INFINITE) { + && ((KnuthElement) par + .getElement(index)).getPenalty() < KnuthElement.INFINITE) { // break found break; } @@ -865,8 +888,9 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { insertedFootnotesLength = tmpLength; footnoteElementIndex = getFootnoteList(footnoteListIndex).size() - 1; - } else if ((split = getFootnoteSplit(footnoteListIndex, footnoteElementIndex, - insertedFootnotesLength, availableBPD, true)) > 0) { + } else if ((split = getFootnoteSplit // CSOK: InnerAssignment + (footnoteListIndex, footnoteElementIndex, + insertedFootnotesLength, availableBPD, true)) > 0) { // add a piece of a footnote availableBPD -= split; insertedFootnotesLength += split; @@ -1101,7 +1125,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { */ protected void addNode(int line, KnuthNode node) { if (node.position < par.size() - 1 && line > 0 - && (ipdDifference = compareIPDs(line - 1)) != 0) { + && (ipdDifference = compareIPDs(line - 1)) != 0) { // CSOK: InnerAssignment log.trace("IPD changes at page " + line); if (bestNodeForIPDChange == null || node.totalDemerits < bestNodeForIPDChange.totalDemerits) { diff --git a/src/java/org/apache/fop/layoutmgr/Position.java b/src/java/org/apache/fop/layoutmgr/Position.java index 10ad5878e..5cf6a893f 100644 --- a/src/java/org/apache/fop/layoutmgr/Position.java +++ b/src/java/org/apache/fop/layoutmgr/Position.java @@ -19,20 +19,30 @@ package org.apache.fop.layoutmgr; +/** A position. */ public class Position { private LayoutManager layoutManager; private int index = -1; + /** + * Construct a position. + * @param lm the associated layout manager + */ public Position(LayoutManager lm) { layoutManager = lm; } + /** + * Construct a position. + * @param lm the associated layout manager + * @param index the index + */ public Position(LayoutManager lm, int index) { this(lm); setIndex(index); } - + /** @return associated layout manager */ public LayoutManager getLM() { return layoutManager; } @@ -40,11 +50,13 @@ public class Position { /** * Overridden by NonLeafPosition to return the Position of its * child LM. + * @return a position or null */ public Position getPosition() { return null; } + /** @return true if generates areas */ public boolean generatesAreas() { return false; } @@ -67,12 +79,13 @@ public class Position { return this.index; } - public String getShortLMName() { + /** @return short name of associated layout manager */ + protected String getShortLMName() { if (getLM() != null) { String lm = getLM().toString(); int idx = lm.lastIndexOf('.'); if (idx >= 0 && lm.indexOf('@') > 0) { - return(lm.substring(idx + 1)); + return lm.substring(idx + 1); } else { return lm; } diff --git a/src/java/org/apache/fop/layoutmgr/PositionIterator.java b/src/java/org/apache/fop/layoutmgr/PositionIterator.java index b50035313..63ff8461a 100644 --- a/src/java/org/apache/fop/layoutmgr/PositionIterator.java +++ b/src/java/org/apache/fop/layoutmgr/PositionIterator.java @@ -22,6 +22,7 @@ package org.apache.fop.layoutmgr; import java.util.Iterator; import java.util.NoSuchElementException; +/** A position iterator. */ public abstract class PositionIterator implements Iterator { private Iterator parentIter; @@ -29,12 +30,17 @@ public abstract class PositionIterator implements Iterator { private LayoutManager childLM; private boolean bHasNext; + /** + * Construct position iterator. + * @param pIter an iterator to use as parent + */ protected PositionIterator(Iterator pIter) { parentIter = pIter; lookAhead(); //checkNext(); } + /** @return layout manager of next child layout manager or null */ public LayoutManager getNextChildLM() { // Move to next "segment" of iterator, ie: new childLM if (childLM == null && nextObj != null) { @@ -44,8 +50,16 @@ public abstract class PositionIterator implements Iterator { return childLM; } + /** + * @param nextObj next object from which to obtain position + * @return layout manager + */ protected abstract LayoutManager getLM(Object nextObj); + /** + * @param nextObj next object from which to obtain position + * @return position of next object + */ protected abstract Position getPos(Object nextObj); private void lookAhead() { @@ -57,6 +71,7 @@ public abstract class PositionIterator implements Iterator { } } + /** @return true if not at end of sub-sequence with same child layout manager */ protected boolean checkNext() { LayoutManager lm = getLM(nextObj); if (childLM == null) { @@ -70,17 +85,20 @@ public abstract class PositionIterator implements Iterator { return true; } + /** end (reset) iterator */ protected void endIter() { bHasNext = false; nextObj = null; childLM = null; } + /** {@inheritDoc} */ public boolean hasNext() { return (bHasNext && checkNext()); } + /** {@inheritDoc} */ public Object next() throws NoSuchElementException { if (bHasNext) { Object retObj = getPos(nextObj); @@ -91,10 +109,12 @@ public abstract class PositionIterator implements Iterator { } } + /** @return peek at next object */ public Object peekNext() { return nextObj; } + /** {@inheritDoc} */ public void remove() throws UnsupportedOperationException { throw new UnsupportedOperationException("PositionIterator doesn't support remove"); } diff --git a/src/java/org/apache/fop/layoutmgr/SpaceResolver.java b/src/java/org/apache/fop/layoutmgr/SpaceResolver.java index 6dbf107f3..c49bb2d9a 100644 --- a/src/java/org/apache/fop/layoutmgr/SpaceResolver.java +++ b/src/java/org/apache/fop/layoutmgr/SpaceResolver.java @@ -32,10 +32,11 @@ import org.apache.fop.traits.MinOptMax; * UnresolvedListElements descendants by the right combination of KnuthElements on an element * list. */ -public class SpaceResolver { +public final class SpaceResolver { /** Logger instance */ - protected static Log log = LogFactory.getLog(SpaceResolver.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(SpaceResolver.class); private UnresolvedListElementWithLength[] firstPart; private BreakElement breakPoss; @@ -439,7 +440,8 @@ public class SpaceResolver { } // No break - // TODO: We can't use a MinOptMax for glue2, because min <= opt <= max is not always true - why? + // TODO: We can't use a MinOptMax for glue2, + // because min <= opt <= max is not always true - why? MinOptMax noBreakLength = sum(noBreakLengths); MinOptMax spaceSum = spaceBeforeBreak.plus(spaceAfterBreak); int glue2width = noBreakLength.getOpt() - spaceSum.getOpt(); @@ -543,6 +545,7 @@ public class SpaceResolver { return this.originalPosition; } + /** {@inheritDoc} */ public Position getPosition() { return originalPosition; } diff --git a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java index 140d90bb8..83a67b101 100644 --- a/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java +++ b/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java @@ -155,6 +155,7 @@ public class SpaceSpecifier implements Cloneable { return resolvedSpace; } + /** {@inheritDoc} */ public String toString() { return "Space Specifier (resolved at begin/end of ref. area:):\n" + resolve(false) + "\n" + resolve(true); diff --git a/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java b/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java index 72fddf199..2091484a4 100644 --- a/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java @@ -33,18 +33,18 @@ public interface TopLevelLayoutManager { * page sequence will be created and sent to the AreaTreeModel * for rendering. */ - public void activateLayout(); + void activateLayout(); /** * Act upon the force-page-count trait, * in relation to the initial-page-number trait of the following page-sequence. * @param nextPageSeqInitialPageNumber initial-page-number trait of next page-sequence */ - public void doForcePageCount(Numeric nextPageSeqInitialPageNumber); + void doForcePageCount(Numeric nextPageSeqInitialPageNumber); /** * Finished the page-sequence and notifies everyone about it. */ - public void finishPageSequence(); + void finishPageSequence(); }
\ No newline at end of file diff --git a/src/java/org/apache/fop/layoutmgr/TraitSetter.java b/src/java/org/apache/fop/layoutmgr/TraitSetter.java index 911b6dcc6..800850177 100644 --- a/src/java/org/apache/fop/layoutmgr/TraitSetter.java +++ b/src/java/org/apache/fop/layoutmgr/TraitSetter.java @@ -39,10 +39,14 @@ import org.apache.fop.traits.MinOptMax; /** * This is a helper class used for setting common traits on areas. */ -public class TraitSetter { +public final class TraitSetter { + + private TraitSetter() { + } /** logger */ - protected static Log log = LogFactory.getLog(TraitSetter.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(TraitSetter.class); /** * Sets border and padding traits on areas. diff --git a/src/java/org/apache/fop/layoutmgr/inline/AlignmentContext.java b/src/java/org/apache/fop/layoutmgr/inline/AlignmentContext.java index efe006d14..07d153eed 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/AlignmentContext.java +++ b/src/java/org/apache/fop/layoutmgr/inline/AlignmentContext.java @@ -237,6 +237,8 @@ public class AlignmentContext implements Constants { case EN_MATHEMATICAL: this.alignmentBaselineIdentifier = alignmentBaseline; break; + default: + break; } } @@ -330,6 +332,9 @@ public class AlignmentContext implements Constants { , LengthBase.CUSTOM_BASE , parentAlignmentContext.getLineHeight())); break; + default: + break; + } } @@ -353,10 +358,12 @@ public class AlignmentContext implements Constants { return parentAlignmentContext.getScaledBaselineTable() .getBaseline(alignmentBaselineIdentifier) - scaledBaselineTable - .deriveScaledBaselineTable(parentAlignmentContext.getDominantBaselineIdentifier()) + .deriveScaledBaselineTable(parentAlignmentContext + .getDominantBaselineIdentifier()) .getBaseline(alignmentBaselineIdentifier) - scaledBaselineTable - .getBaseline(parentAlignmentContext.getDominantBaselineIdentifier()) + .getBaseline(parentAlignmentContext + .getDominantBaselineIdentifier()) + baselineShiftValue; } diff --git a/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java b/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java index 73f414bf7..f2664ed1c 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java +++ b/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java @@ -96,39 +96,44 @@ public class BasicScaledBaselineTable implements ScaledBaselineTable, Constants * @return the baseline offset */ public int getBaseline(int baselineIdentifier) { - int offset = 0; + int offset; if (!isHorizontalWritingMode()) { switch (baselineIdentifier) { + default: case EN_TOP: case EN_TEXT_TOP: case EN_TEXT_BOTTOM: case EN_BOTTOM: log.warn("The given baseline is only supported for horizontal" + " writing modes"); - return 0; + offset = 0; + } + } else { + switch (baselineIdentifier) { + case EN_TOP: // fall through + case EN_BEFORE_EDGE: + offset = beforeEdgeOffset; + break; + case EN_TEXT_TOP: + case EN_TEXT_BEFORE_EDGE: + case EN_HANGING: + case EN_CENTRAL: + case EN_MIDDLE: + case EN_MATHEMATICAL: + case EN_ALPHABETIC: + case EN_IDEOGRAPHIC: + case EN_TEXT_BOTTOM: + case EN_TEXT_AFTER_EDGE: + offset = getBaselineDefaultOffset(baselineIdentifier) - dominantBaselineOffset; + break; + case EN_BOTTOM: // fall through + case EN_AFTER_EDGE: + offset = afterEdgeOffset; + break; + default: + offset = 0; + break; } - } - switch (baselineIdentifier) { - case EN_TOP: // fall through - case EN_BEFORE_EDGE: - offset = beforeEdgeOffset; - break; - case EN_TEXT_TOP: - case EN_TEXT_BEFORE_EDGE: - case EN_HANGING: - case EN_CENTRAL: - case EN_MIDDLE: - case EN_MATHEMATICAL: - case EN_ALPHABETIC: - case EN_IDEOGRAPHIC: - case EN_TEXT_BOTTOM: - case EN_TEXT_AFTER_EDGE: - offset = getBaselineDefaultOffset(baselineIdentifier) - dominantBaselineOffset; - break; - case EN_BOTTOM: // fall through - case EN_AFTER_EDGE: - offset = afterEdgeOffset; - break; } return offset; } @@ -168,6 +173,8 @@ public class BasicScaledBaselineTable implements ScaledBaselineTable, Constants case EN_TEXT_AFTER_EDGE: offset = depth; break; + default: + break; } return offset; } diff --git a/src/java/org/apache/fop/layoutmgr/inline/BidiLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/BidiLayoutManager.java index d5b2e5803..f342399fc 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/BidiLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/BidiLayoutManager.java @@ -35,6 +35,11 @@ public class BidiLayoutManager extends LeafNodeLayoutManager { private List children; + /** + * Construct bidi layout manager. + * @param node bidi override FO + * @param cLM parent layout manager + */ public BidiLayoutManager(BidiOverride node, InlineLayoutManager cLM) { super(node); setParent(cLM); @@ -53,10 +58,15 @@ public class BidiLayoutManager extends LeafNodeLayoutManager { */ } + /** @return number of children */ public int size() { return children.size(); } + /** + * @param index of child inline area + * @return a child inline area + */ public InlineArea get(int index) { return (InlineArea) children.get(index); } diff --git a/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java index a19680f51..ed22886a4 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java @@ -207,7 +207,8 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager { new LeafPosition(this, -1), true)); returnList.add(new KnuthGlue(letterSpaceIPD.mult(areaInfo.iLScount), new LeafPosition(this, -1), true)); - returnList.add(new KnuthInlineBox(0, null, notifyPos(new LeafPosition(this, -1)), true)); + returnList.add + (new KnuthInlineBox(0, null, notifyPos(new LeafPosition(this, -1)), true)); if (areaInfo.bHyphenated) { returnList.add(new KnuthPenalty(hyphIPD, KnuthPenalty.FLAGGED_PENALTY, true, new LeafPosition(this, -1), false)); diff --git a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java index d0dcc2bb8..598a641d5 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java @@ -67,6 +67,7 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager * Constructs a new ContentLayoutManager * * @param area The parent area + * @param parentLM the parent layout manager */ public ContentLayoutManager(Area area, LayoutManager parentLM) { holder = area; @@ -100,11 +101,12 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager } } + /** {@inheritDoc} */ public void initialize() { // Empty } - public void fillArea(LayoutManager curLM) { + private void fillArea(LayoutManager curLM) { int ipd = 1000000; @@ -150,6 +152,7 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager curLM.addAreas(contentPosIter, lc); } + /** {@inheritDoc} */ public void addAreas(PositionIterator posIter, LayoutContext context) { // add the content areas // the area width has already been adjusted, and it must remain unchanged @@ -163,6 +166,7 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager ((InlineArea)holder).setIPD(savedIPD); } + /** @return stack size */ public int getStackingSize() { return stackSize; } @@ -248,6 +252,7 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager } } + /** {@inheritDoc} */ public List getNextKnuthElements(LayoutContext context, int alignment) { List contentList = new LinkedList(); List returnedList; @@ -264,7 +269,7 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager Object obj = returnedList.remove(0); if (obj instanceof KnuthSequence) { KnuthSequence ks = (KnuthSequence)obj; - for (Iterator it = ks.iterator(); it.hasNext(); ) { + for (Iterator it = ks.iterator(); it.hasNext();) { contentElement = (KnuthElement)it.next(); stackSize += contentElement.getWidth(); contentList.add(contentElement); @@ -282,6 +287,7 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager return contentList; } + /** {@inheritDoc} */ public List addALetterSpaceTo(List oldList) { return oldList; } @@ -296,23 +302,28 @@ public class ContentLayoutManager extends AbstractBaseLayoutManager log.warn(this.getClass().getName() + " should not receive a call to removeWordSpace(list)"); } + /** {@inheritDoc} */ public String getWordChars(Position pos) { return ""; } + /** {@inheritDoc} */ public void hyphenate(Position pos, HyphContext hc) { } + /** {@inheritDoc} */ public boolean applyChanges(List oldList) { return false; } + /** {@inheritDoc} */ public List getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/ int alignment) { return null; } + /** {@inheritDoc} */ public PageSequenceLayoutManager getPSLM() { return parentLM.getPSLM(); } diff --git a/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java b/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java index 881608e08..ffc57fa16 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java +++ b/src/java/org/apache/fop/layoutmgr/inline/HyphContext.java @@ -32,10 +32,14 @@ public class HyphContext { private int currentOffset = 0; private int currentIndex = 0; + /** + * @param hyphPoints number of hyphenation points + */ public HyphContext(int[] hyphPoints) { this.hyphPoints = hyphPoints; } + /** @return next hyphenation point */ public int getNextHyphPoint() { for (; currentIndex < hyphPoints.length; currentIndex++) { if (hyphPoints[currentIndex] > currentOffset) { @@ -45,6 +49,7 @@ public class HyphContext { return -1; // AT END! } + /** @return true if more hyphenation points */ public boolean hasMoreHyphPoints() { for (; currentIndex < hyphPoints.length; currentIndex++) { if (hyphPoints[currentIndex] > currentOffset) { @@ -54,6 +59,7 @@ public class HyphContext { return false; } + /** @param iCharsProcessed amount to extend offset */ public void updateOffset(int iCharsProcessed) { currentOffset += iCharsProcessed; } diff --git a/src/java/org/apache/fop/layoutmgr/inline/ICLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/ICLayoutManager.java index c47a7e682..7fe90f63c 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ICLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ICLayoutManager.java @@ -33,11 +33,20 @@ import org.apache.fop.fo.flow.InlineContainer; public class ICLayoutManager extends LeafNodeLayoutManager { private List childrenLM; + /** + * Construct inline container layout manager. + * @param node inline container FO node + * @param childLM child layout manager + */ public ICLayoutManager(InlineContainer node, List childLM) { super(node); childrenLM = childLM; } + /** + * @param index an integer + * @return an inline area or null + */ public InlineArea get(int index) { return null; } diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java index 26f8e3b97..82285d106 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java @@ -239,7 +239,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { } /** {@inheritDoc} */ - public List getNextKnuthElements(LayoutContext context, int alignment) { + public List getNextKnuthElements // CSOK: MethodLength + (LayoutContext context, int alignment) { LayoutManager curLM; // the list returned by child LM @@ -434,7 +435,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { // layout context given to the other LMs. List positionList = new LinkedList(); NonLeafPosition pos; - LayoutManager lastLM = null;// last child LM in this iterator + LayoutManager lastLM = null; // last child LM in this iterator Position lastPos = null; while (parentIter.hasNext()) { pos = (NonLeafPosition) parentIter.next(); @@ -553,13 +554,13 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { if (returnList instanceof BlockKnuthSequence) { return; } - CommonBorderPaddingBackground borderAndPadding = - ((InlineLevel)fobj).getCommonBorderPaddingBackground(); + CommonBorderPaddingBackground borderAndPadding + = ((InlineLevel)fobj).getCommonBorderPaddingBackground(); if (borderAndPadding != null) { int ipStart = borderAndPadding.getBorderStartWidth(false) + borderAndPadding.getPaddingStart(false, this); if (ipStart > 0) { - returnList.add(0,new KnuthBox(ipStart, getAuxiliaryPosition(), true)); + returnList.add(0, new KnuthBox(ipStart, getAuxiliaryPosition(), true)); } } } @@ -578,8 +579,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { if (returnList instanceof BlockKnuthSequence) { return; } - CommonBorderPaddingBackground borderAndPadding = - ((InlineLevel)fobj).getCommonBorderPaddingBackground(); + CommonBorderPaddingBackground borderAndPadding + = ((InlineLevel)fobj).getCommonBorderPaddingBackground(); if (borderAndPadding != null) { int ipEnd = borderAndPadding.getBorderEndWidth(false) + borderAndPadding.getPaddingEnd(false, this); diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java index c9c65e769..f286fbf6c 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java @@ -32,7 +32,10 @@ public interface InlineLevelEventProducer extends EventProducer { /** * Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java index 525f0407d..11f2ea000 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java @@ -51,6 +51,7 @@ public interface InlineLevelLayoutManager extends LayoutManager { * Get the word chars corresponding to the given position. * * @param pos the position referring to the needed word chars. + * @return the word chars */ String getWordChars(Position pos); diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java index 375afb82f..4a6a59615 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java @@ -46,16 +46,27 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager implements InlineLevelLayoutManager { + /** + * A stacking iterator. + */ protected static class StackingIter extends PositionIterator { StackingIter(Iterator parentIter) { super(parentIter); } + /** + * @param nextObj the next object + * @return layout manager of next object + */ protected LayoutManager getLM(Object nextObj) { return ((Position) nextObj).getLM(); } + /** + * @param nextObj the next object + * @return position of next object + */ protected Position getPos(Object nextObj) { return ((Position) nextObj); } @@ -218,10 +229,10 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager // The last element may not have a layout manager (its position == null); // this may happen if it is a padding box; see bug 39571. - InlineLevelLayoutManager LM = - (InlineLevelLayoutManager) element.getLayoutManager(); - if (LM != null) { - oldList = LM.addALetterSpaceTo(oldList); + InlineLevelLayoutManager lm + = (InlineLevelLayoutManager) element.getLayoutManager(); + if (lm != null) { + oldList = lm.addALetterSpaceTo(oldList); } // "wrap" again the Position stored in each element of oldList oldListIterator = oldList.listIterator(); diff --git a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java index 7b08a67db..312a58fc0 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java +++ b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java @@ -23,6 +23,9 @@ import org.apache.fop.layoutmgr.FootnoteBodyLayoutManager; import org.apache.fop.layoutmgr.KnuthBox; import org.apache.fop.layoutmgr.Position; +/** + * A knuth inline box. + */ public class KnuthInlineBox extends KnuthBox { private FootnoteBodyLayoutManager footnoteBodyLM = null; @@ -36,7 +39,8 @@ public class KnuthInlineBox extends KnuthBox { * @param pos the Position stored in this box * @param auxiliary is this box auxiliary? */ - public KnuthInlineBox(int width, AlignmentContext alignmentContext, Position pos, boolean auxiliary) { + public KnuthInlineBox + (int width, AlignmentContext alignmentContext, Position pos, boolean auxiliary) { super(width, pos, auxiliary); this.alignmentContext = alignmentContext; } diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java index e74b51d96..f5a0a51f8 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java @@ -48,6 +48,7 @@ import org.apache.fop.traits.MinOptMax; * an exception to this rule.) * This class can be extended to handle the creation and adding of the * inline area. + * @asf.todo [GA] replace use of hungarian notation with normalized java naming */ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager implements InlineLevelLayoutManager { @@ -75,11 +76,22 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager * Store information about the inline area */ protected class AreaInfo { + /** letter space count */ protected short iLScount; + /** ipd of area */ protected MinOptMax ipdArea; + /** true if hyphenated */ protected boolean bHyphenated; + /** alignment context */ protected AlignmentContext alignmentContext; + /** + * Construct an area information item. + * @param iLS letter space count + * @param ipd inline progression dimension + * @param bHyph true if hyphenated + * @param alignmentContext an alignment context + */ public AreaInfo(short iLS, MinOptMax ipd, boolean bHyph, AlignmentContext alignmentContext) { iLScount = iLS; diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index 9e17a0368..7e87de241 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -132,10 +132,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager private int spaceAfter; private int baseline; - LineBreakPosition(LayoutManager lm, int index, int startIndex, int breakIndex, - int shrink, int stretch, int diff, - double ipdA, double adjust, int ind, - int lh, int lw, int sb, int sa, int bl) { + LineBreakPosition // CSOK: ParameterNumber + (LayoutManager lm, int index, int startIndex, int breakIndex, + int shrink, int stretch, int diff, double ipdA, double adjust, int ind, + int lh, int lw, int sb, int sa, int bl) { super(lm, breakIndex); availableShrink = shrink; availableStretch = stretch; @@ -204,6 +204,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager inlineLM = lm; firstIndex = index; } + InlineLevelLayoutManager getInlineLM() { + return inlineLM; + } + int getFirstIndex() { + return firstIndex; + } } // this class represents a paragraph @@ -325,11 +331,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager private int follow; private static final double MAX_DEMERITS = 10e6; - public LineBreakingAlgorithm (int pageAlign, - int textAlign, int textAlignLast, - int indent, int fillerWidth, - int lh, int ld, int fl, boolean first, - int maxFlagCount, LineLayoutManager llm) { + public LineBreakingAlgorithm // CSOK: ParameterNumber + (int pageAlign, int textAlign, int textAlignLast, int indent, int fillerWidth, + int lh, int ld, int fl, boolean first, int maxFlagCount, LineLayoutManager llm) { super(textAlign, textAlignLast, first, false, maxFlagCount); pageAlignment = pageAlign; textIndent = indent; @@ -357,7 +361,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager int textAlign = (bestActiveNode.line < total) ? alignment : alignmentLast; indent += (textAlign == Constants.EN_CENTER) ? difference / 2 : (textAlign == Constants.EN_END) ? difference : 0; - indent += (bestActiveNode.line == 1 && indentFirstPart && isFirstInBlock) ? textIndent : 0; + indent += (bestActiveNode.line == 1 && indentFirstPart && isFirstInBlock) + ? textIndent : 0; double ratio = (textAlign == Constants.EN_JUSTIFY || difference < 0 && -difference <= bestActiveNode.availableShrink) ? bestActiveNode.adjustRatio : 0; @@ -405,14 +410,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager activePossibility = -1; } - private LineBreakPosition makeLineBreakPosition(KnuthSequence par, - int firstElementIndex, - int lastElementIndex, - int availableShrink, - int availableStretch, - int difference, - double ratio, - int indent) { + private LineBreakPosition makeLineBreakPosition // CSOK: ParameterNumber + (KnuthSequence par, int firstElementIndex, int lastElementIndex, int availableShrink, + int availableStretch, int difference, double ratio, int indent) { // line height calculation - spaceBefore may differ from spaceAfter // by 1mpt due to rounding int spaceBefore = (lineHeight - lead - follow) / 2; @@ -501,7 +501,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager //log.debug("LBA.filterActiveNodes> " + activeNodeCount + " layouts"); for (int i = startLine; i < endLine; i++) { for (KnuthNode node = getNode(i); node != null; node = node.next) { - //log.debug(" + lines = " + node.line + " demerits = " + node.totalDemerits); + //log.debug(" + lines = " + //+ node.line + " demerits = " + node.totalDemerits); bestActiveNode = compareNodes(bestActiveNode, node); } } @@ -514,10 +515,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager //if (false) { if (node.line != bestActiveNode.line && node.totalDemerits > MAX_DEMERITS) { - //log.debug(" XXX lines = " + node.line + " demerits = " + node.totalDemerits); + //log.debug(" XXX lines = " + //+ node.line + " demerits = " + node.totalDemerits); removeNode(i, node); } else { - //log.debug(" ok lines = " + node.line + " demerits = " + node.totalDemerits); + //log.debug(" ok lines = " + //+ node.line + " demerits = " + node.totalDemerits); } } } @@ -592,6 +595,15 @@ public class LineLayoutManager extends InlineStackingLayoutManager return createLineBreaks(context.getBPAlignment(), context); } + /** + * Get a sequence of KnuthElements representing the content + * of the node assigned to the LM. + * @param context the LayoutContext used to store layout information + * @param alignment the desired text alignment + * @param restartPosition position at restart + * @return the list of KnuthElements + * @see LayoutManager#getNextKnuthElements(LayoutContext,int) + */ public List getNextKnuthElements(LayoutContext context, int alignment, LeafPosition restartPosition) { log.trace("Restarting line breaking from index " + restartPosition.getIndex()); @@ -705,7 +717,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager // finish last paragraph if it was closed with a linefeed if (lastElement.isPenalty() - && ((KnuthPenalty) lastElement).getPenalty() == -KnuthPenalty.INFINITE) { + && ((KnuthPenalty) lastElement).getPenalty() == -KnuthPenalty.INFINITE) { // a penalty item whose value is -inf // represents a preserved linefeed, // which forces a line break @@ -818,7 +830,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager } // now try something different - log.debug("Hyphenation possible? " + (hyphenationProperties.hyphenate.getEnum() == EN_TRUE)); + log.debug("Hyphenation possible? " + + (hyphenationProperties.hyphenate.getEnum() == EN_TRUE)); if (hyphenationProperties.hyphenate.getEnum() == EN_TRUE && !(allowedBreaks == BreakingAlgorithm.ONLY_FORCED_BREAKS)) { // consider every hyphenation point as a legal break @@ -828,9 +841,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager maxAdjustment = 5; } - if ((iBPcount - = alg.findBreakingPoints(currPar, - maxAdjustment, false, allowedBreaks)) == 0) { + iBPcount = alg.findBreakingPoints(currPar, maxAdjustment, false, allowedBreaks); + if (iBPcount == 0) { // the second try failed too, try with a huge threshold // and force the algorithm to find // a set of breaking points @@ -853,9 +865,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager is justify and the paragraph has only one layout, try using shorter or longer lines */ //TODO This code snippet is disabled. Reenable? + /* [GA] remove dead code if (false && alignment == EN_JUSTIFY && textAlignment == EN_JUSTIFY) { - //log.debug("LLM.getNextKnuthElements> layouts with more lines? " + lineLayouts.canUseMoreLines()); - //log.debug(" layouts with fewer lines? " + lineLayouts.canUseLessLines()); + //log.debug("LLM.getNextKnuthElements> layouts with more lines? " + //+ lineLayouts.canUseMoreLines()); + //log.debug(" layouts with fewer lines? " + //+ lineLayouts.canUseLessLines()); if (!lineLayouts.canUseMoreLines()) { alg.resetAlgorithm(); lineLayouts.savePossibilities(true); @@ -881,9 +896,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager lineLayouts.restorePossibilities(); ipd = savedLineWidth; } - //log.debug("LLM.getNextKnuthElements> now, layouts with more lines? " + lineLayouts.canUseMoreLines()); - //log.debug(" now, layouts with fewer lines? " + lineLayouts.canUseLessLines()); + //log.debug("LLM.getNextKnuthElements> now, layouts with more lines? " + //+ lineLayouts.canUseMoreLines()); + //log.debug(" now, layouts with fewer lines? " + //+ lineLayouts.canUseLessLines()); } + */ } return lineLayouts; } @@ -1068,7 +1086,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager //log.debug("first=" + firstLines + " inner=" + innerLines // + " optional=" + optionalLines + " eliminable=" + eliminableLines // + " last=" + lastLines - // + " (condOpt=" + conditionalOptionalLines + " condEl=" + conditionalEliminableLines + ")"); + // + " (condOpt=" + conditionalOptionalLines + // + " condEl=" + conditionalEliminableLines + ")"); // creation of the elements: // first group of lines @@ -1172,8 +1191,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager //} //int lineNumberDifference = (int)((double) totalAdj / constantLineHeight); int lineNumberDifference = (int) Math.round((double) adj / constantLineHeight - + (adj > 0 ? - 0.4 : 0.4)); - //log.debug(" LLM> variazione calcolata = " + ((double) totalAdj / constantLineHeight) + " variazione applicata = " + lineNumberDifference); + + (adj > 0 ? -0.4 : 0.4)); + //log.debug(" LLM> variazione calcolata = " + ((double) totalAdj / constantLineHeight) + //+ " variazione applicata = " + lineNumberDifference); LineLayoutPossibilities llPoss; llPoss = lineLayoutsList[pos.getLeafPos()]; lineNumberDifference = llPoss.applyLineCountAdjustment(lineNumberDifference); @@ -1198,10 +1218,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager returnList.add(new KnuthPenalty(0, 0, false, new Position(this), false)); } LineBreakPosition lbp = (LineBreakPosition) llPoss.getChosenPosition(i); - //log.debug("LLM.getChangedKnuthElements> lineWidth= " + lbp.lineWidth + " difference= " + lbp.difference); - //log.debug(" shrink= " + lbp.availableShrink + " stretch= " + lbp.availableStretch); - - //log.debug("linewidth= " + lbp.lineWidth + " difference= " + lbp.difference + " indent= " + lbp.startIndent); + //log.debug("LLM.getChangedKnuthElements> lineWidth= " + // + lbp.lineWidth + " difference= " + lbp.difference); + //log.debug(" shrink= " + // + lbp.availableShrink + " stretch= " + lbp.availableStretch); + //log.debug("linewidth= " + lbp.lineWidth + " difference= " + //+ lbp.difference + " indent= " + lbp.startIndent); MinOptMax contentIPD; if (alignment == EN_JUSTIFY) { contentIPD = MinOptMax.getInstance( @@ -1213,7 +1235,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager } else if (alignment == EN_END) { contentIPD = MinOptMax.getInstance(lbp.lineWidth - lbp.startIndent); } else { - contentIPD = MinOptMax.getInstance(lbp.lineWidth - lbp.difference + lbp.startIndent); + contentIPD + = MinOptMax.getInstance(lbp.lineWidth - lbp.difference + lbp.startIndent); } returnList.add(new KnuthBlockBox(lbp.lineHeight, contentIPD, (lbp.ipdAdjust != 0 ? lbp.lineWidth - lbp.difference : 0), @@ -1528,6 +1551,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager * have been optimized, recompute indents and / or adjust ratio, according * to the paragraph horizontal alignment */ + /* [GA] remove dead code if (false && textAlignment == EN_JUSTIFY) { // re-compute space adjust ratio int updatedDifference = context.getRefIPD() @@ -1539,8 +1563,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager updatedRatio = (float) updatedDifference / lbp.availableShrink; } lc.setIPDAdjust(updatedRatio); - //log.debug("LLM.addAreas> old difference = " + lbp.difference + " new difference = " + updatedDifference); - //log.debug(" old ratio = " + lbp.ipdAdjust + " new ratio = " + updatedRatio); + //log.debug("LLM.addAreas> old difference = " + lbp.difference + //+ " new difference = " + updatedDifference); + //log.debug(" old ratio = " + lbp.ipdAdjust + //+ " new ratio = " + updatedRatio); } else if (false && textAlignment == EN_CENTER) { // re-compute indent int updatedIndent = lbp.startIndent @@ -1552,6 +1578,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager + (context.getRefIPD() - lbp.lineWidth); lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent)); } + */ setCurrentArea(lineArea); setChildContext(lc); diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java index c1b81c4ab..3eed124b2 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java @@ -25,12 +25,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.fop.layoutmgr.Position; +/** + * Line layout possibilities. + */ public class LineLayoutPossibilities { /** logger instance */ - protected static Log log = LogFactory.getLog(LineLayoutPossibilities.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(LineLayoutPossibilities.class); - private class Possibility { + private final class Possibility { private int lineCount; private double demerits; private List breakPositions; @@ -69,12 +73,18 @@ public class LineLayoutPossibilities { private int chosenIndex; private int savedOptLineCount; + /** default constructor */ public LineLayoutPossibilities() { possibilitiesList = new java.util.ArrayList(); savedPossibilities = new java.util.ArrayList(); optimumIndex = -1; } + /** + * Add possibility. + * @param ln line number + * @param dem demerits + */ public void addPossibility(int ln, double dem) { possibilitiesList.add(new Possibility(ln, dem)); if (possibilitiesList.size() == 1) { @@ -97,8 +107,10 @@ public class LineLayoutPossibilities { } } - /* save in a different array the computed Possibilities, - * so possibilitiesList is ready to store different Possibilities + /** + * Save in a different array the computed Possibilities, + * so possibilitiesList is ready to store different Possibilities. + * @param bSaveOptLineCount true if should save optimum line count */ public void savePossibilities(boolean bSaveOptLineCount) { if (bSaveOptLineCount) { @@ -110,8 +122,9 @@ public class LineLayoutPossibilities { possibilitiesList = new java.util.ArrayList(); } - /* replace the Possibilities stored in possibilitiesList with - * the ones stored in savedPossibilities and having the same line number + /** + * Replace the Possibilities stored in possibilitiesList with + * the ones stored in savedPossibilities and having the same line number. */ public void restorePossibilities() { int index = 0; @@ -124,9 +137,9 @@ public class LineLayoutPossibilities { // update minimumIndex minimumIndex = 0; // shift the other indexes; - optimumIndex ++; - maximumIndex ++; - chosenIndex ++; + optimumIndex++; + maximumIndex++; + chosenIndex++; } else if (restoredPossibility.getLineCount() > getMaxLineCount()) { // if the line number of restoredPossibility is greater than the maximum one, // add restoredPossibility at the end of the list @@ -138,7 +151,7 @@ public class LineLayoutPossibilities { // find the index of the Possibility that will be replaced while (index < maximumIndex && getLineCount(index) < restoredPossibility.getLineCount()) { - index ++; + index++; } if (getLineCount(index) == restoredPossibility.getLineCount()) { possibilitiesList.set(index, restoredPossibility); @@ -152,8 +165,10 @@ public class LineLayoutPossibilities { } } // update optimumIndex and chosenIndex - if (savedOptLineCount == 0 && getDemerits(optimumIndex) > restoredPossibility.getDemerits() - || savedOptLineCount != 0 && restoredPossibility.getLineCount() == savedOptLineCount) { + if (savedOptLineCount == 0 + && getDemerits(optimumIndex) > restoredPossibility.getDemerits() + || savedOptLineCount != 0 + && restoredPossibility.getLineCount() == savedOptLineCount) { optimumIndex = index; chosenIndex = optimumIndex; } @@ -162,54 +177,82 @@ public class LineLayoutPossibilities { // + " optLineCount = " + getOptLineCount() + " maxLineCount() = " + getMaxLineCount()); } + /** + * @param pos a position + * @param i an index into posibilities list + */ public void addBreakPosition(Position pos, int i) { ((Possibility)possibilitiesList.get(i)).addBreakPosition(pos); } + /** @return true if can use more lines */ public boolean canUseMoreLines() { return (getOptLineCount() < getMaxLineCount()); } + /** @return true if can use fewer lines */ public boolean canUseLessLines() { return (getMinLineCount() < getOptLineCount()); } + /** @return the line count of the minimum index */ public int getMinLineCount() { return getLineCount(minimumIndex); } + /** @return the line count of the optimum index */ public int getOptLineCount() { return getLineCount(optimumIndex); } + /** @return the line count of the maximum index */ public int getMaxLineCount() { return getLineCount(maximumIndex); } + /** @return the line count of the chosen index */ public int getChosenLineCount() { return getLineCount(chosenIndex); } + /** + * @param i the posibilities list index + * @return the line count + */ public int getLineCount(int i) { return ((Possibility)possibilitiesList.get(i)).getLineCount(); } + /** @return the demerits of the chosen index */ public double getChosenDemerits() { return getDemerits(chosenIndex); } + /** + * @param i the posibilities list index + * @return the demerits + */ public double getDemerits(int i) { return ((Possibility)possibilitiesList.get(i)).getDemerits(); } + /** @return the possibilities count */ public int getPossibilitiesNumber() { return possibilitiesList.size(); } + /** + * @param i the break position index + * @return the chosen position + */ public Position getChosenPosition(int i) { return ((Possibility)possibilitiesList.get(chosenIndex)).getBreakPosition(i); } + /** + * @param adj the adjustment + * @return the adjustment or zero + */ public int applyLineCountAdjustment(int adj) { if (adj >= (getMinLineCount() - getChosenLineCount()) && adj <= (getMaxLineCount() - getChosenLineCount()) @@ -225,10 +268,11 @@ public class LineLayoutPossibilities { } } + /** print all */ public void printAll() { System.out.println("++++++++++"); System.out.println(" " + possibilitiesList.size() + " possibility':"); - for (int i = 0; i < possibilitiesList.size(); i ++) { + for (int i = 0; i < possibilitiesList.size(); i++) { System.out.println(" " + ((Possibility)possibilitiesList.get(i)).getLineCount() + (i == optimumIndex ? " *" : "") + (i == minimumIndex ? " -" : "") diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java index a38e3e2d8..f3e8784c1 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java @@ -37,7 +37,7 @@ public class PageNumberCitationLastLayoutManager extends AbstractPageNumberCitat * Constructor * * @param node the formatting object that creates this area - * @todo better retrieval of font info + * @asf.todo better retrieval of font info */ public PageNumberCitationLastLayoutManager(PageNumberCitationLast node) { super(node); diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java index 583f73d24..62041e888 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java @@ -36,7 +36,7 @@ public class PageNumberCitationLayoutManager extends AbstractPageNumberCitationL * Constructor * * @param node the formatting object that creates this area - * @todo better retrieval of font info + * @asf.todo better retrieval of font info */ public PageNumberCitationLayoutManager(PageNumberCitation node) { super(node); diff --git a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java index 1536552c4..0d48ccbfe 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java +++ b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java @@ -28,7 +28,10 @@ import org.apache.fop.fonts.Font; * Currently supports alignment contexts for basic fonts * and graphic inlines. */ -public class ScaledBaselineTableFactory implements Constants { +public final class ScaledBaselineTableFactory implements Constants { + + private ScaledBaselineTableFactory() { + } /** * Creates a new instance of BasicScaledBaselineTable for the given diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 43e8c5a31..4c45fbe66 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -81,15 +81,10 @@ public class TextLayoutManager extends LeafNodeLayoutManager { private boolean breakOppAfter; private final Font font; - AreaInfo(final int startIndex, - final int breakIndex, - final int wordSpaceCount, - final int letterSpaceCount, - final MinOptMax areaIPD, - final boolean isHyphenated, - final boolean isSpace, - final boolean breakOppAfter, - final Font font) { + AreaInfo // CSOK: ParameterNumber + (int startIndex, int breakIndex, int wordSpaceCount, int letterSpaceCount, + MinOptMax areaIPD, boolean isHyphenated, boolean isSpace, boolean breakOppAfter, + Font font) { assert startIndex <= breakIndex; this.startIndex = startIndex; this.breakIndex = breakIndex; @@ -776,7 +771,8 @@ public class TextLayoutManager extends LeafNodeLayoutManager { } final boolean endsWithHyphen = checkEndsWithHyphen && foText.charAt(lastIndex) == CharUtilities.SOFT_HYPHEN; - Font font = FontSelector.selectFontForCharactersInText(foText, thisStart, lastIndex, foText, this); + Font font = FontSelector + .selectFontForCharactersInText(foText, thisStart, lastIndex, foText, this); int wordLength = lastIndex - thisStart; boolean kerning = font.hasKerning(); MinOptMax wordIPD = MinOptMax.ZERO; @@ -793,7 +789,8 @@ public class TextLayoutManager extends LeafNodeLayoutManager { if (i > thisStart) { char previousChar = foText.charAt(i - 1); kern = font.getKernValue(previousChar, currentChar); - } else if (prevAreaInfo != null && !prevAreaInfo.isSpace && prevAreaInfo.breakIndex > 0) { + } else if (prevAreaInfo != null + && !prevAreaInfo.isSpace && prevAreaInfo.breakIndex > 0) { char previousChar = foText.charAt(prevAreaInfo.breakIndex - 1); kern = font.getKernValue(previousChar, currentChar); } @@ -953,7 +950,9 @@ public class TextLayoutManager extends LeafNodeLayoutManager { } // add letter spaces - boolean isWordEnd = stopIndex == areaInfo.breakIndex && areaInfo.letterSpaceCount < areaInfo.getCharLength(); + boolean isWordEnd + = stopIndex == areaInfo.breakIndex + && areaInfo.letterSpaceCount < areaInfo.getCharLength(); int letterSpaceCount = isWordEnd ? stopIndex - startIndex - 1 : stopIndex - startIndex; assert letterSpaceCount >= 0; @@ -1065,11 +1064,13 @@ public class TextLayoutManager extends LeafNodeLayoutManager { if (foText.charAt(areaInfo.startIndex) != CharUtilities.SPACE || foText.getWhitespaceTreatment() == Constants.EN_PRESERVE) { // a breaking space that needs to be preserved - baseList.addAll(getElementsForBreakingSpace(alignment, areaInfo, auxiliaryPosition, 0, + baseList + .addAll(getElementsForBreakingSpace(alignment, areaInfo, auxiliaryPosition, 0, mainPosition, areaInfo.areaIPD.getOpt(), true)); } else { // a (possible block) of breaking spaces - baseList.addAll(getElementsForBreakingSpace(alignment, areaInfo, mainPosition, + baseList + .addAll(getElementsForBreakingSpace(alignment, areaInfo, mainPosition, areaInfo.areaIPD.getOpt(), auxiliaryPosition, 0, false)); } } @@ -1103,17 +1104,31 @@ public class TextLayoutManager extends LeafNodeLayoutManager { // if the second element is chosen as a line break these elements // add a constant amount of stretch at the end of a line, otherwise // they don't add any stretch + KnuthGlue g; if (skipZeroCheck || lineStartBAP != 0 || lineEndBAP != 0) { - elements.add(new KnuthGlue(lineEndBAP, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, auxiliaryPosition, false)); + g = new KnuthGlue + (lineEndBAP, + 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, auxiliaryPosition, false); + elements.add(g); elements.add(makeZeroWidthPenalty(0)); - elements.add(new KnuthGlue(p2WidthOffset - (lineStartBAP + lineEndBAP), -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, pos2, false)); + g = new KnuthGlue + (p2WidthOffset - (lineStartBAP + lineEndBAP), + -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, pos2, false); + elements.add(g); elements.add(makeAuxiliaryZeroWidthBox()); elements.add(makeZeroWidthPenalty(KnuthElement.INFINITE)); - elements.add(new KnuthGlue(lineStartBAP + p3WidthOffset, 0, 0, pos3, false)); + g = new KnuthGlue(lineStartBAP + p3WidthOffset, 0, 0, pos3, false); + elements.add(g); } else { - elements.add(new KnuthGlue(0, 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, auxiliaryPosition, false)); + g = new KnuthGlue + (0, + 3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, auxiliaryPosition, false); + elements.add(g); elements.add(makeZeroWidthPenalty(0)); - elements.add(new KnuthGlue(areaInfo.areaIPD.getOpt(), -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, pos2, false)); + g = new KnuthGlue + (areaInfo.areaIPD.getOpt(), + -3 * LineLayoutManager.DEFAULT_SPACE_WIDTH, 0, pos2, false); + elements.add(g); } break; @@ -1133,9 +1148,10 @@ public class TextLayoutManager extends LeafNodeLayoutManager { return elements; } - private List getElementsForJustifiedText(AreaInfo areaInfo, Position pos2, int p2WidthOffset, - Position pos3, int p3WidthOffset, boolean skipZeroCheck, - int shrinkability) { + private List getElementsForJustifiedText + (AreaInfo areaInfo, Position pos2, int p2WidthOffset, + Position pos3, int p3WidthOffset, boolean skipZeroCheck, + int shrinkability) { int stretchability = areaInfo.areaIPD.getStretch(); diff --git a/src/java/org/apache/fop/layoutmgr/table/CellPart.java b/src/java/org/apache/fop/layoutmgr/table/CellPart.java index 7dd2bc201..8af3a3d43 100644 --- a/src/java/org/apache/fop/layoutmgr/table/CellPart.java +++ b/src/java/org/apache/fop/layoutmgr/table/CellPart.java @@ -61,7 +61,8 @@ class CellPart { * @param bpAfterLast width of (possibly optional) border- and padding-after if this * part will be the last one on the page */ - protected CellPart(PrimaryGridUnit pgu, int start, int end, boolean last, + protected CellPart // CSOK: ParameterNumber + (PrimaryGridUnit pgu, int start, int end, boolean last, int condBeforeContentLength, int length, int condAfterContentLength, int bpBeforeNormal, int bpBeforeFirst, int bpAfterNormal, int bpAfterLast) { diff --git a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java index ede6210ca..7221d4fee 100644 --- a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java +++ b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java @@ -196,7 +196,7 @@ public abstract class CollapsingBorderModel { * @param border1 a border specification * @param border2 another border specification * @return the winning border, null if the two borders are equivalent - * @see determineWinner + * @see #determineWinner(BorderSpecification,BorderSpecification,boolean) */ public abstract BorderSpecification determineWinner(BorderSpecification border1, BorderSpecification border2); diff --git a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java index e28126c3e..ab37248ea 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java @@ -33,7 +33,7 @@ import org.apache.fop.layoutmgr.PositionIterator; * The caption contains blocks that are positioned next to the * table on the caption side. * The caption blocks have an implicit keep with the table. - * @todo Implement getNextKnuthElements() + * @asf.todo Implement getNextKnuthElements() */ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager { diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java index c7d0d0da4..96ffc0a90 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java @@ -31,7 +31,7 @@ import org.apache.fop.layoutmgr.PositionIterator; * LayoutManager for a table-caption FO. * The table caption contains blocks that are placed beside the * table. - * @todo Implement getNextKnuthElements() + * @asf.todo Implement getNextKnuthElements() */ public class TableCaptionLayoutManager extends BlockStackingLayoutManager { diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java index 0599b430c..5fb733a51 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java @@ -277,17 +277,10 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager * this row is placed on a previous page). Used to calculate the placement of the * row's background image if any */ - public void addAreas(PositionIterator parentIter, - LayoutContext layoutContext, - int[] spannedGridRowHeights, - int startRow, - int endRow, - int borderBeforeWhich, - int borderAfterWhich, - boolean firstOnPage, - boolean lastOnPage, - RowPainter painter, - int firstRowHeight) { + public void addAreas // CSOK: ParameterNumber + (PositionIterator parentIter, LayoutContext layoutContext, int[] spannedGridRowHeights, + int startRow, int endRow, int borderBeforeWhich, int borderAfterWhich, boolean firstOnPage, + boolean lastOnPage, RowPainter painter, int firstRowHeight) { getParentArea(null); addId(); diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 40ebf9e0d..1a3297ad5 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -55,7 +55,8 @@ import org.apache.fop.util.BreakUtil; public class TableContentLayoutManager implements PercentBaseContext { /** Logger **/ - private static Log log = LogFactory.getLog(TableContentLayoutManager.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(TableContentLayoutManager.class); private TableLayoutManager tableLM; private TableRowIterator bodyIter; @@ -127,8 +128,16 @@ public class TableContentLayoutManager implements PercentBaseContext { return this.footerList; } - /** {@inheritDoc} */ - public LinkedList getNextKnuthElements(LayoutContext context, int alignment) { + /** + * Get a sequence of KnuthElements representing the content + * of the node assigned to the LM. + * + * @param context the LayoutContext used to store layout information + * @param alignment the desired text alignment + * @return the list of KnuthElements + * @see org.apache.fop.layoutmgr.LayoutManager#getNextKnuthElements(LayoutContext, int) + */ + public List getNextKnuthElements(LayoutContext context, int alignment) { if (log.isDebugEnabled()) { log.debug("==> Columns: " + getTableLM().getColumns()); } diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 7ccab7898..2b432d0d4 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -240,7 +240,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager // Elements for the table-header/footer/body - LinkedList contentKnuthElements; + List contentKnuthElements; contentLM = new TableContentLayoutManager(this); LayoutContext childLC = new LayoutContext(0); /* diff --git a/src/java/org/apache/fop/pdf/AlphaRasterImage.java b/src/java/org/apache/fop/pdf/AlphaRasterImage.java index bd31148be..7272c5edd 100644 --- a/src/java/org/apache/fop/pdf/AlphaRasterImage.java +++ b/src/java/org/apache/fop/pdf/AlphaRasterImage.java @@ -116,7 +116,7 @@ public class AlphaRasterImage implements PDFImage { return null; } - /** {@inheritDoc} */ + /** @return null (unless overridden) */ public String getSoftMask() { return null; } diff --git a/src/java/org/apache/fop/pdf/CMapBuilder.java b/src/java/org/apache/fop/pdf/CMapBuilder.java index affb4fcad..84b3b2ce7 100644 --- a/src/java/org/apache/fop/pdf/CMapBuilder.java +++ b/src/java/org/apache/fop/pdf/CMapBuilder.java @@ -22,11 +22,19 @@ package org.apache.fop.pdf; import java.io.IOException; import java.io.Writer; +/** A cmap builder. */ public class CMapBuilder { + /** name */ protected String name; + /** writer */ protected Writer writer; + /** + * Construct cmap builder. + * @param writer a writer + * @param name a name + */ public CMapBuilder(Writer writer, String name) { this.writer = writer; this.name = name; @@ -52,12 +60,14 @@ public class CMapBuilder { writeUseCMap(); } + /** @throws IOException if i/o exception */ protected void writePreStream() throws IOException { // writer.write("/Type /CMap\n"); // writer.write(sysInfo.toPDFString()); // writer.write("/CMapName /" + name + EOL); } + /** @throws IOException if i/o exception */ protected void writeStreamComments() throws IOException { writer.write("%!PS-Adobe-3.0 Resource-CMap\n"); writer.write("%%DocumentNeededResources: ProcSet (CIDInit)\n"); @@ -66,12 +76,19 @@ public class CMapBuilder { writer.write("%%EndComments\n"); } + /** @throws IOException if i/o exception */ protected void writeCIDInit() throws IOException { writer.write("/CIDInit /ProcSet findresource begin\n"); writer.write("12 dict begin\n"); writer.write("begincmap\n"); } + /** + * @param registry string + * @param ordering string + * @param supplement string + * @throws IOException if i/o exception + */ protected void writeCIDSystemInfo(String registry, String ordering, int supplement) throws IOException { writer.write("/CIDSystemInfo 3 dict dup begin\n"); @@ -87,32 +104,50 @@ public class CMapBuilder { writer.write("end def\n"); } + /** @throws IOException if i/o exception */ protected void writeCIDSystemInfo() throws IOException { writeCIDSystemInfo("Adobe", "Identity", 0); } + /** + * @param version a version + * @throws IOException if i/o exception + */ protected void writeVersion(String version) throws IOException { writer.write("/CMapVersion "); writer.write(version); writer.write(" def\n"); } + /** + * @param type a type + * @throws IOException if i/o exception + */ protected void writeType(String type) throws IOException { writer.write("/CMapType "); writer.write(type); writer.write(" def\n"); } + /** + * @param name a name + * @throws IOException if i/o exception + */ protected void writeName(String name) throws IOException { writer.write("/CMapName /"); writer.write(name); writer.write(" def\n"); } + /** @throws IOException if i/o exception */ protected void writeCodeSpaceRange() throws IOException { writeCodeSpaceRange(false); } + /** + * @param singleByte true if single byte range + * @throws IOException if i/o exception + */ protected void writeCodeSpaceRange(boolean singleByte) throws IOException { writer.write("1 begincodespacerange\n"); if (singleByte) { @@ -123,18 +158,21 @@ public class CMapBuilder { writer.write("endcodespacerange\n"); } + /** @throws IOException if i/o exception */ protected void writeCIDRange() throws IOException { writer.write("1 begincidrange\n"); writer.write("<0000> <FFFF> 0\n"); writer.write("endcidrange\n"); } + /** @throws IOException if i/o exception */ protected void writeBFEntries() throws IOException { // writer.write("1 beginbfrange\n"); // writer.write("<0020> <0100> <0000>\n"); // writer.write("endbfrange\n"); } + /** @throws IOException if i/o exception */ protected void writeWrapUp() throws IOException { writer.write("endcmap\n"); writer.write("CMapName currentdict /CMap defineresource pop\n"); @@ -142,11 +180,13 @@ public class CMapBuilder { writer.write("end\n"); } + /** @throws IOException if i/o exception */ protected void writeStreamAfterComments() throws IOException { writer.write("%%EndResource\n"); writer.write("%%EOF\n"); } + /** does nothing */ protected void writeUseCMap() { /* * writer.write(" /Type /CMap"); diff --git a/src/java/org/apache/fop/pdf/DestinationComparator.java b/src/java/org/apache/fop/pdf/DestinationComparator.java index 87d6a00ff..0966853ea 100644 --- a/src/java/org/apache/fop/pdf/DestinationComparator.java +++ b/src/java/org/apache/fop/pdf/DestinationComparator.java @@ -30,6 +30,7 @@ public class DestinationComparator implements java.util.Comparator { return dest1.getIDRef().compareTo(dest2.getIDRef()); }*/ + /** {@inheritDoc} */ public int compare (Object obj1, Object obj2) { if (obj1 instanceof PDFDestination && obj2 instanceof PDFDestination) { PDFDestination dest1 = (PDFDestination)obj1; diff --git a/src/java/org/apache/fop/pdf/PDFCIDFont.java b/src/java/org/apache/fop/pdf/PDFCIDFont.java index 3224eb567..9a91dd992 100644 --- a/src/java/org/apache/fop/pdf/PDFCIDFont.java +++ b/src/java/org/apache/fop/pdf/PDFCIDFont.java @@ -56,9 +56,10 @@ public class PDFCIDFont extends PDFObject { * @param supplement Supplement number * @param descriptor CID font descriptor */ - public PDFCIDFont(String basefont, CIDFontType cidtype, int dw, - int[] w, String registry, String ordering, - int supplement, PDFCIDFontDescriptor descriptor) { + public PDFCIDFont // CSOK: ParameterNumber + (String basefont, CIDFontType cidtype, int dw, + int[] w, String registry, String ordering, + int supplement, PDFCIDFontDescriptor descriptor) { this(basefont, cidtype, dw, new PDFWArray(w), diff --git a/src/java/org/apache/fop/pdf/PDFDocument.java b/src/java/org/apache/fop/pdf/PDFDocument.java index f0a777bdd..ae160ef78 100644 --- a/src/java/org/apache/fop/pdf/PDFDocument.java +++ b/src/java/org/apache/fop/pdf/PDFDocument.java @@ -124,8 +124,8 @@ public class PDFDocument { private PDFEncryption encryption; /** the colorspace (0=RGB, 1=CMYK) */ - private PDFDeviceColorSpace colorspace = - new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB); + private PDFDeviceColorSpace colorspace + = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB); /** the counter for Pattern name numbering (e.g. 'Pattern1') */ private int patternCount = 0; diff --git a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java index 78010dd78..db9a49271 100644 --- a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java +++ b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java @@ -29,7 +29,8 @@ import org.apache.commons.logging.LogFactory; */ public class PDFEmbeddedFile extends PDFStream { - protected static Log log = LogFactory.getLog(PDFEmbeddedFile.class.getName()); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(PDFEmbeddedFile.class.getName()); /** * Creates a new embedded file stream. diff --git a/src/java/org/apache/fop/pdf/PDFEncryptionManager.java b/src/java/org/apache/fop/pdf/PDFEncryptionManager.java index 5d5ea8586..60844c588 100644 --- a/src/java/org/apache/fop/pdf/PDFEncryptionManager.java +++ b/src/java/org/apache/fop/pdf/PDFEncryptionManager.java @@ -31,10 +31,14 @@ import org.apache.commons.logging.LogFactory; * This class acts as a factory for PDF encryption support. It enables the * feature to be optional to FOP depending on the availability of JCE. */ -public class PDFEncryptionManager { +public final class PDFEncryptionManager { + + private PDFEncryptionManager() { + } /** logging instance */ - protected static Log log = LogFactory.getLog(PDFEncryptionManager.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(PDFEncryptionManager.class); /** * Indicates whether JCE is available. diff --git a/src/java/org/apache/fop/pdf/PDFFactory.java b/src/java/org/apache/fop/pdf/PDFFactory.java index f92fdc4e7..80cfba911 100644 --- a/src/java/org/apache/fop/pdf/PDFFactory.java +++ b/src/java/org/apache/fop/pdf/PDFFactory.java @@ -289,12 +289,13 @@ public class PDFFactory { * It should be 0 as this is the constructor for sampled functions. * @return the PDF function that was created */ - public PDFFunction makeFunction(int theFunctionType, List theDomain, - List theRange, List theSize, - int theBitsPerSample, int theOrder, - List theEncode, List theDecode, - StringBuffer theFunctionDataStream, - List theFilter) { + public PDFFunction makeFunction // CSOK: ParameterNumber + (int theFunctionType, List theDomain, + List theRange, List theSize, + int theBitsPerSample, int theOrder, + List theEncode, List theDecode, + StringBuffer theFunctionDataStream, + List theFilter) { // Type 0 function PDFFunction function = new PDFFunction(theFunctionType, theDomain, theRange, theSize, @@ -462,12 +463,13 @@ public class PDFFactory { * @param theFunction The PDF Function that maps an (x,y) location to a color * @return the PDF shading that was created */ - public PDFShading makeShading(PDFResourceContext res, int theShadingType, - PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, List theDomain, - List theMatrix, - PDFFunction theFunction) { + public PDFShading makeShading // CSOK: ParameterNumber + (PDFResourceContext res, int theShadingType, + PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, List theDomain, + List theMatrix, + PDFFunction theFunction) { // make Shading of Type 1 PDFShading shading = new PDFShading(theShadingType, theColorSpace, theBackground, @@ -514,12 +516,13 @@ public class PDFFactory { * The default is [false, false] * @return the PDF shading that was created */ - public PDFShading makeShading(PDFResourceContext res, int theShadingType, - PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, List theCoords, - List theDomain, PDFFunction theFunction, - List theExtend) { + public PDFShading makeShading // CSOK: ParameterNumber + (PDFResourceContext res, int theShadingType, + PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, List theCoords, + List theDomain, PDFFunction theFunction, + List theExtend) { // make Shading of Type 2 or 3 PDFShading shading = new PDFShading(theShadingType, theColorSpace, theBackground, @@ -567,14 +570,15 @@ public class PDFFactory { * @param theFunction the PDFFunction * @return the PDF shading that was created */ - public PDFShading makeShading(PDFResourceContext res, int theShadingType, - PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, - int theBitsPerCoordinate, - int theBitsPerComponent, - int theBitsPerFlag, List theDecode, - PDFFunction theFunction) { + public PDFShading makeShading // CSOK: ParameterNumber + (PDFResourceContext res, int theShadingType, + PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, + int theBitsPerCoordinate, + int theBitsPerComponent, + int theBitsPerFlag, List theDecode, + PDFFunction theFunction) { // make Shading of type 4,6 or 7 PDFShading shading = new PDFShading(theShadingType, theColorSpace, theBackground, @@ -622,14 +626,15 @@ public class PDFFactory { * @param theFunction The PDFFunction that's mapped on to this shape * @return the PDF shading that was created */ - public PDFShading makeShading(PDFResourceContext res, int theShadingType, - PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, - int theBitsPerCoordinate, - int theBitsPerComponent, List theDecode, - int theVerticesPerRow, - PDFFunction theFunction) { + public PDFShading makeShading // CSOK: ParameterNumber + (PDFResourceContext res, int theShadingType, + PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, + int theBitsPerCoordinate, + int theBitsPerComponent, List theDecode, + int theVerticesPerRow, + PDFFunction theFunction) { // make shading of Type 5 PDFShading shading = new PDFShading(theShadingType, theColorSpace, theBackground, @@ -672,11 +677,12 @@ public class PDFFactory { * @param thePatternDataStream The stream of pattern data to be tiled. * @return the PDF pattern that was created */ - public PDFPattern makePattern(PDFResourceContext res, int thePatternType, // 1 - PDFResources theResources, int thePaintType, int theTilingType, - List theBBox, double theXStep, - double theYStep, List theMatrix, - List theXUID, StringBuffer thePatternDataStream) { + public PDFPattern makePattern // CSOK: ParameterNumber + (PDFResourceContext res, int thePatternType, // 1 + PDFResources theResources, int thePaintType, int theTilingType, + List theBBox, double theXStep, + double theYStep, List theMatrix, + List theXUID, StringBuffer thePatternDataStream) { // PDFResources theResources PDFPattern pattern = new PDFPattern(theResources, 1, thePaintType, theTilingType, @@ -1072,12 +1078,12 @@ public class PDFFactory { } else if (targetLo.endsWith(".pdf")) { // Bare PDF file name? return getGoToPDFAction(target, null, -1, newWindow); - } else if ((index = targetLo.indexOf(".pdf#page=")) > 0) { + } else if ((index = targetLo.indexOf(".pdf#page=")) > 0) { // CSOK: InnerAssignment // PDF file + page? String filename = target.substring(0, index + 4); int page = Integer.parseInt(target.substring(index + 10)); return getGoToPDFAction(filename, null, page, newWindow); - } else if ((index = targetLo.indexOf(".pdf#dest=")) > 0) { + } else if ((index = targetLo.indexOf(".pdf#dest=")) > 0) { // CSOK: InnerAssignment // PDF file + destination? String filename = target.substring(0, index + 4); String dest = target.substring(index + 10); diff --git a/src/java/org/apache/fop/pdf/PDFFileSpec.java b/src/java/org/apache/fop/pdf/PDFFileSpec.java index 44195d4ee..d688ac4ee 100644 --- a/src/java/org/apache/fop/pdf/PDFFileSpec.java +++ b/src/java/org/apache/fop/pdf/PDFFileSpec.java @@ -45,7 +45,7 @@ public class PDFFileSpec extends PDFDictionary { /** * Associates an dictionary with pointers to embedded file streams with this file spec. - * @param embeddedFile the dictionary with pointers to embedded file streams + * @param embeddedFileDict the dictionary with pointers to embedded file streams */ public void setEmbeddedFile(PDFDictionary embeddedFileDict) { put("EF", embeddedFileDict); diff --git a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java index d4b412e4c..4350ed7dd 100644 --- a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java +++ b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java @@ -40,10 +40,11 @@ public class PDFFontDescriptor extends PDFDictionary { * @param italicAngle the angle of the vertical dominant strokes * @param stemV the width of the dominant vertical stems of glyphs */ - public PDFFontDescriptor(String basefont, int ascent, - int descent, int capHeight, int flags, - PDFRectangle fontBBox, int italicAngle, - int stemV) { + public PDFFontDescriptor // CSOK: ParameterNumber + (String basefont, int ascent, + int descent, int capHeight, int flags, + PDFRectangle fontBBox, int italicAngle, + int stemV) { super(); put("Type", new PDFName("FontDescriptor")); diff --git a/src/java/org/apache/fop/pdf/PDFFunction.java b/src/java/org/apache/fop/pdf/PDFFunction.java index d57cabb50..5b5d41490 100644 --- a/src/java/org/apache/fop/pdf/PDFFunction.java +++ b/src/java/org/apache/fop/pdf/PDFFunction.java @@ -211,10 +211,11 @@ public class PDFFunction extends PDFObject { * @param theFunctionType This is the type of function (0,2,3, or 4). * It should be 0 as this is the constructor for sampled functions. */ - public PDFFunction(int theFunctionType, List theDomain, - List theRange, List theSize, int theBitsPerSample, - int theOrder, List theEncode, List theDecode, - StringBuffer theFunctionDataStream, List theFilter) { + public PDFFunction // CSOK: ParameterNumber + (int theFunctionType, List theDomain, + List theRange, List theSize, int theBitsPerSample, + int theOrder, List theEncode, List theDecode, + StringBuffer theFunctionDataStream, List theFilter) { super(); this.functionType = 0; // dang well better be 0; @@ -374,7 +375,7 @@ public class PDFFunction extends PDFObject { * * @return the PDF string. */ - public byte[] toPDF() { + public byte[] toPDF() { // CSOK: MethodLength int vectorSize = 0; int numberOfFunctions = 0; int tempInt = 0; diff --git a/src/java/org/apache/fop/pdf/PDFLaunch.java b/src/java/org/apache/fop/pdf/PDFLaunch.java index f32afe656..e62da5279 100644 --- a/src/java/org/apache/fop/pdf/PDFLaunch.java +++ b/src/java/org/apache/fop/pdf/PDFLaunch.java @@ -5,7 +5,7 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /* $Id$ */ + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFMetadata.java b/src/java/org/apache/fop/pdf/PDFMetadata.java index 92796c0d1..49f762708 100644 --- a/src/java/org/apache/fop/pdf/PDFMetadata.java +++ b/src/java/org/apache/fop/pdf/PDFMetadata.java @@ -47,7 +47,11 @@ public class PDFMetadata extends PDFStream { private Metadata xmpMetadata; private boolean readOnly = true; - /** @see org.apache.fop.pdf.PDFObject#PDFObject() */ + /** + * @param xmp xmp metadata + * @param readOnly true if read only + * @see org.apache.fop.pdf.PDFObject#PDFObject() + */ public PDFMetadata(Metadata xmp, boolean readOnly) { super(); if (xmp == null) { diff --git a/src/java/org/apache/fop/pdf/PDFPattern.java b/src/java/org/apache/fop/pdf/PDFPattern.java index 89ae1efcd..ebde4ac6a 100644 --- a/src/java/org/apache/fop/pdf/PDFPattern.java +++ b/src/java/org/apache/fop/pdf/PDFPattern.java @@ -117,11 +117,12 @@ public class PDFPattern extends PDFPathPaint { * @param theXUID Optional vector of Integers that uniquely identify the pattern * @param thePatternDataStream The stream of pattern data to be tiled. */ - public PDFPattern(PDFResources theResources, int thePatternType, // 1 - int thePaintType, int theTilingType, List theBBox, - double theXStep, double theYStep, - List theMatrix, List theXUID, - StringBuffer thePatternDataStream) { + public PDFPattern // CSOK: ParameterNumber + (PDFResources theResources, int thePatternType, // 1 + int thePaintType, int theTilingType, List theBBox, + double theXStep, double theYStep, + List theMatrix, List theXUID, + StringBuffer thePatternDataStream) { super(); this.resources = theResources; // This next parameter is implicit to all constructors, and is diff --git a/src/java/org/apache/fop/pdf/PDFShading.java b/src/java/org/apache/fop/pdf/PDFShading.java index fa4d454ed..10d7bf628 100644 --- a/src/java/org/apache/fop/pdf/PDFShading.java +++ b/src/java/org/apache/fop/pdf/PDFShading.java @@ -164,10 +164,11 @@ public class PDFShading extends PDFObject { * It's optional, the default is the identity matrix * @param theFunction The PDF Function that maps an (x,y) location to a color */ - public PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, List theDomain, - List theMatrix, PDFFunction theFunction) { + public PDFShading // CSOK: ParameterNumber + (int theShadingType, PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, List theDomain, + List theMatrix, PDFFunction theFunction) { super(); this.shadingType = theShadingType; // 1 this.colorSpace = theColorSpace; @@ -202,11 +203,12 @@ public class PDFShading extends PDFObject { * and end colors past the start and end points * The default is [false, false] */ - public PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, List theCoords, - List theDomain, PDFFunction theFunction, - List theExtend) { + public PDFShading // CSOK: ParameterNumber + (int theShadingType, PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, List theCoords, + List theDomain, PDFFunction theFunction, + List theExtend) { super(); this.shadingType = theShadingType; // 2 or 3 this.colorSpace = theColorSpace; @@ -242,11 +244,12 @@ public class PDFShading extends PDFObject { * @param theDecode List of Doubles see PDF 1.3 spec pages 303 to 312. * @param theFunction the PDFFunction */ - public PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, int theBitsPerCoordinate, - int theBitsPerComponent, int theBitsPerFlag, - List theDecode, PDFFunction theFunction) { + public PDFShading // CSOK: ParameterNumber + (int theShadingType, PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, int theBitsPerCoordinate, + int theBitsPerComponent, int theBitsPerFlag, + List theDecode, PDFFunction theFunction) { super(); this.shadingType = theShadingType; // 4,6 or 7 @@ -281,11 +284,12 @@ public class PDFShading extends PDFObject { * @param theVerticesPerRow number of vertices in each "row" of the lattice. * @param theFunction The PDFFunction that's mapped on to this shape */ - public PDFShading(int theShadingType, PDFDeviceColorSpace theColorSpace, - List theBackground, List theBBox, - boolean theAntiAlias, int theBitsPerCoordinate, - int theBitsPerComponent, List theDecode, - int theVerticesPerRow, PDFFunction theFunction) { + public PDFShading // CSOK: ParameterNumber + (int theShadingType, PDFDeviceColorSpace theColorSpace, + List theBackground, List theBBox, + boolean theAntiAlias, int theBitsPerCoordinate, + int theBitsPerComponent, List theDecode, + int theVerticesPerRow, PDFFunction theFunction) { super(); this.shadingType = theShadingType; // 5 this.colorSpace = theColorSpace; @@ -334,7 +338,7 @@ public class PDFShading extends PDFObject { * * @return the PDF string. */ - public String toPDFString() { + public String toPDFString() { // CSOK: MethodLength int vectorSize; int tempInt; StringBuffer p = new StringBuffer(128); diff --git a/src/java/org/apache/fop/pdf/TransitionDictionary.java b/src/java/org/apache/fop/pdf/TransitionDictionary.java index 6711c9508..079a6ce4e 100644 --- a/src/java/org/apache/fop/pdf/TransitionDictionary.java +++ b/src/java/org/apache/fop/pdf/TransitionDictionary.java @@ -28,8 +28,6 @@ public class TransitionDictionary extends PDFDictionary { /** * Create a Transition Dictionary - * - * @param values the dictionary values to output */ public TransitionDictionary() { put("Type", new PDFName("Trans")); diff --git a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java index ee18dff0d..f5a51b058 100644 --- a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java +++ b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java @@ -34,9 +34,10 @@ import java.awt.image.Raster; import java.awt.image.WritableRaster; import java.io.IOException; -import org.apache.fop.render.RendererContext.RendererContextWrapper; import org.apache.xmlgraphics.util.UnitConv; +import org.apache.fop.render.RendererContext.RendererContextWrapper; + /** * Abstract base class for Graphics2DAdapter implementations. */ @@ -151,6 +152,7 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { public void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException { + //TODO Deprecated method to be removed once Barcode4J 2.1 is released. paintImage((org.apache.xmlgraphics.java2d.Graphics2DImagePainter)painter, context, x, y, width, height); } diff --git a/src/java/org/apache/fop/render/AbstractImageHandlerGraphics2D.java b/src/java/org/apache/fop/render/AbstractImageHandlerGraphics2D.java index a79734d49..5bac4d88f 100644 --- a/src/java/org/apache/fop/render/AbstractImageHandlerGraphics2D.java +++ b/src/java/org/apache/fop/render/AbstractImageHandlerGraphics2D.java @@ -34,7 +34,7 @@ import java.awt.image.DataBuffer; import java.awt.image.Raster; import java.awt.image.WritableRaster; -import org.apache.fop.util.UnitConv; +import org.apache.xmlgraphics.util.UnitConv; /** * Abstract base class for ImageHandler implementations that process Java2D images through @@ -45,7 +45,6 @@ public abstract class AbstractImageHandlerGraphics2D implements ImageHandler { /** * Paints the image to a BufferedImage and returns that. * @param painter the painter which will paint the actual image - * @param context the renderer context for the current renderer * @param targetDimension the target dimensions of the image to be converted to a bitmap * @param resolution the requested bitmap resolution * @param gray true if the generated image should be in grayscales diff --git a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java index 54f6170db..ac4936a43 100644 --- a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java +++ b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java @@ -172,11 +172,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param bpsStart the border-start traits * @param bpsEnd the border-end traits */ - protected void drawBackground(float startx, float starty, - float width, float height, - Trait.Background back, - BorderProps bpsBefore, BorderProps bpsAfter, - BorderProps bpsStart, BorderProps bpsEnd) { + protected void drawBackground // CSOK: ParameterNumber + (float startx, float starty, float width, float height, Trait.Background back, + BorderProps bpsBefore, BorderProps bpsAfter, + BorderProps bpsStart, BorderProps bpsEnd) { if (back != null) { endTextObject(); @@ -262,10 +261,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param bpsStart the border-start traits * @param bpsEnd the border-end traits */ - protected void drawBorders(float startx, float starty, - float width, float height, - BorderProps bpsBefore, BorderProps bpsAfter, - BorderProps bpsStart, BorderProps bpsEnd) { + protected void drawBorders // CSOK: ParameterNumber + (float startx, float starty, float width, float height, + BorderProps bpsBefore, BorderProps bpsAfter, + BorderProps bpsStart, BorderProps bpsEnd) { Rectangle2D.Float borderRect = new Rectangle2D.Float(startx, starty, width, height); drawBorders(borderRect, bpsBefore, bpsAfter, bpsStart, bpsEnd); } @@ -283,7 +282,8 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param bpsStart the border specification on the start side * @param bpsEnd the border specification on the end side */ - protected void drawBorders(Rectangle2D.Float borderRect, + protected void drawBorders // CSOK: MethodLength + (Rectangle2D.Float borderRect, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd) { //TODO generalize each of the four conditions into using a parameterized drawBorder() boolean[] border = new boolean[] { @@ -858,8 +858,9 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param style the border style (one of Constants.EN_DASHED etc.) * @param col the color for the border segment */ - protected abstract void drawBorderLine(float x1, float y1, float x2, float y2, - boolean horz, boolean startOrBefore, int style, Color col); + protected abstract void drawBorderLine // CSOK: ParameterNumber + (float x1, float y1, float x2, float y2, boolean horz, + boolean startOrBefore, int style, Color col); /** {@inheritDoc} */ public void renderForeignObject(ForeignObject fo, Rectangle2D pos) { @@ -872,8 +873,6 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { /** * Establishes a new coordinate system with the given transformation matrix. * The current graphics state is saved and the new coordinate system is concatenated. - * @param block - * * @param at the transformation matrix */ protected void establishTransformationMatrix(AffineTransform at) { diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index 8233e480a..72be1b0b8 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -215,6 +215,7 @@ public abstract class AbstractRenderer /** {@inheritDoc} */ public void startPageSequence(PageSequence pageSequence) { + //TODO Discuss removing old deprecated method startPageSequence(LineArea) startPageSequence(pageSequence.getTitle()); } diff --git a/src/java/org/apache/fop/render/ImageHandlerRegistry.java b/src/java/org/apache/fop/render/ImageHandlerRegistry.java index e878e0dfe..02a26265c 100644 --- a/src/java/org/apache/fop/render/ImageHandlerRegistry.java +++ b/src/java/org/apache/fop/render/ImageHandlerRegistry.java @@ -133,6 +133,7 @@ public class ImageHandlerRegistry { /** * Returns the ordered array of supported image flavors. The array needs to be ordered by * priority so the image loader framework can return the preferred image type. + * @param context the rendering context * @return the array of image flavors */ public synchronized ImageFlavor[] getSupportedFlavors(RenderingContext context) { diff --git a/src/java/org/apache/fop/render/ImageHandlerUtil.java b/src/java/org/apache/fop/render/ImageHandlerUtil.java index 41e0e1d45..5aa5f152b 100644 --- a/src/java/org/apache/fop/render/ImageHandlerUtil.java +++ b/src/java/org/apache/fop/render/ImageHandlerUtil.java @@ -28,7 +28,10 @@ import org.apache.fop.fo.extensions.ExtensionElementMapping; /** * Utility methods for image handling. */ -public class ImageHandlerUtil { +public final class ImageHandlerUtil { + + private ImageHandlerUtil() { + } /** conversion-mode extension attribute */ public static final QName CONVERSION_MODE = new QName( diff --git a/src/java/org/apache/fop/render/Renderer.java b/src/java/org/apache/fop/render/Renderer.java index 5fa9ca5b2..76f245251 100644 --- a/src/java/org/apache/fop/render/Renderer.java +++ b/src/java/org/apache/fop/render/Renderer.java @@ -149,7 +149,7 @@ public interface Renderer { * Tells the renderer that a new page sequence starts. * * @param seqTitle The title of the page sequence - * @deprecated Use startPageSequence(PageSequence) instead + * @deprecated Use {@link #startPageSequence(PageSequence)} instead */ void startPageSequence(LineArea seqTitle); @@ -162,7 +162,7 @@ public interface Renderer { /** * Tells the renderer to render a particular page. A renderer typically - * reponds by packing up the current page and writing it immediately to the + * responds by packing up the current page and writing it immediately to the * output device. * * @param page The page to be rendered diff --git a/src/java/org/apache/fop/render/RendererEventProducer.java b/src/java/org/apache/fop/render/RendererEventProducer.java index c61e4a8ee..87b01b1cc 100644 --- a/src/java/org/apache/fop/render/RendererEventProducer.java +++ b/src/java/org/apache/fop/render/RendererEventProducer.java @@ -30,7 +30,10 @@ import org.apache.fop.events.EventProducer; public interface RendererEventProducer extends EventProducer { /** Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java b/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java index 235218cfc..aad31f18e 100644 --- a/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java +++ b/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java @@ -35,7 +35,8 @@ import org.apache.fop.render.afp.extensions.AFPElementMapping; * Parses any AFP foreign attributes */ public class AFPForeignAttributeReader { - private static final Log log = LogFactory.getLog("org.apache.xmlgraphics.afp"); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog("org.apache.xmlgraphics.afp"); /** the resource-name attribute */ public static final QName RESOURCE_NAME = new QName( diff --git a/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java b/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java index cb7b23da2..09b93d41a 100644 --- a/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java +++ b/src/java/org/apache/fop/render/afp/AFPImageHandlerRenderedImage.java @@ -86,9 +86,10 @@ public class AFPImageHandlerRenderedImage extends AFPImageHandler implements Ima return imageObjectInfo; } - private AFPDataObjectInfo updateDataObjectInfo(AFPImageObjectInfo imageObjectInfo, - AFPPaintingState paintingState, ImageRendered imageRendered, Dimension targetSize) - throws IOException { + private AFPDataObjectInfo updateDataObjectInfo // CSOK: MethodLength + (AFPImageObjectInfo imageObjectInfo, + AFPPaintingState paintingState, ImageRendered imageRendered, Dimension targetSize) + throws IOException { long start = System.currentTimeMillis(); diff --git a/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java b/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java index 67c19843b..4e4e1de31 100644 --- a/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java +++ b/src/java/org/apache/fop/render/afp/AFPImageHandlerSVG.java @@ -65,7 +65,7 @@ public class AFPImageHandlerSVG implements ImageHandler { BatikImageFlavors.SVG_DOM }; - /** {@inheritDoc} */ + /** @return a new AFP data object info instance */ protected AFPDataObjectInfo createDataObjectInfo() { return new AFPGraphicsObjectInfo(); } diff --git a/src/java/org/apache/fop/render/afp/AFPInfo.java b/src/java/org/apache/fop/render/afp/AFPInfo.java index fb1ec87a8..53a1aa046 100644 --- a/src/java/org/apache/fop/render/afp/AFPInfo.java +++ b/src/java/org/apache/fop/render/afp/AFPInfo.java @@ -256,7 +256,8 @@ public final class AFPInfo { public boolean strokeText() { boolean strokeText = false; if (handlerConfiguration != null) { - strokeText = handlerConfiguration.getChild("stroke-text", true).getValueAsBoolean(strokeText); + strokeText + = handlerConfiguration.getChild("stroke-text", true).getValueAsBoolean(strokeText); } return strokeText; } @@ -286,8 +287,9 @@ public final class AFPInfo { * @return a newly created AFPGraphics2D */ public AFPGraphics2D createGraphics2D(boolean textAsShapes) { - AFPGraphics2D g2d = new AFPGraphics2D( - textAsShapes, paintingState, resourceManager, resourceInfo, fontInfo); + AFPGraphics2D g2d + = new AFPGraphics2D + (textAsShapes, paintingState, resourceManager, resourceInfo, fontInfo); g2d.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext()); return g2d; } diff --git a/src/java/org/apache/fop/render/afp/AFPPainter.java b/src/java/org/apache/fop/render/afp/AFPPainter.java index 22a5e0a58..21bc4ab48 100644 --- a/src/java/org/apache/fop/render/afp/AFPPainter.java +++ b/src/java/org/apache/fop/render/afp/AFPPainter.java @@ -281,7 +281,8 @@ public class AFPPainter extends AbstractIFPainter { return mpt / 1000f; } - 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) throws IOException { BorderPaintingInfo borderPaintInfo = new BorderPaintingInfo( toPoints(x1), toPoints(y1), toPoints(x2), toPoints(y2), @@ -316,9 +317,9 @@ public class AFPPainter extends AbstractIFPainter { } /** {@inheritDoc} */ - public void drawText(int x, int y, - final int letterSpacing, final int wordSpacing, final int[] dx, - final String text) throws IFException { + public void drawText // CSOK: MethodLength + (int x, int y, final int letterSpacing, final int wordSpacing, final int[] dx, + final String text) throws IFException { final int fontSize = this.state.getFontSize(); getPaintingState().setFontSize(fontSize); diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java index 1f373023c..df6cf2c5f 100644 --- a/src/java/org/apache/fop/render/afp/AFPRenderer.java +++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java @@ -404,9 +404,11 @@ public class AFPRenderer extends AbstractPathOrientedRenderer implements AFPCust } /** {@inheritDoc} */ - public void drawBorderLine(float x1, float y1, float x2, float y2, - boolean horz, boolean startOrBefore, int style, Color col) { - BorderPaintingInfo borderPaintInfo = new BorderPaintingInfo(x1, y1, x2, y2, horz, style, col); + public void drawBorderLine // CSOK: ParameterNumber + (float x1, float y1, float x2, float y2, + boolean horz, boolean startOrBefore, int style, Color col) { + BorderPaintingInfo borderPaintInfo + = new BorderPaintingInfo(x1, y1, x2, y2, horz, style, col); borderPainter.paint(borderPaintInfo); } @@ -654,7 +656,8 @@ public class AFPRenderer extends AbstractPathOrientedRenderer implements AFPCust textDataInfo.setString(textString); try { - dataStream.createText(textDataInfo, textLetterSpaceAdjust, textWordSpaceAdjust, fnt, charSet); + dataStream.createText + (textDataInfo, textLetterSpaceAdjust, textWordSpaceAdjust, fnt, charSet); } catch (UnsupportedEncodingException e) { AFPEventProducer eventProducer = AFPEventProducer.Provider.get(userAgent.getEventBroadcaster()); @@ -784,7 +787,8 @@ public class AFPRenderer extends AbstractPathOrientedRenderer implements AFPCust if (AFPElementMapping.INCLUDE_PAGE_OVERLAY.equals(element)) { String overlay = ipo.getName(); if (overlay != null) { - dataStream.createIncludePageOverlay(overlay, ipo.getX(), ipo.getY()); + dataStream.createIncludePageOverlay + (overlay, ipo.getX(), ipo.getY()); } } } diff --git a/src/java/org/apache/fop/render/afp/AFPRenderingContext.java b/src/java/org/apache/fop/render/afp/AFPRenderingContext.java index 35be58c22..22a91dd83 100644 --- a/src/java/org/apache/fop/render/afp/AFPRenderingContext.java +++ b/src/java/org/apache/fop/render/afp/AFPRenderingContext.java @@ -43,6 +43,7 @@ public class AFPRenderingContext extends AbstractRenderingContext { * Main constructor. * @param userAgent the user agent * @param resourceManager the resource manager + * @param paintingState the painting state * @param fontInfo the font list * @param foreignAttributes a map of foreign attributes */ @@ -70,6 +71,7 @@ public class AFPRenderingContext extends AbstractRenderingContext { return this.resourceManager; } + /** @return painting state */ public AFPPaintingState getPaintingState() { return this.paintingState; } diff --git a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java index f76c4a89a..587c57e5b 100644 --- a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java +++ b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java @@ -174,7 +174,8 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler { return objectAreaInfo; } - private AFPGraphicsObjectInfo createGraphicsObjectInfo(AFPPaintingState paintingState, Graphics2DImagePainter painter, + private AFPGraphicsObjectInfo createGraphicsObjectInfo + (AFPPaintingState paintingState, Graphics2DImagePainter painter, FOUserAgent userAgent, AFPResourceInfo resourceInfo, AFPGraphics2D g2d) { AFPGraphicsObjectInfo graphicsObjectInfo = new AFPGraphicsObjectInfo(); @@ -193,6 +194,11 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler { return graphicsObjectInfo; } + /** + * @param userAgent a user agent instance + * @param g2d a graphics context + * @return a bridge context + */ public static BridgeContext createBridgeContext(FOUserAgent userAgent, AFPGraphics2D g2d) { ImageManager imageManager = userAgent.getFactory().getImageManager(); diff --git a/src/java/org/apache/fop/render/awt/AWTRenderer.java b/src/java/org/apache/fop/render/awt/AWTRenderer.java index b50708112..0128cf90e 100644 --- a/src/java/org/apache/fop/render/awt/AWTRenderer.java +++ b/src/java/org/apache/fop/render/awt/AWTRenderer.java @@ -60,10 +60,10 @@ public class AWTRenderer extends Java2DRenderer implements Pageable { public static final String MIME_TYPE = MimeConstants.MIME_FOP_AWT_PREVIEW; /** flag for debugging */ - public boolean debug; + public boolean debug; // CSOK: VisibilityModifier /** If true, preview dialog is shown. */ - public boolean dialogDisplay = true; + public boolean dialogDisplay = true; // CSOK: VisibilityModifier /** true if the preview dialog should be the main window of the application */ private boolean previewAsMainWindow; 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 a96d73a46..9b3cac0a0 100644 --- a/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java +++ b/src/java/org/apache/fop/render/awt/viewer/ImageProxyPanel.java @@ -106,7 +106,7 @@ public class ImageProxyPanel extends JPanel { /** * Gets the image data and paints it on screen. Will make * calls to getPageImage as required. - * @param graphics + * @param graphics a graphics context * @see javax.swing.JComponent#paintComponent(Graphics) * @see org.apache.fop.render.java2d.Java2DRenderer#getPageImage(int) */ diff --git a/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java b/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java index 031021a6f..32f31ce4c 100644 --- a/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java +++ b/src/java/org/apache/fop/render/awt/viewer/PreviewDialog.java @@ -17,11 +17,12 @@ /* $Id$ */ +package org.apache.fop.render.awt.viewer; + // Originally contributed by: // Juergen Verwohlt: Juergen.Verwohlt@jCatalog.com, // Rainer Steinkuhle: Rainer.Steinkuhle@jCatalog.com, // Stanislav Gorkhover: Stanislav.Gorkhover@jCatalog.com -package org.apache.fop.render.awt.viewer; // Java import java.awt.BorderLayout; @@ -105,7 +106,8 @@ public class PreviewDialog extends JFrame implements StatusListener { * @param renderable the Renderable instance that is used to reload/re-render a document * after modifications. */ - public PreviewDialog(FOUserAgent foUserAgent, Renderable renderable) { + public PreviewDialog // CSOK: MethodLength + (FOUserAgent foUserAgent, Renderable renderable) { renderer = (AWTRenderer) foUserAgent.getRendererOverride(); this.foUserAgent = foUserAgent; this.configuredTargetResolution = this.foUserAgent.getTargetResolution(); @@ -579,7 +581,10 @@ public class PreviewDialog extends JFrame implements StatusListener { } } - /** Prints the document */ + /** + * Prints the document. + * @param showDialog true if show dialog + */ public void startPrinterJob(boolean showDialog) { //Restore originally configured target resolution float saveResolution = foUserAgent.getTargetResolution(); diff --git a/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java b/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java index 0808a7ac9..9a0b3b7bc 100644 --- a/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java +++ b/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java @@ -30,7 +30,10 @@ import org.apache.fop.events.EventProducer; public interface BitmapRendererEventProducer extends EventProducer { /** Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java b/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java deleted file mode 100644 index b85ee9d1c..000000000 --- a/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.fop.render.bitmap; - -import java.awt.image.RenderedImage; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import org.apache.xmlgraphics.image.codec.png.PNGEncodeParam; -import org.apache.xmlgraphics.image.codec.png.PNGImageEncoder; - -import org.apache.commons.io.IOUtils; - -import org.apache.fop.apps.FOPException; -import org.apache.fop.area.PageViewport; -import org.apache.fop.render.java2d.Java2DRenderer; - -/** - * PNG Renderer This class actually does not render itself, instead it extends - * <code>org.apache.fop.render.java2D.Java2DRenderer</code> and just encode - * rendering results into PNG format using Batik's image codec - */ -public class PNGRenderer_onthefly extends Java2DRenderer { - - /** The MIME type for png-Rendering */ - public static final String MIME_TYPE = "image/png"; - - /** The file syntax prefix, eg. "page" will output "page1.png" etc */ - private String fileSyntax; - - /** The output directory where images are to be written */ - private File outputDir; - - /** The PNGEncodeParam for the image */ - private PNGEncodeParam renderParams; - - /** The OutputStream for the first Image */ - private OutputStream firstOutputStream; - - /** {@inheritDoc} */ - public String getMimeType() { - return MIME_TYPE; - } - - /** {@inheritDoc} */ - public boolean supportsOutOfOrder() { - return true; - } - - /** {@inheritDoc} */ - public void startRenderer(OutputStream outputStream) throws IOException { - log.info("rendering areas to PNG"); - setOutputDirectory(); - this.firstOutputStream = outputStream; - } - - /** - * Sets the output directory, either from the outfile specified on the - * command line, or from the directory specified in configuration file. Also - * sets the file name syntax, eg. "page" - */ - private void setOutputDirectory() { - - // the file provided on the command line - File f = getUserAgent().getOutputFile(); - - outputDir = f.getParentFile(); - - // extracting file name syntax - String s = f.getName(); - int i = s.lastIndexOf("."); - if (s.charAt(i - 1) == '1') { - i--; // getting rid of the "1" - } - fileSyntax = s.substring(0, i); - } - - /** - * {@inheritDoc} - */ - public void renderPage(PageViewport pageViewport) throws IOException { - - // Do the rendering: get the image for this page - RenderedImage image = (RenderedImage) getPageImage(pageViewport); - - // Encode this image - log.debug("Encoding page" + (getCurrentPageNumber() + 1)); - renderParams = PNGEncodeParam.getDefaultEncodeParam(image); - OutputStream os = getCurrentOutputStream(getCurrentPageNumber()); - if (os != null) { - try { - PNGImageEncoder encoder = new PNGImageEncoder(os, renderParams); - encoder.encode(image); - } finally { - //Only close self-created OutputStreams - if (os != firstOutputStream) { - IOUtils.closeQuietly(os); - } - } - } - - setCurrentPageNumber(getCurrentPageNumber() + 1); - } - - /** - * Builds the OutputStream corresponding to this page - * @param pageNumber the 0-based page number - * @return the corresponding OutputStream - */ - private OutputStream getCurrentOutputStream(int pageNumber) { - - if (pageNumber == 0) { - return firstOutputStream; - } - - File f = new File(outputDir + File.separator + fileSyntax - + (pageNumber + 1) + ".png"); - try { - OutputStream os = new BufferedOutputStream(new FileOutputStream(f)); - return os; - } catch (FileNotFoundException e) { - new FOPException("Can't build the OutputStream\n" + e); - return null; - } - } -} diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java index c524ccc3a..7dd3bcd95 100644 --- a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java +++ b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java @@ -219,10 +219,12 @@ public class TIFFRenderer extends Java2DRenderer implements TIFFConstants { } } + /** @param bufferedImageType an image type */ public void setBufferedImageType(int bufferedImageType) { this.bufferedImageType = bufferedImageType; } + /** @return image writer parameters */ public ImageWriterParams getWriterParams() { return writerParams; } diff --git a/src/java/org/apache/fop/render/intermediate/BorderPainter.java b/src/java/org/apache/fop/render/intermediate/BorderPainter.java index 75f773291..ad37b1dc1 100644 --- a/src/java/org/apache/fop/render/intermediate/BorderPainter.java +++ b/src/java/org/apache/fop/render/intermediate/BorderPainter.java @@ -41,7 +41,7 @@ public abstract class BorderPainter { * @param bpsEnd the border specification on the end side * @throws IOException if an I/O error occurs while creating the borders */ - public void drawBorders(Rectangle borderRect, + public void drawBorders(Rectangle borderRect, // CSOK: MethodLength BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd) throws IOException { int startx = borderRect.x; @@ -217,8 +217,9 @@ public abstract class BorderPainter { * @param color the border color * @throws IOException if an I/O error occurs */ - protected abstract void drawBorderLine(int x1, int y1, int x2, int y2, - boolean horz, boolean startOrBefore, int style, Color color) throws IOException; + protected abstract void drawBorderLine // CSOK: ParameterNumber + (int x1, int y1, int x2, int y2, + boolean horz, boolean startOrBefore, int style, Color color) throws IOException; /** * Draws a line/rule. diff --git a/src/java/org/apache/fop/render/intermediate/IFConstants.java b/src/java/org/apache/fop/render/intermediate/IFConstants.java index fa234b4db..34fe2bd2c 100644 --- a/src/java/org/apache/fop/render/intermediate/IFConstants.java +++ b/src/java/org/apache/fop/render/intermediate/IFConstants.java @@ -33,22 +33,39 @@ public interface IFConstants extends XMLConstants { /** XML namespace of the intermediate format. */ String NAMESPACE = "http://xmlgraphics.apache.org/fop/intermediate"; + /** element name document */ String EL_DOCUMENT = "document"; + /** element name header */ String EL_HEADER = "header"; + /** element name trailer */ String EL_TRAILER = "trailer"; + /** element name page-sequence */ String EL_PAGE_SEQUENCE = "page-sequence"; + /** element name page */ String EL_PAGE = "page"; + /** element name page-header */ String EL_PAGE_HEADER = "page-header"; + /** element name page-trailer */ String EL_PAGE_TRAILER = "page-trailer"; + /** element name content */ String EL_PAGE_CONTENT = "content"; + /** element name viewport */ String EL_VIEWPORT = "viewport"; + /** element name group */ String EL_GROUP = "g"; + /** element name image */ String EL_IMAGE = "image"; + /** element name clip-rect */ String EL_CLIP_RECT = "clip-rect"; + /** element name rect */ String EL_RECT = "rect"; + /** element name line */ String EL_LINE = "line"; + /** element name border-rect */ String EL_BORDER_RECT = "border-rect"; + /** element name font */ String EL_FONT = "font"; + /** element name text */ String EL_TEXT = "text"; /** Parent element of the logical structure tree. */ String EL_STRUCTURE_TREE = "structure-tree"; diff --git a/src/java/org/apache/fop/render/intermediate/IFContentHandler.java b/src/java/org/apache/fop/render/intermediate/IFContentHandler.java index 55c65d82a..ac7feb269 100644 --- a/src/java/org/apache/fop/render/intermediate/IFContentHandler.java +++ b/src/java/org/apache/fop/render/intermediate/IFContentHandler.java @@ -24,62 +24,74 @@ import org.xml.sax.ContentHandler; import org.xml.sax.Locator; import org.xml.sax.SAXException; +/** intermediate format content handler */ public class IFContentHandler implements ContentHandler { + /** {@inheritDoc} */ public void characters(char[] arg0, int arg1, int arg2) throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void endDocument() throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void endElement(String arg0, String arg1, String arg2) throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void endPrefixMapping(String arg0) throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void processingInstruction(String arg0, String arg1) throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void setDocumentLocator(Locator arg0) { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void skippedEntity(String arg0) throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void startDocument() throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException { // TODO Auto-generated method stub } + /** {@inheritDoc} */ public void startPrefixMapping(String arg0, String arg1) throws SAXException { // TODO Auto-generated method stub diff --git a/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java b/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java index eef13e105..09a641ce2 100644 --- a/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java +++ b/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java @@ -45,8 +45,16 @@ public interface IFDocumentNavigationHandler { */ void renderBookmarkTree(BookmarkTree tree) throws IFException; + /** + * @param link a link + * @throws IFException of not caught + */ void renderLink(Link link) throws IFException; + /** + * @param action an action + * @throws IFException of not caught + */ void addResolvedAction(AbstractAction action) throws IFException; } diff --git a/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java b/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java index 34ac0bcb2..6e431e513 100644 --- a/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java +++ b/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java @@ -56,6 +56,7 @@ public class IFGraphicContext extends GraphicContext { return new IFGraphicContext(this); } + /** @param group a group */ public void pushGroup(Group group) { //this.groupDepth++; this.groupList.add(group); @@ -64,44 +65,66 @@ public class IFGraphicContext extends GraphicContext { } } + /** @return array of groups */ public Group[] getGroups() { return (Group[])this.groupList.toArray(new Group[getGroupStackSize()]); } + /** @return array of groups after clearing group list */ public Group[] dropGroups() { Group[] groups = getGroups(); this.groupList.clear(); return groups; } + /** @return size of group list */ public int getGroupStackSize() { return this.groupList.size(); } + /** a group */ public static class Group { private AffineTransform[] transforms; + /** + * Construct a Group. + * @param transforms an array of transforms + */ public Group(AffineTransform[] transforms) { this.transforms = transforms; } + /** + * Construct a Group. + * @param transform a transform + */ public Group(AffineTransform transform) { this(new AffineTransform[] {transform}); } + /** Default constructor. */ public Group() { this(EMPTY_TRANSFORM_ARRAY); } + /** @return array of transforms */ public AffineTransform[] getTransforms() { return this.transforms; } + /** + * @param painter a painter + * @throws IFException in not caught + */ public void start(IFPainter painter) throws IFException { painter.startGroup(transforms); } + /** + * @param painter a painter + * @throws IFException in not caught + */ public void end(IFPainter painter) throws IFException { painter.endGroup(); } @@ -115,33 +138,50 @@ public class IFGraphicContext extends GraphicContext { } + /** a viewport */ public static class Viewport extends Group { private Dimension size; private Rectangle clipRect; + /** + * Construct a viewport. + * @param transforms an array of transforms + * @param size a dimension + * @param clipRect a clip rectangle + */ public Viewport(AffineTransform[] transforms, Dimension size, Rectangle clipRect) { super(transforms); this.size = size; this.clipRect = clipRect; } + /** + * Construct a viewport. + * @param transform a transform + * @param size a dimension + * @param clipRect a clip rectangle + */ public Viewport(AffineTransform transform, Dimension size, Rectangle clipRect) { this(new AffineTransform[] {transform}, size, clipRect); } + /** @return the viewport's size */ public Dimension getSize() { return this.size; } + /** @return the clip rectangle */ public Rectangle getClipRect() { return this.clipRect; } + /** {@inheritDoc} */ public void start(IFPainter painter) throws IFException { painter.startViewport(getTransforms(), size, clipRect); } + /** {@inheritDoc} */ public void end(IFPainter painter) throws IFException { painter.endViewport(); } diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java index 13ac401a7..23a5da3e3 100644 --- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -1238,7 +1238,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer { } /** {@inheritDoc} */ - protected void drawBorders(float startx, float starty, + protected void drawBorders // CSOK: ParameterNumber + (float startx, float starty, float width, float height, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd) { @@ -1251,7 +1252,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer { } /** {@inheritDoc} */ - protected void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz, + protected void drawBorderLine // CSOK: ParameterNumber + (float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, Color col) { //Simplified implementation that is only used by renderTextDecoration() //drawBorders() is overridden and uses the Painter's high-level method drawBorderRect() diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java index 37806cb8e..edeef9766 100644 --- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java +++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java @@ -633,8 +633,11 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler } } - /** {@inheritDoc} */ - protected RenderingContext createRenderingContext() { + /** + * @return a new rendering context + * @throws IllegalStateException unless overridden + */ + protected RenderingContext createRenderingContext() throws IllegalStateException { throw new IllegalStateException("Should never be called!"); } diff --git a/src/java/org/apache/fop/render/intermediate/IFState.java b/src/java/org/apache/fop/render/intermediate/IFState.java index aa073d03c..c13382192 100644 --- a/src/java/org/apache/fop/render/intermediate/IFState.java +++ b/src/java/org/apache/fop/render/intermediate/IFState.java @@ -21,7 +21,8 @@ package org.apache.fop.render.intermediate; import java.awt.Color; -public class IFState { +/** a state class for intermediate format data */ +public final class IFState { private IFState parent; @@ -50,22 +51,27 @@ public class IFState { this.textColor = parent.textColor; } + /** @return create state */ public static IFState create() { return new IFState(); } + /** @return push state */ public IFState push() { return new IFState(this); } + /** @return pop state */ public IFState pop() { return this.parent; } + /** @return true if font changed */ public boolean isFontChanged() { return this.fontChanged; } + /** reset font changed */ public void resetFontChanged() { this.fontChanged = false; } diff --git a/src/java/org/apache/fop/render/intermediate/IFUtil.java b/src/java/org/apache/fop/render/intermediate/IFUtil.java index 955193000..1867b0294 100644 --- a/src/java/org/apache/fop/render/intermediate/IFUtil.java +++ b/src/java/org/apache/fop/render/intermediate/IFUtil.java @@ -30,7 +30,10 @@ import org.apache.fop.util.DecimalFormatCache; /** * Utility functions for the intermediate format. */ -public class IFUtil { +public final class IFUtil { + + private IFUtil() { + } private static String format(double value) { if (value == -0.0) { diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java index 1d9d7d56e..6394964ac 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 { 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..e4576373d 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/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java index 4cb0c988e..cbd50c954 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java +++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java @@ -536,7 +536,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 diff --git a/src/java/org/apache/fop/render/pcl/HardcodedFonts.java b/src/java/org/apache/fop/render/pcl/HardcodedFonts.java index a1c5a6059..429d36167 100644 --- a/src/java/org/apache/fop/render/pcl/HardcodedFonts.java +++ b/src/java/org/apache/fop/render/pcl/HardcodedFonts.java @@ -28,10 +28,14 @@ import org.apache.commons.logging.LogFactory; * This class hold code for selecting a set of hard-coded fonts available in practically all * PCL implementations. We hope this can be improved in the future. */ -class HardcodedFonts { +final class HardcodedFonts { + + private HardcodedFonts() { + } /** logging instance */ - private static Log log = LogFactory.getLog(HardcodedFonts.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(HardcodedFonts.class); /** * Sets the current font (NOTE: Hard-coded font mappings ATM!) diff --git a/src/java/org/apache/fop/render/pcl/PCLEventProducer.java b/src/java/org/apache/fop/render/pcl/PCLEventProducer.java index 8afe0bb94..520c63baa 100644 --- a/src/java/org/apache/fop/render/pcl/PCLEventProducer.java +++ b/src/java/org/apache/fop/render/pcl/PCLEventProducer.java @@ -28,7 +28,10 @@ import org.apache.fop.events.EventProducer; public interface PCLEventProducer extends EventProducer { /** Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/render/pcl/PCLPainter.java b/src/java/org/apache/fop/render/pcl/PCLPainter.java index b58b7f495..d0e82ed7d 100644 --- a/src/java/org/apache/fop/render/pcl/PCLPainter.java +++ b/src/java/org/apache/fop/render/pcl/PCLPainter.java @@ -396,10 +396,11 @@ public class PCLPainter extends AbstractIFPainter implements PCLConstants { private static final double SAFETY_MARGIN_FACTOR = 0.05; - private Rectangle getTextBoundingBox(int x, int y, - int letterSpacing, int wordSpacing, int[] dx, - String text, - Font font, FontMetricsMapper metrics) { + private Rectangle getTextBoundingBox // CSOK: ParameterNumber + (int x, int y, + int letterSpacing, int wordSpacing, int[] dx, + String text, + Font font, FontMetricsMapper metrics) { int maxAscent = metrics.getMaxAscent(font.getFontSize()) / 1000; int descent = metrics.getDescender(font.getFontSize()) / 1000; //is negative int safetyMargin = (int)(SAFETY_MARGIN_FACTOR * font.getFontSize()); diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderer.java b/src/java/org/apache/fop/render/pcl/PCLRenderer.java index 831dc99b4..659997e8f 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRenderer.java +++ b/src/java/org/apache/fop/render/pcl/PCLRenderer.java @@ -445,7 +445,7 @@ public class PCLRenderer extends PrintRenderer implements PCLConstants { /** * {@inheritDoc} - * @todo Copied from AbstractPathOrientedRenderer + * @asf.todo Copied from AbstractPathOrientedRenderer */ protected void handleRegionTraits(RegionViewport region) { Rectangle2D viewArea = region.getViewArea(); @@ -723,7 +723,7 @@ public class PCLRenderer extends PrintRenderer implements PCLConstants { * Render an inline viewport. * This renders an inline viewport by clipping if necessary. * @param viewport the viewport to handle - * @todo Copied from AbstractPathOrientedRenderer + * @asf.todo Copied from AbstractPathOrientedRenderer */ public void renderViewport(Viewport viewport) { @@ -1062,7 +1062,7 @@ public class PCLRenderer extends PrintRenderer implements PCLConstants { * The all borders and padding are drawn outside the specified area. * @param area the inline area for which the background, border and padding is to be * rendered - * @todo Copied from AbstractPathOrientedRenderer + * @asf.todo Copied from AbstractPathOrientedRenderer */ protected void renderInlineAreaBackAndBorders(InlineArea area) { float x = currentIPPosition / 1000f; @@ -1245,7 +1245,8 @@ public class PCLRenderer extends PrintRenderer implements PCLConstants { * @param bpsStart the border specification on the start side * @param bpsEnd the border specification on the end side */ - protected void drawQualityBorders(Rectangle2D.Float borderRect, + protected void drawQualityBorders // CSOK: MethodLength + (Rectangle2D.Float borderRect, final BorderProps bpsBefore, final BorderProps bpsAfter, final BorderProps bpsStart, final BorderProps bpsEnd) { Graphics2DAdapter g2a = getGraphics2DAdapter(); @@ -1277,7 +1278,8 @@ public class PCLRenderer extends PrintRenderer implements PCLConstants { Graphics2DImagePainter painter = new Graphics2DImagePainter() { - public void paint(Graphics2D g2d, Rectangle2D area) { + public void paint // CSOK: MethodLength + (Graphics2D g2d, Rectangle2D area) { g2d.translate(xoffset, yoffset); g2d.scale(1000, 1000); float startx = effBorderRect.x; diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java b/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java index 014b267dd..8ac7fc973 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java +++ b/src/java/org/apache/fop/render/pcl/PCLRenderingContext.java @@ -41,6 +41,7 @@ public abstract class PCLRenderingContext extends AbstractRenderingContext { * Main constructor. * @param userAgent the user agent * @param generator the PCL generator + * @param pclUtil rendering utility */ public PCLRenderingContext(FOUserAgent userAgent, PCLGenerator generator, PCLRenderingUtil pclUtil) { diff --git a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java index 165236359..00dfdfa03 100644 --- a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java +++ b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java @@ -165,7 +165,7 @@ public abstract class AbstractImageAdapter implements PDFImage { return null; } - /** {@inheritDoc} */ + /** @return null (if not overridden) */ public String getSoftMask() { return null; } diff --git a/src/java/org/apache/fop/render/pdf/CTMHelper.java b/src/java/org/apache/fop/render/pdf/CTMHelper.java index ced025ea3..5f1706905 100644 --- a/src/java/org/apache/fop/render/pdf/CTMHelper.java +++ b/src/java/org/apache/fop/render/pdf/CTMHelper.java @@ -33,6 +33,10 @@ import org.apache.fop.pdf.PDFNumber; * @see org.apache.fop.area.CTM */ public final class CTMHelper { + + private CTMHelper() { + } + /** * <p>Converts the sourceMatrix to a string for use in the PDFRenderer cm operations.</p> * <p>For example: diff --git a/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java b/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java index d1b2e87dd..10db33b0f 100644 --- a/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java +++ b/src/java/org/apache/fop/render/pdf/PDFBorderPainter.java @@ -37,25 +37,36 @@ import org.apache.fop.util.ColorUtil; public class PDFBorderPainter extends BorderPainter { /** logging instance */ - private static Log log = LogFactory.getLog(PDFBorderPainter.class); + private static final Log log // CSOK: ConstantName + = LogFactory.getLog(PDFBorderPainter.class); private PDFContentGenerator generator; + /** + * Construct a border painter. + * @param generator a pdf content generator + */ public PDFBorderPainter(PDFContentGenerator generator) { this.generator = generator; } /** {@inheritDoc} */ - protected void drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, - boolean startOrBefore, int style, Color col) { + protected void drawBorderLine // CSOK: ParameterNumber + (int x1, int y1, int x2, int y2, boolean horz, + boolean startOrBefore, int style, Color col) { drawBorderLine(generator, x1 / 1000f, y1 / 1000f, x2 / 1000f, y2 / 1000f, horz, startOrBefore, style, col); } - /** {@inheritDoc} */ - public static void drawBorderLine(PDFContentGenerator generator, - float x1, float y1, float x2, float y2, boolean horz, - boolean startOrBefore, int style, Color col) { + /** + * @param generator pdf content generator + * @see BorderPainter#drawBorderLine + */ + public static void drawBorderLine // CSOK: ParameterNumber|MethodLength + (PDFContentGenerator generator, + float x1, float y1, float x2, float y2, boolean horz, // CSOK: JavadocMethod + boolean startOrBefore, int style, Color col) { // CSOK: JavadocMethod + float colFactor; float w = x2 - x1; float h = y2 - y1; if ((w < 0) || (h < 0)) { @@ -146,8 +157,7 @@ public class PDFBorderPainter extends BorderPainter { break; case Constants.EN_GROOVE: case Constants.EN_RIDGE: - { - float colFactor = (style == Constants.EN_GROOVE ? 0.4f : -0.4f); + colFactor = (style == Constants.EN_GROOVE ? 0.4f : -0.4f); generator.add("[] 0 d "); if (horz) { Color uppercol = ColorUtil.lightenColor(col, -colFactor); @@ -181,11 +191,9 @@ public class PDFBorderPainter extends BorderPainter { + format(xm1 + w3 + w3) + " " + format(y2) + " l S\n"); } break; - } case Constants.EN_INSET: case Constants.EN_OUTSET: - { - float colFactor = (style == Constants.EN_OUTSET ? 0.4f : -0.4f); + colFactor = (style == Constants.EN_OUTSET ? 0.4f : -0.4f); generator.add("[] 0 d "); Color c = col; if (horz) { @@ -204,7 +212,6 @@ public class PDFBorderPainter extends BorderPainter { + format(xm1) + " " + format(y2) + " l S\n"); } break; - } case Constants.EN_HIDDEN: break; default: diff --git a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java index fb5fc4e8d..074faa5d3 100644 --- a/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java +++ b/src/java/org/apache/fop/render/pdf/PDFContentGenerator.java @@ -115,7 +115,7 @@ public class PDFContentGenerator { } /** - * Returns the {@link PDFState} associated with this instance. + * Returns the {@link PDFPaintingState} associated with this instance. * @return the PDF state */ public PDFPaintingState getState() { @@ -148,14 +148,18 @@ public class PDFContentGenerator { } } - /** {@inheritDoc} */ + /** Save graphics state. */ protected void saveGraphicsState() { endTextObject(); currentState.save(); currentStream.add("q\n"); } - /** {@inheritDoc} */ + /** + * Save graphics state. + * @param structElemType an element type + * @param sequenceNum a sequence number + */ protected void saveGraphicsState(String structElemType, int sequenceNum) { endTextObject(); currentState.save(); diff --git a/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java b/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java index 42b873270..ba9584597 100644 --- a/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java +++ b/src/java/org/apache/fop/render/pdf/PDFLogicalStructureHandler.java @@ -87,12 +87,12 @@ class PDFLogicalStructureHandler { * operator. This is the structure type of the corresponding structure * element. */ - final String tag; + final String tag; // CSOK: VisibilityModifier /** * The value for the MCID entry of the marked-content sequence's property list. */ - final int mcid; + final int mcid; // CSOK: VisibilityModifier private final PDFStructElem parent; diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java index b0809c10f..1aa5ac74e 100644 --- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java +++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java @@ -484,7 +484,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer implements PDFConf public void renderPage(PageViewport page) throws IOException, FOPException { if (pages != null - && (currentPage = (PDFPage) pages.get(page)) != null) { + && (currentPage = (PDFPage) pages.get(page)) != null) { // CSOK: InnerAssignment //Retrieve previously prepared page (out-of-line rendering) pages.remove(page); } else { @@ -566,7 +566,8 @@ public class PDFRenderer extends AbstractPathOrientedRenderer implements PDFConf } /** {@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) { PDFBorderPainter.drawBorderLine(generator, x1, y1, x2, y2, horz, startOrBefore, style, col); } diff --git a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java index f9fa8bfeb..6b14566eb 100644 --- a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java +++ b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java @@ -97,33 +97,33 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler */ public static class PDFInfo { /** see PDF_DOCUMENT */ - public PDFDocument pdfDoc; + public PDFDocument pdfDoc; // CSOK: VisibilityModifier /** see OUTPUT_STREAM */ - public OutputStream outputStream; + public OutputStream outputStream; // CSOK: VisibilityModifier /** see PDF_PAGE */ - public PDFPage pdfPage; + public PDFPage pdfPage; // CSOK: VisibilityModifier /** see PDF_CONTEXT */ - public PDFResourceContext pdfContext; + public PDFResourceContext pdfContext; // CSOK: VisibilityModifier /** see PDF_STREAM */ //public PDFStream currentStream; /** see PDF_WIDTH */ - public int width; + public int width; // CSOK: VisibilityModifier /** see PDF_HEIGHT */ - public int height; + public int height; // CSOK: VisibilityModifier /** see PDF_FONT_INFO */ - public FontInfo fi; + public FontInfo fi; // CSOK: VisibilityModifier /** see PDF_FONT_NAME */ - public String currentFontName; + public String currentFontName; // CSOK: VisibilityModifier /** see PDF_FONT_SIZE */ - public int currentFontSize; + public int currentFontSize; // CSOK: VisibilityModifier /** see PDF_XPOS */ - public int currentXPosition; + public int currentXPosition; // CSOK: VisibilityModifier /** see PDF_YPOS */ - public int currentYPosition; + public int currentYPosition; // CSOK: VisibilityModifier /** see PDF_HANDLER_CONFIGURATION */ - public Configuration cfg; + public Configuration cfg; // CSOK: VisibilityModifier /** true if SVG should be rendered as a bitmap instead of natively */ - public boolean paintAsBitmap; + public boolean paintAsBitmap; // CSOK: VisibilityModifier } /** diff --git a/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileElement.java b/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileElement.java index d2c51aba4..b2d85dd10 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileElement.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileElement.java @@ -37,6 +37,7 @@ import org.apache.fop.fo.extensions.ExtensionAttachment; */ public class PDFEmbeddedFileElement extends AbstractPDFExtensionElement { + /** name of element */ protected static final String ELEMENT = "embedded-file"; /** diff --git a/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileExtensionAttachment.java b/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileExtensionAttachment.java index b4572663a..5f3f16dbb 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileExtensionAttachment.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFEmbeddedFileExtensionAttachment.java @@ -129,7 +129,6 @@ public class PDFEmbeddedFileExtensionAttachment extends PDFExtensionAttachment { /** * @return the element name - * @see org.apache.fop.render.ps.extensions.PDFExtensionAttachment#getElement() */ protected String getElement() { return ELEMENT; diff --git a/src/java/org/apache/fop/render/ps/PSBorderPainter.java b/src/java/org/apache/fop/render/ps/PSBorderPainter.java index cddbe9cd1..f5d5169c4 100644 --- a/src/java/org/apache/fop/render/ps/PSBorderPainter.java +++ b/src/java/org/apache/fop/render/ps/PSBorderPainter.java @@ -52,8 +52,9 @@ public class PSBorderPainter extends BorderPainter { } /** {@inheritDoc} */ - protected void drawBorderLine(int x1, int y1, int x2, int y2, boolean horz, - boolean startOrBefore, int style, Color col) throws IOException { + protected void drawBorderLine // CSOK: ParameterNumber + (int x1, int y1, int x2, int y2, boolean horz, + boolean startOrBefore, int style, Color col) throws IOException { drawBorderLine(generator, toPoints(x1), toPoints(y1), toPoints(x2), toPoints(y2), horz, startOrBefore, style, col); } @@ -66,10 +67,15 @@ public class PSBorderPainter extends BorderPainter { + gen.formatDouble(endy) + " lineto stroke newpath"); } - /** {@inheritDoc} */ - public static void drawBorderLine(PSGenerator gen, - float x1, float y1, float x2, float y2, boolean horz, - boolean startOrBefore, int style, Color col) throws IOException { + /** + * @param gen ps content generator + * @see BorderPainter#drawBorderLine + */ + public static void drawBorderLine // CSOK: ParameterNumber + (PSGenerator gen, + float x1, float y1, float x2, float y2, boolean horz, // CSOK: JavadocMethod + boolean startOrBefore, int style, Color col) // CSOK: JavadocMethod + throws IOException { // CSOK: JavadocMethod float w = x2 - x1; float h = y2 - y1; if ((w < 0) || (h < 0)) { diff --git a/src/java/org/apache/fop/render/ps/PSBridgeContext.java b/src/java/org/apache/fop/render/ps/PSBridgeContext.java index 1ec6acadf..c0244db04 100644 --- a/src/java/org/apache/fop/render/ps/PSBridgeContext.java +++ b/src/java/org/apache/fop/render/ps/PSBridgeContext.java @@ -102,6 +102,7 @@ public class PSBridgeContext extends AbstractFOPBridgeContext { // Make sure any 'sub bridge contexts' also have our bridges. //TODO There's no matching method in the super-class here + /** @return a bridge context */ public BridgeContext createBridgeContext() { return new PSBridgeContext(getUserAgent(), getDocumentLoader(), fontInfo, diff --git a/src/java/org/apache/fop/render/ps/PSEventProducer.java b/src/java/org/apache/fop/render/ps/PSEventProducer.java index f04205e1c..512a4a687 100644 --- a/src/java/org/apache/fop/render/ps/PSEventProducer.java +++ b/src/java/org/apache/fop/render/ps/PSEventProducer.java @@ -28,7 +28,10 @@ import org.apache.fop.events.EventProducer; public interface PSEventProducer extends EventProducer { /** Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/render/ps/PSFontUtils.java b/src/java/org/apache/fop/render/ps/PSFontUtils.java index a29210b41..8acc390d0 100644 --- a/src/java/org/apache/fop/render/ps/PSFontUtils.java +++ b/src/java/org/apache/fop/render/ps/PSFontUtils.java @@ -351,8 +351,9 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { * @return the PSResource representing the derived font * @throws IOException In case of an I/O problem */ - public static PSResource defineDerivedFont(PSGenerator gen, String baseFontName, String fontName, - String encoding) throws IOException { + public static PSResource defineDerivedFont + (PSGenerator gen, String baseFontName, String fontName, String encoding) + throws IOException { PSResource res = new PSResource(PSResource.TYPE_FONT, fontName); gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE, res); gen.commentln("%XGCDependencies: font " + baseFontName); diff --git a/src/java/org/apache/fop/render/ps/PSImageHandler.java b/src/java/org/apache/fop/render/ps/PSImageHandler.java index ff94fdd2c..0aeafa6fa 100644 --- a/src/java/org/apache/fop/render/ps/PSImageHandler.java +++ b/src/java/org/apache/fop/render/ps/PSImageHandler.java @@ -30,7 +30,8 @@ import org.apache.fop.render.RenderingContext; * Specialized image handler interface for PostScript output. Implementations can optionally * support creating PostScript forms. The implementation shall check the rendering context * to see if forms functionality is enabled in the - * {@link #isCompatible(org.apache.fop.render.RenderingContext, org.apache.xmlgraphics.image.loader.Image)} + * {@link #isCompatible(org.apache.fop.render.RenderingContext, + * org.apache.xmlgraphics.image.loader.Image)} * method. */ public interface PSImageHandler extends ImageHandler { diff --git a/src/java/org/apache/fop/render/ps/PSPainter.java b/src/java/org/apache/fop/render/ps/PSPainter.java index 38b76fd8a..05a8121b8 100644 --- a/src/java/org/apache/fop/render/ps/PSPainter.java +++ b/src/java/org/apache/fop/render/ps/PSPainter.java @@ -403,9 +403,10 @@ public class PSPainter extends AbstractIFPainter { } } - private void writeText(String text, int start, int len, - int letterSpacing, int wordSpacing, int[] dx, - Font font, Typeface tf) throws IOException { + private void writeText // CSOK: ParameterNumber + (String text, int start, int len, + int letterSpacing, int wordSpacing, int[] dx, + Font font, Typeface tf) throws IOException { PSGenerator generator = getGenerator(); int end = start + len; int initialSize = len; diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java index 103d714bf..0703912ce 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderer.java +++ b/src/java/org/apache/fop/render/ps/PSRenderer.java @@ -597,8 +597,9 @@ public class PSRenderer extends AbstractPathOrientedRenderer } /** {@inheritDoc} */ - protected void drawBorderLine(float x1, float y1, float x2, float y2, - boolean horz, boolean startOrBefore, int style, Color col) { + protected void drawBorderLine // CSOK: ParameterNumber + (float x1, float y1, float x2, float y2, + boolean horz, boolean startOrBefore, int style, Color col) { try { PSBorderPainter.drawBorderLine(gen, x1, y1, x2, y2, horz, startOrBefore, style, col); } catch (IOException ioe) { diff --git a/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java b/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java index 433f2ce7c..3150e4273 100644 --- a/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java +++ b/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java @@ -27,10 +27,9 @@ import org.apache.fop.render.RendererContextConstants; public interface PSRendererContextConstants extends RendererContextConstants { /** The PostScript generator that is being used to drawn into. */ - public static final String PS_GENERATOR = "psGenerator"; + String PS_GENERATOR = "psGenerator"; /** The font information for the PostScript renderer. */ - public static final String PS_FONT_INFO = "psFontInfo"; - + String PS_FONT_INFO = "psFontInfo"; } diff --git a/src/java/org/apache/fop/render/ps/PSRenderingUtil.java b/src/java/org/apache/fop/render/ps/PSRenderingUtil.java index 696634a48..d7890d144 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderingUtil.java +++ b/src/java/org/apache/fop/render/ps/PSRenderingUtil.java @@ -229,6 +229,7 @@ public class PSRenderingUtil implements PSConfigurationConstants { this.dscCompliant = value; } + /** @return true if DSC complicance is enabled */ public boolean isDSCComplianceEnabled() { return this.dscCompliant; } diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java index 23418f4e3..6c009607b 100644 --- a/src/java/org/apache/fop/render/ps/PSTextPainter.java +++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java @@ -49,7 +49,7 @@ import org.apache.fop.svg.NativeTextPainter; import org.apache.fop.util.CharUtilities; /** - * Renders the attributed character iterator of a {@link TextNode}. + * Renders the attributed character iterator of a text node. * This class draws the text directly using PostScript text operators so * the text is not drawn using shapes which makes the PS files larger. * <p> diff --git a/src/java/org/apache/fop/render/rtf/RTFEventProducer.java b/src/java/org/apache/fop/render/rtf/RTFEventProducer.java index b2b47d7f2..5c12c4e2c 100644 --- a/src/java/org/apache/fop/render/rtf/RTFEventProducer.java +++ b/src/java/org/apache/fop/render/rtf/RTFEventProducer.java @@ -31,7 +31,10 @@ import org.apache.fop.fo.FONode; public interface RTFEventProducer extends EventProducer { /** Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index fc42a1b8f..5698329c8 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -1468,7 +1468,7 @@ public class RTFHandler extends FOEventHandler { * @param foNode FO node whose event is to be called * @param bStart TRUE calls the start handler, FALSE the end handler */ - private void invokeDeferredEvent(FONode foNode, boolean bStart) { + private void invokeDeferredEvent(FONode foNode, boolean bStart) { // CSOK: MethodLength if (foNode instanceof PageSequence) { if (bStart) { startPageSequence( (PageSequence) foNode); diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java index aec0237e5..f231a1f06 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java @@ -33,16 +33,15 @@ package org.apache.fop.render.rtf.rtflib.rtfdoc; * */ -public class ParagraphKeeptogetherContext { +public final class ParagraphKeeptogetherContext { private static int paraKeepTogetherOpen = 0; private static boolean paraResetProperties = false; private static ParagraphKeeptogetherContext instance = null; - ParagraphKeeptogetherContext() { + private ParagraphKeeptogetherContext() { } - /** * Singelton. * diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java index 78c747a30..e2a19389e 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java @@ -640,7 +640,7 @@ public class RtfExternalGraphic extends RtfElement { tmpUrl = new URL (urlString); } catch (MalformedURLException e) { try { - tmpUrl = new File (urlString).toURL (); + tmpUrl = new File (urlString).toURI().toURL (); } catch (MalformedURLException ee) { throw new ExternalGraphicException("The attribute 'src' of " + "<fo:external-graphic> has a invalid value: '" diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java index 631f2d901..c08008fee 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExtraRowSet.java @@ -102,6 +102,13 @@ public class RtfExtraRowSet extends RtfContainer { return result; } + public int hashCode() { + int hc = super.hashCode(); + hc ^= ( hc * 11 ) + xOffset; + hc ^= ( hc * 19 ) + rowIndex; + return hc; + } + public boolean equals(Object o) { return o != null && this.compareTo(o) == 0; } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java index d5eaa304d..9376f5564 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFile.java @@ -80,9 +80,10 @@ extends RtfContainer { * If called, must be called before startDocumentArea * @return the new RtfHeader * @throws IOException for I/O problems + * @throws RtfStructureException for illegal RTF structure */ public RtfHeader startHeader() - throws IOException { + throws IOException, RtfStructureException { if (header != null) { throw new RtfStructureException("startHeader called more than once"); } @@ -128,7 +129,7 @@ extends RtfContainer { * @throws RtfStructureException for illegal RTF structure */ public RtfPageArea startPageArea() - throws IOException { + throws IOException, RtfStructureException { if (pageArea != null) { throw new RtfStructureException("startPageArea called more than once"); } @@ -149,7 +150,7 @@ extends RtfContainer { * @throws RtfStructureException for illegal RTF structure */ public RtfPageArea getPageArea() - throws IOException { + throws IOException, RtfStructureException { if (pageArea == null) { return startPageArea(); } @@ -164,7 +165,7 @@ extends RtfContainer { * @throws RtfStructureException for illegal RTF structure */ public RtfDocumentArea startDocumentArea() - throws IOException { + throws IOException, RtfStructureException { if (docArea != null) { throw new RtfStructureException("startDocumentArea called more than once"); } @@ -187,7 +188,7 @@ extends RtfContainer { * @throws RtfStructureException for illegal RTF structure */ public RtfDocumentArea getDocumentArea() - throws IOException { + throws IOException, RtfStructureException { if (docArea == null) { return startDocumentArea(); } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java index 3fe8c6311..ed4aa64a9 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java @@ -17,7 +17,6 @@ /* $Id$ */ - package org.apache.fop.render.rtf.rtflib.rtfdoc; //Java @@ -33,16 +32,17 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun; */ public class RtfFootnote extends RtfContainer implements IRtfTextrunContainer, IRtfListContainer { - RtfTextrun textrunInline = null; - RtfContainer body = null; - RtfList list = null; - boolean bBody = false; + RtfTextrun textrunInline = null; // CSOK: VisibilityModifier + RtfContainer body = null; // CSOK: VisibilityModifier + RtfList list = null; // CSOK: VisibilityModifier + boolean bBody = false; // CSOK: VisibilityModifier /** * Create an RTF list item as a child of given container with default attributes. * @param parent a container * @param w a writer - * @throws IOException if not caught + * @return a text run + * @throw IOException if not caught */ RtfFootnote(RtfContainer parent, Writer w) throws IOException { super(parent, w); @@ -81,6 +81,11 @@ public class RtfFootnote extends RtfContainer writeGroupMark(false); } + /** + * @param attrs some attributes + * @return an rtf list + * @throws IOException if not caught + */ public RtfList newList(RtfAttributes attrs) throws IOException { if (list != null) { list.close(); @@ -91,10 +96,12 @@ public class RtfFootnote extends RtfContainer return list; } + /** start body */ public void startBody() { bBody = true; } + /** end body */ public void endBody() { bBody = false; } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java index 1dd00c66d..ce51f93a0 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfGenerator.java @@ -27,7 +27,12 @@ import java.io.Writer; */ public class RtfGenerator extends RtfElement { - /** Default constructor for the generator element. */ + /** + * Default constructor for the generator element. + * @param h a header + * @param w a writer + * @throws IOException if not caught + */ public RtfGenerator(RtfHeader h, Writer w) throws IOException { super(h, w); } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java index cd80c6993..a021948ab 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java @@ -57,7 +57,7 @@ implements IRtfTextContainer, /** - * Default constructor. + * A constructor. * * @param parent a <code>RtfContainer</code> value * @param writer a <code>Writer</code> value @@ -71,6 +71,14 @@ implements IRtfTextContainer, new RtfText (this, writer, str, attr); } + /** + * A constructor. + * + * @param parent a <code>RtfContainer</code> value + * @param writer a <code>Writer</code> value + * @param attr a <code>RtfAttributes</code> value + * @throws IOException for I/O problems + */ public RtfHyperLink (RtfTextrun parent, Writer writer, RtfAttributes attr) throws IOException { super ((RtfContainer) parent, writer, attr); @@ -217,8 +225,11 @@ implements IRtfTextContainer, return false; } - public RtfTextrun getTextrun() - throws IOException { + /** + * @return a text run + * @throws IOException if not caught + */ + public RtfTextrun getTextrun() throws IOException { RtfTextrun textrun = RtfTextrun.getTextrun(this, writer, null); return textrun; } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java index c7cc6d36f..7ef4b98b9 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.rtfdoc; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,8 +26,6 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.rtfdoc; - import java.io.IOException; import java.io.Writer; @@ -59,10 +58,12 @@ public class RtfString extends RtfElement { RtfStringConverter.getInstance().writeRtfString(writer, text); } + /** @return the text */ public String getText() { return text; } + /** @param s some text */ public void setText(String s) { text = s; } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java index 40460bb4d..9afe35b29 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.rtfdoc; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,8 +26,6 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.rtfdoc; - import java.util.Map; import java.util.HashMap; import java.io.IOException; @@ -36,9 +35,9 @@ import java.io.Writer; * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch */ -public class RtfStringConverter { - private static final RtfStringConverter INSTANCE = new RtfStringConverter(); +public final class RtfStringConverter { + private static final RtfStringConverter INSTANCE = new RtfStringConverter(); private static final Map SPECIAL_CHARS; private static final Character DBLQUOTE = new Character('\"'); private static final Character QUOTE = new Character('\''); diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java index b838fb8a4..30dee96d7 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.rtfdoc; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,8 +26,6 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.rtfdoc; - import java.util.Vector; import java.util.Hashtable; import java.io.IOException; @@ -37,7 +36,7 @@ import java.util.Iterator; * This class belongs to the <jfor:stylesheet> tag processing. * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a> */ -public class RtfStyleSheetTable { +public final class RtfStyleSheetTable { ////////////////////////////////////////////////// // @@ Symbolic constants ////////////////////////////////////////////////// diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java index a02d6db8f..74e9eca25 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.rtfdoc; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,8 +26,6 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.rtfdoc; - import java.io.IOException; /** @@ -34,7 +33,7 @@ import java.io.IOException; * This class belongs to the <jfor:style-template> tag processing. */ -public class RtfTemplate { +public final class RtfTemplate { /** Singelton instance */ private static RtfTemplate instance = null; diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java index b176e1ee2..f7c08d628 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.rtfdoc; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,8 +26,6 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.rtfdoc; - import java.io.IOException; import java.io.Writer; 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 a9ba432b1..4831ffd86 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 @@ -355,8 +355,8 @@ public class RtfTextrun extends RtfContainer { * Maybe this can be done more efficient. */ - boolean bHasTableCellParent = - this.getParentOfClass(RtfTableCell.class) != null; + boolean bHasTableCellParent + = this.getParentOfClass(RtfTableCell.class) != null; RtfAttributes attrBlockLevel = new RtfAttributes(); //determine, if this RtfTextrun is the last child of its parent diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java index 339434b69..723b4fb00 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.rtfdoc; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,8 +26,6 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.rtfdoc; - import java.util.Iterator; import java.util.StringTokenizer; @@ -34,11 +33,15 @@ import java.util.StringTokenizer; * @author Bertrand Delacretaz bdelacretaz@codeconsult.ch */ -class WhitespaceCollapser { +final class WhitespaceCollapser { + private static final String SPACE = " "; private boolean lastEndSpace = true; - /** remove extra whitespace in RtfText elements that are inside c */ + /** + * Remove extra whitespace in RtfText elements that are inside container. + * @param c the container + */ WhitespaceCollapser(RtfContainer c) { // process all texts for (Iterator it = c.getChildren().iterator(); it.hasNext();) { @@ -56,6 +59,11 @@ class WhitespaceCollapser { } } + /** @return last end space */ + public boolean getLastEndSpace() { + return lastEndSpace; + } + /** process one RtfText from our container */ private void processText(RtfText txt) { final String newString = processString(txt.getText()); diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java index 430231792..547c959d3 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java @@ -49,6 +49,10 @@ public class BuilderContext { /** Rtf options */ private IRtfOptions options; + /** + * Construct a builder context. + * @param rtfOptions some options + */ public BuilderContext(IRtfOptions rtfOptions) { options = rtfOptions; } @@ -82,9 +86,13 @@ public class BuilderContext { return result; }*/ - /** find the "nearest" container that implements the given interface on our stack - * @param required if true, ConverterException is thrown if no container found - * @param forWhichBuilder used in error message if container not found + /** + * Find the "nearest" container that implements the given interface on our stack. + * @param containerClass class of container + * @param required if true, ConverterException is thrown if no container found + * @param forWhichBuilder used in error message if container not found + * @return the container + * @throws RtfException if not caught */ public RtfContainer getContainer(Class containerClass, boolean required, Object /*IBuilder*/ forWhichBuilder) throws RtfException { @@ -103,7 +111,10 @@ public class BuilderContext { return result; } - /** push an RtfContainer on our stack */ + /** + * Push an RtfContainer on our stack. + * @param c the container + */ public void pushContainer(RtfContainer c) { containers.push(c); } @@ -115,6 +126,9 @@ public class BuilderContext { * paragraph container to handle what follows the nested block. * TODO: what happens to elements that are "more on top" than oldC on the * stack? shouldn't they be closed or something? + * @param oldC old container + * @param newC new container + * @throws Exception if not caught */ public void replaceContainer(RtfContainer oldC, RtfContainer newC) throws Exception { @@ -150,17 +164,23 @@ public class BuilderContext { return result; } */ - /** return the current TableContext */ + + /** @return the current TableContext */ public TableContext getTableContext() { return (TableContext)tableContexts.peek(); } - /** push a TableContext to our stack */ + /** + * Push a TableContext to our stack. + * @param tc the table context + */ public void pushTableContext(TableContext tc) { tableContexts.push(tc); } - /** pop a TableContext from our stack */ + /** + * Pop a TableContext from our stack. + */ public void popTableContext() { tableContexts.pop(); } diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java index 859472709..c3dadb652 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.tools; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,15 +26,12 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.tools; - - /** Here will be defined all supported image formats. * This class belongs to the <fo:external-graphic> tag processing. * @author a.putz@skynamics.com (Andreas Putz) */ -public class ImageConstants { +public final class ImageConstants { ////////////////////////////////////////////////// // @@ Symbolic constants ////////////////////////////////////////////////// diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java index c5e3cb191..82367e0ad 100644 --- a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java +++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java @@ -17,6 +17,7 @@ /* $Id$ */ +package org.apache.fop.render.rtf.rtflib.tools; /* * This file is part of the RTF library of the FOP project, which was originally @@ -25,13 +26,11 @@ * the FOP project. */ -package org.apache.fop.render.rtf.rtflib.tools; - /** Misc.utilities for images handling * This class belongs to the <fo:external-graphic> tag processing. * @author <a href="mailto:a.putz@skynamics.com">Andreas Putz</a> */ -public class ImageUtil { +public final class ImageUtil { ////////////////////////////////////////////////// // @@ Construction diff --git a/src/java/org/apache/fop/render/txt/TXTRenderer.java b/src/java/org/apache/fop/render/txt/TXTRenderer.java index 3e2fab230..b64eb172c 100644 --- a/src/java/org/apache/fop/render/txt/TXTRenderer.java +++ b/src/java/org/apache/fop/render/txt/TXTRenderer.java @@ -494,8 +494,9 @@ public class TXTRenderer extends AbstractPathOrientedRenderer { /** * {@inheritDoc} */ - protected void drawBorderLine(float x1, float y1, float x2, float y2, - boolean horz, boolean startOrBefore, int style, Color col) { + protected void drawBorderLine // CSOK: ParameterNumber + (float x1, float y1, float x2, float y2, + boolean horz, boolean startOrBefore, int style, Color col) { int borderHeight = bm.getHeight(); int borderWidth = bm.getWidth(); diff --git a/src/java/org/apache/fop/render/txt/TXTStream.java b/src/java/org/apache/fop/render/txt/TXTStream.java index 49e36be3a..a534d4108 100644 --- a/src/java/org/apache/fop/render/txt/TXTStream.java +++ b/src/java/org/apache/fop/render/txt/TXTStream.java @@ -71,10 +71,11 @@ public class TXTStream { * @param encoding the encoding, if null, "UTF-8" is chosen as default */ public void setEncoding(String encoding) { - if (encoding != null) + if (encoding != null) { this.encoding = encoding; - else + } else { this.encoding = DEFAULT_ENCODING; + } } } diff --git a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java index 4f62155a3..497e3c047 100644 --- a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java @@ -43,7 +43,9 @@ import org.xml.sax.SAXException; import org.xml.sax.ext.LexicalHandler; import org.xml.sax.helpers.AttributesImpl; +/** Abstract xml renderer base class. */ public abstract class AbstractXMLRenderer extends PrintRenderer { + /** Main namespace in use. */ public static final String NS = ""; @@ -62,6 +64,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer { /** The OutputStream to write the generated XML to. */ protected OutputStream out; + /** The renderer context. */ protected RendererContext context; /** A list of ExtensionAttachements received through processOffDocumentItem() */ @@ -237,7 +240,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer { } } - /** {@inheritDoc} */ + /** Handle document extension attachments. */ protected void handleDocumentExtensionAttachments() { if (extensionAttachments != null && extensionAttachments.size() > 0) { handleExtensionAttachments(extensionAttachments); diff --git a/src/java/org/apache/fop/svg/AbstractFOPBridgeContext.java b/src/java/org/apache/fop/svg/AbstractFOPBridgeContext.java index acb59ed7d..1622d4f51 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPBridgeContext.java +++ b/src/java/org/apache/fop/svg/AbstractFOPBridgeContext.java @@ -37,12 +37,13 @@ import org.apache.fop.fonts.FontInfo; */ public abstract class AbstractFOPBridgeContext extends BridgeContext { - /** The font list. */ + /** the font list */ protected final FontInfo fontInfo; - + /** image manager */ protected final ImageManager imageManager; + /** image session context */ protected final ImageSessionContext imageSessionContext; - + /** link transform */ protected final AffineTransform linkTransform; /** @@ -122,6 +123,10 @@ public abstract class AbstractFOPBridgeContext extends BridgeContext { return this.imageSessionContext; } + /** + * @param className name of bridge class to load and construct + * @param testFor class name to test for presence + */ protected void putElementBridgeConditional(String className, String testFor) { try { Class.forName(testFor); @@ -137,6 +142,7 @@ public abstract class AbstractFOPBridgeContext extends BridgeContext { // Make sure any 'sub bridge contexts' also have our bridges. //TODO There's no matching method in the super-class here + /** @return new bridge context */ public abstract BridgeContext createBridgeContext(); } diff --git a/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java b/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java index 31895cebe..c4191077f 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java +++ b/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java @@ -160,10 +160,15 @@ public abstract class AbstractFOPImageElementBridge extends SVGImageElementBridg */ public class LoaderImageNode extends AbstractGraphicsNode { + /** image */ protected final Image image; + /** bridge context */ protected final BridgeContext ctx; + /** image element */ protected final Element imageElement; + /** parsed url */ protected final ParsedURL purl; + /** original graphics mode */ protected GraphicsNode origGraphicsNode = null; /** diff --git a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java index eec402075..fc007b90a 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java +++ b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java @@ -129,7 +129,10 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder { this.resolver = resolver; } - /** {@inheritDoc} */ + /** + * @param cfg the configuration + * @throws ConfigurationException if not caught + */ public void configure(Configuration cfg) throws ConfigurationException { this.cfg = cfg; } diff --git a/src/java/org/apache/fop/svg/FOPTextHandler.java b/src/java/org/apache/fop/svg/FOPTextHandler.java index 8fa9eeedd..cb59c7472 100644 --- a/src/java/org/apache/fop/svg/FOPTextHandler.java +++ b/src/java/org/apache/fop/svg/FOPTextHandler.java @@ -19,9 +19,12 @@ package org.apache.fop.svg; +/** an fop extension to text handler */ public interface FOPTextHandler extends org.apache.xmlgraphics.java2d.TextHandler { + /** @param font override font */ void setOverrideFont(org.apache.fop.fonts.Font font); + /** @return font info */ org.apache.fop.fonts.FontInfo getFontInfo(); } diff --git a/src/java/org/apache/fop/svg/FOPTextHandlerAdapter.java b/src/java/org/apache/fop/svg/FOPTextHandlerAdapter.java new file mode 100644 index 000000000..6f326546e --- /dev/null +++ b/src/java/org/apache/fop/svg/FOPTextHandlerAdapter.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.svg; + +import org.apache.xmlgraphics.java2d.StrokingTextHandler; + +/** + * The <code>FOPTextHandlerAdapter</code> class is an adapter class to permit use of + * FOPTextHandler without incurring deprecation warnings caused by the underlying + * org.apache.xmlgraphics.java2d.TextHandler.drawString(String...) method. + * @see org.apache.xmlgraphics.java2d.TextHandler + */ +public abstract class FOPTextHandlerAdapter extends StrokingTextHandler implements FOPTextHandler { +} diff --git a/src/java/org/apache/fop/svg/GraphicsConfiguration.java b/src/java/org/apache/fop/svg/GraphicsConfiguration.java index 881096b9a..83fd79b9d 100644 --- a/src/java/org/apache/fop/svg/GraphicsConfiguration.java +++ b/src/java/org/apache/fop/svg/GraphicsConfiguration.java @@ -29,9 +29,12 @@ import java.awt.image.VolatileImage; * for JDK 1.3 because there is no VolatileImage there. * */ -abstract public class GraphicsConfiguration extends java.awt.GraphicsConfiguration { +public abstract class GraphicsConfiguration extends java.awt.GraphicsConfiguration { /** + * @param width of image + * @param height of image + * @return new volatile image * @see java.awt.GraphicsConfiguration#createCompatibleVolatileImage(int, int) * @since JDK 1.4 */ @@ -40,6 +43,10 @@ abstract public class GraphicsConfiguration extends java.awt.GraphicsConfigurati } /** + * @param width of image + * @param height of image + * @param transparency of image + * @return new volatile image * @see java.awt.GraphicsConfiguration#createCompatibleVolatileImage(int, int, int) * @since JDK 1.5 */ diff --git a/src/java/org/apache/fop/svg/NativeImageHandler.java b/src/java/org/apache/fop/svg/NativeImageHandler.java index 8e74cba1d..e9d8116e6 100644 --- a/src/java/org/apache/fop/svg/NativeImageHandler.java +++ b/src/java/org/apache/fop/svg/NativeImageHandler.java @@ -19,6 +19,7 @@ package org.apache.fop.svg; +/** native image handler */ public interface NativeImageHandler { /** diff --git a/src/java/org/apache/fop/svg/NativeTextPainter.java b/src/java/org/apache/fop/svg/NativeTextPainter.java index 7da7269c2..14fa6460d 100644 --- a/src/java/org/apache/fop/svg/NativeTextPainter.java +++ b/src/java/org/apache/fop/svg/NativeTextPainter.java @@ -190,6 +190,10 @@ public abstract class NativeTextPainter extends StrokingTextPainter { return chars; } + /** + * @param runaci an attributed character iterator + * @param layout a text span layout + */ protected final void logTextRun(AttributedCharacterIterator runaci, TextSpanLayout layout) { if (log.isTraceEnabled()) { int charCount = runaci.getEndIndex() - runaci.getBeginIndex(); @@ -202,6 +206,12 @@ public abstract class NativeTextPainter extends StrokingTextPainter { } } + /** + * @param ch a character + * @param layout a text span layout + * @param index an index + * @param visibleChar visible character flag + */ protected final void logCharacter(char ch, TextSpanLayout layout, int index, boolean visibleChar) { if (log.isTraceEnabled()) { diff --git a/src/java/org/apache/fop/svg/PDFBridgeContext.java b/src/java/org/apache/fop/svg/PDFBridgeContext.java index e8569f881..a38465ed4 100644 --- a/src/java/org/apache/fop/svg/PDFBridgeContext.java +++ b/src/java/org/apache/fop/svg/PDFBridgeContext.java @@ -125,6 +125,7 @@ public class PDFBridgeContext extends AbstractFOPBridgeContext { // Make sure any 'sub bridge contexts' also have our bridges. //TODO There's no matching method in the super-class here + /** @return the new bridge context */ public BridgeContext createBridgeContext() { return new PDFBridgeContext(getUserAgent(), getDocumentLoader(), fontInfo, diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java index b6dadac96..45189133a 100644 --- a/src/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java @@ -776,7 +776,7 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand * @param fill true if the paint should be set for filling * @return true if the paint is handled natively, false if the paint should be rasterized */ - protected boolean applyPaint(Paint paint, boolean fill) { + protected boolean applyPaint(Paint paint, boolean fill) { // CSOK: MethodLength preparePainting(); if (paint instanceof Color) { @@ -1053,6 +1053,11 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand return true; } + /** + * @param paint some paint + * @param shape a shape + * @return true (always) + */ protected boolean applyUnknownPaint(Paint paint, Shape shape) { preparePainting(); @@ -1200,6 +1205,8 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand case BasicStroke.CAP_SQUARE: currentStream.write(2 + " J\n"); break; + default: + break; } int lj = bs.getLineJoin(); @@ -1213,6 +1220,8 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand case BasicStroke.JOIN_BEVEL: currentStream.write(2 + " j\n"); break; + default: + break; } float lw = bs.getLineWidth(); currentStream.write(PDFNumber.doubleOut(lw) + " w\n"); @@ -1228,7 +1237,11 @@ public class PDFGraphics2D extends AbstractGraphics2D implements NativeImageHand drawInnerRenderedImage(key, img, xform); } - /** {@inheritDoc} */ + /** + * @param key a key + * @param img an image + * @param xform a transform + */ public void drawInnerRenderedImage(String key, RenderedImage img, AffineTransform xform) { preparePainting(); PDFXObject xObject = pdfDoc.getXObject(key); diff --git a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java index 4ec6ad634..a41b7e229 100644 --- a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java +++ b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java @@ -33,11 +33,11 @@ import java.awt.image.ColorModel; */ class PDFGraphicsConfiguration extends GraphicsConfiguration { // We use this to get a good colormodel.. - private static final BufferedImage BI_WITH_ALPHA = - new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); + private static final BufferedImage BI_WITH_ALPHA + = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); // We use this to get a good colormodel.. - private static final BufferedImage BI_WITHOUT_ALPHA = - new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + private static final BufferedImage BI_WITHOUT_ALPHA + = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); /** * Construct a buffered image with an alpha channel, unless diff --git a/src/java/org/apache/fop/svg/PDFGraphicsDevice.java b/src/java/org/apache/fop/svg/PDFGraphicsDevice.java index 1d3dd6196..538dd16c2 100644 --- a/src/java/org/apache/fop/svg/PDFGraphicsDevice.java +++ b/src/java/org/apache/fop/svg/PDFGraphicsDevice.java @@ -62,7 +62,7 @@ class PDFGraphicsDevice extends GraphicsDevice { * @return an array containing the one graphics configuration */ public GraphicsConfiguration[] getConfigurations() { - return new GraphicsConfiguration[]{ gc }; + return new GraphicsConfiguration[] {gc}; } /** diff --git a/src/java/org/apache/fop/svg/SVGEventProducer.java b/src/java/org/apache/fop/svg/SVGEventProducer.java index 27d7da215..743649717 100644 --- a/src/java/org/apache/fop/svg/SVGEventProducer.java +++ b/src/java/org/apache/fop/svg/SVGEventProducer.java @@ -30,7 +30,10 @@ public interface SVGEventProducer extends EventProducer { /** * Provider class for the event producer. */ - class Provider { + final class Provider { + + private Provider() { + } /** * Returns an event producer. diff --git a/src/java/org/apache/fop/svg/SVGUtilities.java b/src/java/org/apache/fop/svg/SVGUtilities.java index 97cd31eed..3401307cf 100644 --- a/src/java/org/apache/fop/svg/SVGUtilities.java +++ b/src/java/org/apache/fop/svg/SVGUtilities.java @@ -34,7 +34,11 @@ import org.apache.batik.util.XMLConstants; /** * Some utilities for creating svg DOM documents and elements. */ -public class SVGUtilities { +public final class SVGUtilities { + + private SVGUtilities() { + } + private static final String SVG_NS = SVGDOMImplementation.SVG_NAMESPACE_URI; /** @@ -43,7 +47,7 @@ public class SVGUtilities { * @param height the height of the root svg element * @return a new SVG Document */ - public static final Document createSVGDocument(float width, + public static Document createSVGDocument(float width, float height) { DOMImplementation impl = SVGDOMImplementation.getDOMImplementation(); Document doc = impl.createDocument(SVG_NS, "svg", null); @@ -60,9 +64,9 @@ public class SVGUtilities { * @param font the font * @return the width of the string in the given font */ - public static final float getStringWidth(String str, java.awt.Font font) { - Rectangle2D rect = - font.getStringBounds(str, 0, str.length(), + public static float getStringWidth(String str, java.awt.Font font) { + Rectangle2D rect + = font.getStringBounds(str, 0, str.length(), new FontRenderContext(new AffineTransform(), true, true)); return (float)rect.getWidth(); @@ -74,10 +78,10 @@ public class SVGUtilities { * @param font the font * @return the height of the string in the given font */ - public static final float getStringHeight(String str, + public static float getStringHeight(String str, java.awt.Font font) { - Rectangle2D rect = - font.getStringBounds(str, 0, str.length(), + Rectangle2D rect + = font.getStringBounds(str, 0, str.length(), new FontRenderContext(new AffineTransform(), true, true)); return (float)rect.getHeight(); @@ -89,7 +93,7 @@ public class SVGUtilities { * @param font the font * @return the bounds of the string */ - public static final Rectangle2D getStringBounds(String str, + public static Rectangle2D getStringBounds(String str, java.awt.Font font) { return font.getStringBounds(str, 0, str.length(), new FontRenderContext(new AffineTransform(), @@ -105,7 +109,7 @@ public class SVGUtilities { * @param y2 the end y position * @return the new line element */ - public static final Element createLine(Document doc, float x, float y, + public static Element createLine(Document doc, float x, float y, float x2, float y2) { Element ellipse = doc.createElementNS(SVG_NS, "line"); ellipse.setAttributeNS(null, "x1", "" + x); @@ -124,7 +128,7 @@ public class SVGUtilities { * @param ry the y axis radius * @return the new ellipse element */ - public static final Element createEllipse(Document doc, float cx, + public static Element createEllipse(Document doc, float cx, float cy, float rx, float ry) { Element ellipse = doc.createElementNS(SVG_NS, "ellipse"); ellipse.setAttributeNS(null, "cx", "" + cx); @@ -140,7 +144,7 @@ public class SVGUtilities { * @param str the string for the d attribute on the path * @return the new path element */ - public static final Element createPath(Document doc, String str) { + public static Element createPath(Document doc, String str) { Element path = doc.createElementNS(SVG_NS, "path"); path.setAttributeNS(null, "d", str); return path; @@ -154,7 +158,7 @@ public class SVGUtilities { * @param str the string * @return the new text element */ - public static final Element createText(Document doc, float x, float y, + public static Element createText(Document doc, float x, float y, String str) { Element textGraph = doc.createElementNS(SVG_NS, "text"); textGraph.setAttributeNS(null, "x", "" + x); @@ -173,7 +177,7 @@ public class SVGUtilities { * @param height the height of the rectangle * @return the new rectangle element */ - public static final Element createRect(Document doc, float x, float y, + public static Element createRect(Document doc, float x, float y, float width, float height) { Element border = doc.createElementNS(SVG_NS, "rect"); border.setAttributeNS(null, "x", "" + x); @@ -188,7 +192,7 @@ public class SVGUtilities { * @param doc the document to create the element * @return the new g element */ - public static final Element createG(Document doc) { + public static Element createG(Document doc) { Element border = doc.createElementNS(SVG_NS, "g"); return border; } @@ -200,7 +204,7 @@ public class SVGUtilities { * @param id the id of the clipping path * @return the new clip element */ - public static final Element createClip(Document doc, Element els, + public static Element createClip(Document doc, Element els, String id) { Element border = doc.createElementNS(SVG_NS, "clipPath"); border.setAttributeNS(null, "id", id); @@ -216,7 +220,7 @@ public class SVGUtilities { * @param height the height to set on the image * @return a new image element */ - public static final Element createImage(Document doc, String ref, + public static Element createImage(Document doc, String ref, float width, float height) { Element border = doc.createElementNS(SVG_NS, "image"); border.setAttributeNS(XMLConstants.XLINK_NAMESPACE_URI, "href", @@ -234,7 +238,7 @@ public class SVGUtilities { * @param width the width to wrap * @return the new element containing the wrapped text */ - public static final Element wrapText(Document doc, String str, + public static Element wrapText(Document doc, String str, java.awt.Font font, float width) { Element g = createG(doc); Element text; diff --git a/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java b/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java index 15f3434d9..df5027373 100644 --- a/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java +++ b/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java @@ -62,8 +62,9 @@ public class LineBreakStatus { /** * Check whether a line break may happen according to the rules described in - * the <a href="http://unicode.org/reports/tr14/#Algorithm">Unicode Line Breaking Algorithm</a>. - * The function returns the line breaking status of the point <em>before</em> the given character. + * the <a href="http://unicode.org/reports/tr14/#Algorithm">Unicode Line Breaking + * Algorithm</a>. The function returns the line breaking status of the point + * <em>before</em> the given character. * The algorithm is the table-driven algorithm, as described in * <a href="http://unicode.org/reports/tr14/#PairBasedImplementation"> * Unicode Technical Report #14</a>. diff --git a/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java b/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java index 49557a6c9..343191eea 100644 --- a/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java +++ b/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java @@ -29,8 +29,15 @@ package org.apache.fop.text.linebreak; * - commit BOTH changed files */ +// CSOFF: WhitespaceAfterCheck +// CSOFF: LineLengthCheck + +/** Line breaking utilities. */ public final class LineBreakUtils { + private LineBreakUtils() { + } + /** Break class constant */ public static final byte DIRECT_BREAK = 0; /** Break class constant */ @@ -44,179 +51,180 @@ public final class LineBreakUtils { /** Break class constant */ public static final byte EXPLICIT_BREAK = 5; - private static final byte PAIR_TABLE[][] = { - {0, 0, 0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Properties = new byte[512][]; - private static void init_0() { - lineBreakProperties[0] = new byte[] { 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 22, 6, 6, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 32, 11, 29, 2, 28, 27, 2, 29, 26, 8, 2, 28, 18, 15, 18, 33, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 18, 18, 2, 2, 2, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 28, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 4, 8, 2, 9}; - lineBreakProperties[1] = new byte[] { 9, 9, 9, 9, 9, 23, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 12, 26, 27, 28, 28, 28, 2, 1, 1, 2, 1, 29, 2, 4, 2, 2, 27, 28, 1, 1, 5, 2, 1, 1, 1, 1, 1, 29, 1, 1, 1, 26, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2}; + private static void init0() { + lineBreakProperties[0] = new byte[] { 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 23, 6, 6, 11, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 33, 12, 30, 2, 29, 28, 2, 30, 27, 10, 2, 29, 19, 16, 19, 34, 26, 26, 26, 26, 26, 26, 26, 26,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new byte[] { 0, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 0, 0, 0, 0, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 2, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[29] = new byte[] { 0, 30, 30, 0, 30, 0, 0, 30, 30, 0, 30, 0, 0, 30, 0, 0, 0, 0, 0, 0, 30, 30, 30, 30, 0, 30, 30, 30, 30, 30, 30, 30, 0, 30, 30, 30, 0, 30, 0, 30, 0, 0, 30, 30, 0, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 0, 30, 30, 30, 0, 0, 30, 30, 30, 30, 30, 0, 30, 0, 30, 30, 30, 30, 30, 30, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 30, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[30] = new byte[] { 2, 5, 5, 5, 5, 2, 5, 5, 12, 5, 5, 4, 12, 11, 11, 11, 11, 11, 12, 2, 11, 2, 2, 2, 9, 9, 2, 2, 2, 2, 2, 2, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 9, 2, 9, 2, 9, 26, 8, 26, 8, 9, 9, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4}; - lineBreakProperties[31] = new byte[] { 9, 9, 9, 9, 9, 4, 9, 9, 2, 2, 2, 2, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 4, 4, 2, 2, 2, 2, 2, 2, 9, 2, 2, 2, 2, 2, 2, 0, 2, 2, 5, 5, 4, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[32] = new byte[] { 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 4, 4, 2, 2, 2, 2, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30}; - lineBreakProperties[33] = new byte[] { 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 30, 30, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0}; - lineBreakProperties[34] = new byte[] { 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0, 0, 0, 0, 0, 19, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}; - lineBreakProperties[35] = new byte[] { 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 0, 0, 0, 0, 0, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[28] = new byte[] { 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 0, 0, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 2, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[29] = new byte[] { 0, 31, 31, 0, 31, 0, 0, 31, 31, 0, 31, 0, 0, 31, 0, 0, 0, 0, 0, 0, 31, 31, 31, 31, 0, 31, 31, 31, 31, 31, 31, 31, 0, 31, 31, 31, 0, 31, 0, 31, 0, 0, 31, 31, 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 31, 31, 31, 0, 0, 31, 31, 31, 31, 31, 0, 31, 0, 31, 31, 31, 31, 31, 31, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[30] = new byte[] { 2, 5, 5, 5, 5, 2, 5, 5, 13, 5, 5, 4, 13, 12, 12, 12, 12, 12, 13, 2, 12, 2, 2, 2, 9, 9, 2, 2, 2, 2, 2, 2, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 9, 2, 9, 2, 9, 27, 8, 27, 8, 9, 9, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4}; + lineBreakProperties[31] = new byte[] { 9, 9, 9, 9, 9, 4, 9, 9, 2, 2, 2, 2, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 4, 4, 2, 2, 2, 2, 2, 2, 9, 2, 2, 2, 2, 2, 2, 0, 2, 2, 5, 5, 4, 5, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[32] = new byte[] { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 4, 4, 2, 2, 2, 2, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31}; + lineBreakProperties[33] = new byte[] { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 31, 31, 31, 31, 31, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0}; + lineBreakProperties[34] = new byte[] { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22}; + lineBreakProperties[35] = new byte[] { 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}; lineBreakProperties[36] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; lineBreakProperties[37] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2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2, 2, 2, 2, 9, 9, 9, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[47] = new byte[] { 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 4, 4, 24, 30, 4, 2, 4, 28, 30, 30, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[48] = new byte[] { 2, 2, 11, 11, 4, 4, 5, 2, 11, 11, 2, 9, 9, 9, 12, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[49] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[50] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 2, 0, 0, 0, 11, 11, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 0, 0, 30, 30, 30, 30, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[51] = new byte[] { 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 0, 0, 0, 0, 0, 0, 30, 30, 30, 30, 30, 30, 30, 30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 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9}; + lineBreakProperties[47] = new byte[] { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 4, 4, 25, 31, 4, 2, 4, 29, 31, 31, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[48] = new byte[] { 2, 2, 12, 12, 4, 4, 5, 2, 12, 12, 2, 9, 9, 9, 13, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[49] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[50] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 2, 0, 0, 0, 12, 12, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 31, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[51] = new byte[] { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 0, 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 31, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; + lineBreakProperties[52] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 0, 0, 2, 2, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 9}; + lineBreakProperties[53] = new byte[] { 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[54] = new byte[] { 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 2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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[93] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[94] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; - lineBreakProperties[95] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0}; - lineBreakProperties[96] = new byte[] { 16, 8, 8, 16, 16, 24, 16, 16, 26, 8, 26, 8, 26, 8, 26, 8, 26, 8, 16, 16, 26, 8, 26, 8, 26, 8, 26, 8, 24, 26, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 9, 9, 9, 9, 9, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 24, 16, 16, 16, 0, 24, 16, 24, 16, 24, 16, 24, 16, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; - lineBreakProperties[97] = new byte[] { 16, 16, 16, 24, 16, 24, 16, 24, 16, 16, 16, 16, 16, 16, 24, 16, 16, 16, 16, 16, 16, 24, 24, 0, 0, 9, 9, 24, 24, 24, 24, 16, 24, 24, 16, 24, 16, 24, 16, 24, 16, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 16, 24, 16, 24, 16, 16, 16, 16, 16, 16, 24, 16, 16, 16, 16, 16, 16, 24, 24, 16, 16, 16, 16, 24, 24, 24, 24, 16}; - lineBreakProperties[98] = new byte[] { 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; - lineBreakProperties[99] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24}; - lineBreakProperties[100] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; - lineBreakProperties[101] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0}; - lineBreakProperties[155] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; - lineBreakProperties[319] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[320] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; - lineBreakProperties[329] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 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0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[92] = new byte[] { 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 27, 4, 2, 2, 30, 30, 2, 2, 30, 30, 27, 8, 27, 8, 27, 8, 27, 8, 4, 4, 4, 4, 12, 2, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[93] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[94] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}; + lineBreakProperties[95] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0}; + lineBreakProperties[96] = new byte[] { 17, 8, 8, 17, 17, 25, 17, 17, 27, 8, 27, 8, 27, 8, 27, 8, 27, 8, 17, 17, 27, 8, 27, 8, 27, 8, 27, 8, 25, 27, 8, 8, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 9, 9, 9, 9, 9, 9, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 25, 25, 17, 17, 17, 0, 25, 17, 25, 17, 25, 17, 25, 17, 25, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 25, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}; + lineBreakProperties[97] = new byte[] { 17, 17, 17, 25, 17, 25, 17, 25, 17, 17, 17, 17, 17, 17, 25, 17, 17, 17, 17, 17, 17, 25, 25, 0, 0, 9, 9, 25, 25, 25, 25, 17, 25, 25, 17, 25, 17, 25, 17, 25, 17, 25, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 25, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 25, 17, 25, 17, 25, 17, 17, 17, 17, 17, 17, 25, 17, 17, 17, 17, 17, 17, 25, 25, 17, 17, 17, 17, 25, 25, 25, 25, 17}; + lineBreakProperties[98] = new byte[] { 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}; + lineBreakProperties[99] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25}; + lineBreakProperties[100] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 1, 1, 1, 1, 1, 1, 1, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}; + lineBreakProperties[101] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0}; + lineBreakProperties[155] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; + lineBreakProperties[320] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 25, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17}; + lineBreakProperties[329] = new byte[] { 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 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 25, 25, 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[338] = new byte[] { 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[340] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 9, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 0, 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 0, 0, 2, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[344] = new byte[] { 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}; - lineBreakProperties[345] = new byte[] { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14}; - lineBreakProperties[346] = new byte[] { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}; - lineBreakProperties[347] = new byte[] { 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14}; - lineBreakProperties[348] = new byte[] { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}; - lineBreakProperties[349] = new byte[] { 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}; - lineBreakProperties[350] = new byte[] { 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}; - lineBreakProperties[431] = new byte[] { 14, 14, 14, 14, 14, 14, 14, 14, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - lineBreakProperties[432] = new byte[] { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31}; - lineBreakProperties[448] = new byte[] { 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35}; - lineBreakProperties[500] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; - lineBreakProperties[501] = new byte[] { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[336] = new byte[] { 2, 2, 9, 2, 2, 2, 9, 2, 2, 2, 2, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 28, 2, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 5, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[337] = new byte[] { 9, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0}; + lineBreakProperties[338] = new byte[] { 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0}; + lineBreakProperties[339] = new byte[] { 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 2, 2, 2, 2, 2, 2, 4, 4, 4, 2, 2, 2, 2, 0, 2, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[340] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 9, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 2, 4, 4, 4, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 0, 0}; + lineBreakProperties[341] = new byte[] { 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[343] = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 4, 9, 9, 0, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 0, 0, 0, 0, 0}; + lineBreakProperties[344] = new byte[] { 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; + lineBreakProperties[345] = new byte[] { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15}; + lineBreakProperties[346] = new byte[] { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; + lineBreakProperties[347] = new byte[] { 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15}; + lineBreakProperties[348] = new byte[] { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; + lineBreakProperties[349] = new byte[] { 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; + lineBreakProperties[350] = new byte[] { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; + lineBreakProperties[431] = new byte[] { 15, 15, 15, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 0, 0, 0, 0, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 0, 0, 0, 0}; + lineBreakProperties[432] = new byte[] { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}; + lineBreakProperties[448] = new byte[] { 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36}; lineBreakProperties[502] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 2, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; lineBreakProperties[503] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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8, 8, 18, 18, 11, 11, 26, 8, 17, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 16, 16, 16, 26, 8, 26, 8, 26, 8, 26, 8, 26, 8, 26, 8, 26, 8, 26, 8, 16, 16, 26, 8, 16, 16, 16, 16, 16, 16, 16, 8, 16, 8, 0, 24, 24, 11, 11, 16, 26, 8, 26, 8, 26, 8, 16, 16, 16, 16, 16, 16, 16, 16, 0, 16, 28, 27, 16, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; - lineBreakProperties[509] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 34}; - lineBreakProperties[510] = new byte[] { 0, 11, 16, 16, 28, 27, 16, 16, 26, 8, 16, 16, 8, 16, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 24, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 26, 16, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 35}; + lineBreakProperties[510] = new byte[] { 0, 12, 17, 17, 29, 28, 17, 17, 27, 8, 17, 17, 8, 17, 8, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 25, 25, 17, 17, 17, 12, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 27, 17, 8, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 27, 17, 8, 17, 27, 8, 8, 27, 8, 8, 25, 2, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; + lineBreakProperties[511] = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 25, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 0, 0, 0, 28, 29, 17, 17, 17, 29, 29, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 9, 7, 1, 0, 0}; } static { - init_0(); - init_1(); + init0(); + init1(); lineBreakProperties[3] = lineBreakProperties[2]; lineBreakProperties[4] = lineBreakProperties[2]; lineBreakProperties[8] = lineBreakProperties[2]; - lineBreakProperties[17] = lineBreakProperties[16]; lineBreakProperties[41] = lineBreakProperties[2]; lineBreakProperties[42] = lineBreakProperties[2]; lineBreakProperties[43] = lineBreakProperties[2]; - lineBreakProperties[53] = lineBreakProperties[16]; - lineBreakProperties[57] = lineBreakProperties[16]; + lineBreakProperties[44] = lineBreakProperties[2]; lineBreakProperties[58] = lineBreakProperties[2]; lineBreakProperties[60] = lineBreakProperties[2]; lineBreakProperties[61] = lineBreakProperties[2]; @@ -225,7 +233,7 @@ public final class LineBreakUtils { lineBreakProperties[82] = lineBreakProperties[2]; lineBreakProperties[84] = lineBreakProperties[2]; lineBreakProperties[85] = lineBreakProperties[2]; - lineBreakProperties[87] = lineBreakProperties[16]; + lineBreakProperties[87] = lineBreakProperties[17]; lineBreakProperties[102] = lineBreakProperties[94]; lineBreakProperties[103] = lineBreakProperties[94]; lineBreakProperties[104] = lineBreakProperties[94]; @@ -442,6 +450,7 @@ public final class LineBreakUtils { lineBreakProperties[316] = lineBreakProperties[94]; lineBreakProperties[317] = lineBreakProperties[94]; lineBreakProperties[318] = lineBreakProperties[94]; + lineBreakProperties[319] = lineBreakProperties[94]; lineBreakProperties[321] = lineBreakProperties[94]; lineBreakProperties[322] = lineBreakProperties[94]; lineBreakProperties[323] = lineBreakProperties[94]; @@ -453,10 +462,7 @@ public final class LineBreakUtils { lineBreakProperties[330] = lineBreakProperties[2]; lineBreakProperties[331] = lineBreakProperties[2]; lineBreakProperties[334] = lineBreakProperties[2]; - lineBreakProperties[339] = lineBreakProperties[16]; - lineBreakProperties[341] = lineBreakProperties[16]; - lineBreakProperties[342] = lineBreakProperties[16]; - lineBreakProperties[343] = lineBreakProperties[16]; + lineBreakProperties[342] = lineBreakProperties[17]; lineBreakProperties[351] = lineBreakProperties[344]; lineBreakProperties[352] = lineBreakProperties[345]; lineBreakProperties[353] = lineBreakProperties[346]; @@ -603,6 +609,8 @@ public final class LineBreakUtils { lineBreakProperties[497] = lineBreakProperties[448]; lineBreakProperties[498] = lineBreakProperties[94]; lineBreakProperties[499] = lineBreakProperties[94]; + lineBreakProperties[500] = lineBreakProperties[94]; + lineBreakProperties[501] = lineBreakProperties[94]; lineBreakProperties[504] = lineBreakProperties[2]; lineBreakProperties[505] = lineBreakProperties[2]; } @@ -626,68 +634,70 @@ public final class LineBreakUtils { /** Linebreak property constant */ public static final byte LINE_BREAK_PROPERTY_CM = 9; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_CR = 10; + public static final byte LINE_BREAK_PROPERTY_CP = 10; + /** Linebreak property constant */ + public static final byte LINE_BREAK_PROPERTY_CR = 11; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_EX = 11; + public static final byte LINE_BREAK_PROPERTY_EX = 12; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_GL = 12; + public static final byte LINE_BREAK_PROPERTY_GL = 13; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_H2 = 13; + public static final byte LINE_BREAK_PROPERTY_H2 = 14; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_H3 = 14; + public static final byte LINE_BREAK_PROPERTY_H3 = 15; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_HY = 15; + public static final byte LINE_BREAK_PROPERTY_HY = 16; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_ID = 16; + public static final byte LINE_BREAK_PROPERTY_ID = 17; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_IN = 17; + public static final byte LINE_BREAK_PROPERTY_IN = 18; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_IS = 18; + public static final byte LINE_BREAK_PROPERTY_IS = 19; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_JL = 19; + public static final byte LINE_BREAK_PROPERTY_JL = 20; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_JT = 20; + public static final byte LINE_BREAK_PROPERTY_JT = 21; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_JV = 21; + public static final byte LINE_BREAK_PROPERTY_JV = 22; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_LF = 22; + public static final byte LINE_BREAK_PROPERTY_LF = 23; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_NL = 23; + public static final byte LINE_BREAK_PROPERTY_NL = 24; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_NS = 24; + public static final byte LINE_BREAK_PROPERTY_NS = 25; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_NU = 25; + public static final byte LINE_BREAK_PROPERTY_NU = 26; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_OP = 26; + public static final byte LINE_BREAK_PROPERTY_OP = 27; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_PO = 27; + public static final byte LINE_BREAK_PROPERTY_PO = 28; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_PR = 28; + public static final byte LINE_BREAK_PROPERTY_PR = 29; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_QU = 29; + public static final byte LINE_BREAK_PROPERTY_QU = 30; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_SA = 30; + public static final byte LINE_BREAK_PROPERTY_SA = 31; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_SG = 31; + public static final byte LINE_BREAK_PROPERTY_SG = 32; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_SP = 32; + public static final byte LINE_BREAK_PROPERTY_SP = 33; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_SY = 33; + public static final byte LINE_BREAK_PROPERTY_SY = 34; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_WJ = 34; + public static final byte LINE_BREAK_PROPERTY_WJ = 35; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_XX = 35; + public static final byte LINE_BREAK_PROPERTY_XX = 36; /** Linebreak property constant */ - public static final byte LINE_BREAK_PROPERTY_ZW = 36; + public static final byte LINE_BREAK_PROPERTY_ZW = 37; - private static String lineBreakPropertyShortNames[] = {"AI", "AL", "B2", "BA", "BB", "BK", "CB", "CL", "CM", "CR", "EX", - "GL", "H2", "H3", "HY", "ID", "IN", "IS", "JL", "JT", "JV", "LF", "NL", "NS", "NU", "OP", "PO", "PR", "QU", "SA", "SG", "SP", - "SY", "WJ", "XX", "ZW"}; + private static String[] lineBreakPropertyShortNames = {"AI", "AL", "B2", "BA", "BB", "BK", "CB", "CL", "CM", + "CP", "CR", "EX", "GL", "H2", "H3", "HY", "ID", "IN", "IS", "JL", "JT", "JV", "LF", "NL", "NS", "NU", "OP", + "PO", "PR", "QU", "SA", "SG", "SP", "SY", "WJ", "XX", "ZW"}; - private static String lineBreakPropertyLongNames[] = {"Ambiguous","Alphabetic","Break_Both","Break_After","Break_Before", - "Mandatory_Break","Contingent_Break","Close_Punctuation","Combining_Mark","Carriage_Return","Exclamation", - "Glue","H2","H3","Hyphen","Ideographic","Inseparable","Infix_Numeric","JL","JT","JV","Line_Feed","Next_Line", - "Nonstarter","Numeric","Open_Punctuation","Postfix_Numeric","Prefix_Numeric","Quotation","Complex_Context", + private static String[] lineBreakPropertyLongNames = {"Ambiguous","Alphabetic","Break_Both","Break_After","Break_Before", + "Mandatory_Break","Contingent_Break","Close_Punctuation","Combining_Mark","Close_Parenthesis","Carriage_Return", + "Exclamation","Glue","H2","H3","Hyphen","Ideographic","Inseparable","Infix_Numeric","JL","JT","JV","Line_Feed", + "Next_Line","Nonstarter","Numeric","Open_Punctuation","Postfix_Numeric","Prefix_Numeric","Quotation","Complex_Context", "Surrogate","Space","Break_Symbols","Word_Joiner","Unknown","ZWSpace"}; /** diff --git a/src/java/org/apache/fop/tools/anttasks/FileCompare.java b/src/java/org/apache/fop/tools/anttasks/FileCompare.java index 697570fb7..44ed56f24 100644 --- a/src/java/org/apache/fop/tools/anttasks/FileCompare.java +++ b/src/java/org/apache/fop/tools/anttasks/FileCompare.java @@ -84,6 +84,7 @@ public class FileCompare { * @param f1 first file to compare * @param f2 second file to compare * @return true if files are same, false otherwise + * @throws IOException if not caught */ public static boolean compareFiles(File f1, File f2) throws IOException { return (compareFileSize(f1, f2) && compareBytes(f1, f2)); @@ -96,10 +97,10 @@ public class FileCompare { * @return true if files are same byte-by-byte, false otherwise */ private static boolean compareBytes(File file1, File file2) throws IOException { - BufferedInputStream file1Input = - new BufferedInputStream(new java.io.FileInputStream(file1)); - BufferedInputStream file2Input = - new BufferedInputStream(new java.io.FileInputStream(file2)); + BufferedInputStream file1Input + = new BufferedInputStream(new java.io.FileInputStream(file1)); + BufferedInputStream file2Input + = new BufferedInputStream(new java.io.FileInputStream(file2)); int charact1 = 0; int charact2 = 0; @@ -123,11 +124,7 @@ public class FileCompare { * @return true if files are same length, false otherwise */ private static boolean compareFileSize(File oldFile, File newFile) { - if (oldFile.length() != newFile.length()) { - return false; - } else { - return true; - } + return oldFile.length() == newFile.length(); } // end: compareBytes private boolean filesExist(File oldFile, File newFile) { @@ -167,8 +164,8 @@ public class FileCompare { File oldFile; File newFile; try { - PrintWriter results = - new PrintWriter(new java.io.FileWriter("results.html"), true); + PrintWriter results + = new PrintWriter(new java.io.FileWriter("results.html"), true); this.writeHeader(results); for (int i = 0; i < filenameList.length; i++) { oldFile = new File(referenceDirectory + filenameList[i]); diff --git a/src/java/org/apache/fop/tools/anttasks/Fop.java b/src/java/org/apache/fop/tools/anttasks/Fop.java index d13bd8a56..c0a1ba9f7 100644 --- a/src/java/org/apache/fop/tools/anttasks/Fop.java +++ b/src/java/org/apache/fop/tools/anttasks/Fop.java @@ -267,8 +267,7 @@ public class Fop extends Task { /** * Set whether exceptions are thrown. * default is false. - * - * @param force true if always generate. + * @param throwExceptions true if should be thrown */ public void setThrowexceptions(boolean throwExceptions) { this.throwExceptions = throwExceptions; @@ -308,6 +307,7 @@ public class Fop extends Task { /** * Returns the message type corresponding to Project.MSG_* * representing the current message level. + * @return message type * @see org.apache.tools.ant.Project */ public int getMessageType() { @@ -553,13 +553,13 @@ class FOPTaskStarter { // OR output file doesn't exist OR // output file is older than input file if (task.getForce() || !outf.exists() - || (task.getXmlFile().lastModified() > outf.lastModified() || - task.getXsltFile().lastModified() > outf.lastModified())) { + || (task.getXmlFile().lastModified() > outf.lastModified() + || task.getXsltFile().lastModified() > outf.lastModified())) { render(task.getXmlFile(), task.getXsltFile(), outf, outputFormat); actioncount++; } else if (outf.exists() - && (task.getXmlFile().lastModified() <= outf.lastModified() || - task.getXsltFile().lastModified() <= outf.lastModified())) { + && (task.getXmlFile().lastModified() <= outf.lastModified() + || task.getXsltFile().lastModified() <= outf.lastModified())) { skippedcount++; } } @@ -639,7 +639,8 @@ class FOPTaskStarter { } } - private void renderInputHandler(InputHandler inputHandler, File outFile, String outputFormat) throws Exception { + private void renderInputHandler + (InputHandler inputHandler, File outFile, String outputFormat) throws Exception { OutputStream out = null; try { out = new java.io.FileOutputStream(outFile); @@ -690,10 +691,12 @@ class FOPTaskStarter { try { renderInputHandler(inputHandler, outFile, outputFormat); } catch (Exception ex) { - logger.error("Error rendering xml/xslt files: " + xmlFile + ", " + xsltFile, ex); + logger.error("Error rendering xml/xslt files: " + + xmlFile + ", " + xsltFile, ex); } if (task.getLogFiles()) { - task.log("xml: " + xmlFile + ", xslt: " + xsltFile + " -> " + outFile, Project.MSG_INFO); + task.log("xml: " + xmlFile + ", xslt: " + + xsltFile + " -> " + outFile, Project.MSG_INFO); } } } diff --git a/src/java/org/apache/fop/traits/BorderProps.java b/src/java/org/apache/fop/traits/BorderProps.java index 5bd4feec5..25ac86ced 100644 --- a/src/java/org/apache/fop/traits/BorderProps.java +++ b/src/java/org/apache/fop/traits/BorderProps.java @@ -42,13 +42,13 @@ public class BorderProps implements Serializable { public static final int COLLAPSE_OUTER = 2; /** Border style (one of EN_*) */ - public int style; // Enum for border style + public int style; // Enum for border style // CSOK: VisibilityModifier /** Border color */ - public Color color; + public Color color; // CSOK: VisibilityModifier /** Border width */ - public int width; + public int width; // CSOK: VisibilityModifier /** Border mode (one of SEPARATE, COLLAPSE_INNER and COLLAPSE_OUTER) */ - public int mode; + public int mode; // CSOK: VisibilityModifier /** * Constructs a new BorderProps instance. diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java index 0f0422799..99fab1adf 100644 --- a/src/java/org/apache/fop/traits/MinOptMax.java +++ b/src/java/org/apache/fop/traits/MinOptMax.java @@ -56,7 +56,8 @@ public final class MinOptMax implements Serializable { * @return the corresponding instance * @throws IllegalArgumentException if <code>min > opt || max < opt</code>. */ - public static MinOptMax getInstance(int min, int opt, int max) { + public static MinOptMax getInstance(int min, int opt, int max) + throws IllegalArgumentException { if (min > opt) { throw new IllegalArgumentException("min (" + min + ") > opt (" + opt + ")"); } @@ -167,7 +168,8 @@ public final class MinOptMax implements Serializable { * @throws ArithmeticException if this instance has strictly less shrink or stretch * than the operand */ - public MinOptMax minus(MinOptMax operand) { + public MinOptMax minus(MinOptMax operand) + throws ArithmeticException { checkCompatibility(getShrink(), operand.getShrink(), "shrink"); checkCompatibility(getStretch(), operand.getStretch(), "stretch"); return new MinOptMax(min - operand.min, opt - operand.opt, max - operand.max); @@ -197,9 +199,11 @@ public final class MinOptMax implements Serializable { * @param minOperand the minimal value to be added. * @return an instance with the given value added to the minimal value. * @throws IllegalArgumentException if <code>min + minOperand > opt || max < opt</code>. - * @deprecated Do not use! It's only for backwards compatibility. */ - public MinOptMax plusMin(int minOperand) { + // [GA] remove deprecation - no alternative specified + // @deprecated Do not use! It's only for backwards compatibility. + public MinOptMax plusMin(int minOperand) + throws IllegalArgumentException { return getInstance(min + minOperand, opt, max); } @@ -209,9 +213,11 @@ public final class MinOptMax implements Serializable { * @param minOperand the minimal value to be subtracted. * @return an instance with the given value subtracted to the minimal value. * @throws IllegalArgumentException if <code>min - minOperand > opt || max < opt</code>. - * @deprecated Do not use! It's only for backwards compatibility. */ - public MinOptMax minusMin(int minOperand) { + // [GA] remove deprecation - no alternative specified + // @deprecated Do not use! It's only for backwards compatibility. + public MinOptMax minusMin(int minOperand) + throws IllegalArgumentException { return getInstance(min - minOperand, opt, max); } @@ -221,9 +227,11 @@ public final class MinOptMax implements Serializable { * @param maxOperand the maximal value to be added. * @return an instance with the given value added to the maximal value. * @throws IllegalArgumentException if <code>min > opt || max < opt + maxOperand</code>. - * @deprecated Do not use! It's only for backwards compatibility. */ - public MinOptMax plusMax(int maxOperand) { + // [GA] remove deprecation - no alternative specified + // @deprecated Do not use! It's only for backwards compatibility. + public MinOptMax plusMax(int maxOperand) + throws IllegalArgumentException { return getInstance(min, opt, max + maxOperand); } @@ -233,9 +241,11 @@ public final class MinOptMax implements Serializable { * @param maxOperand the maximal value to be subtracted. * @return an instance with the given value subtracted to the maximal value. * @throws IllegalArgumentException if <code>min > opt || max < opt - maxOperand</code>. - * @deprecated Do not use! It's only for backwards compatibility. */ - public MinOptMax minusMax(int maxOperand) { + // [GA] remove deprecation - no alternative specified + // @deprecated Do not use! It's only for backwards compatibility. + public MinOptMax minusMax(int maxOperand) + throws IllegalArgumentException { return getInstance(min, opt, max - maxOperand); } @@ -246,7 +256,8 @@ public final class MinOptMax implements Serializable { * @return the product of this <code>MinOptMax</code> and the given factor * @throws IllegalArgumentException if the factor is negative */ - public MinOptMax mult(int factor) { + public MinOptMax mult(int factor) + throws IllegalArgumentException { if (factor < 0) { throw new IllegalArgumentException("factor < 0; was: " + factor); } else if (factor == 1) { diff --git a/src/java/org/apache/fop/traits/SpaceVal.java b/src/java/org/apache/fop/traits/SpaceVal.java index cb709c73e..f9f5c4991 100644 --- a/src/java/org/apache/fop/traits/SpaceVal.java +++ b/src/java/org/apache/fop/traits/SpaceVal.java @@ -65,9 +65,9 @@ public class SpaceVal { /** * Constructor for SpaceVal objects based on the full set of properties. * @param space space to use - * @param bConditional Conditionality value - * @param bForcing Forcing value - * @param iPrecedence Precedence value + * @param conditional Conditionality value + * @param forcing Forcing value + * @param precedence Precedence value */ public SpaceVal(MinOptMax space, boolean conditional, boolean forcing, int precedence) { this.space = space; @@ -76,6 +76,12 @@ public class SpaceVal { this.precedence = precedence; } + /** + * @param wordSpacing property + * @param letterSpacing space value + * @param fs font + * @return space value + */ public static SpaceVal makeWordSpacing(Property wordSpacing, SpaceVal letterSpacing, Font fs) { if (wordSpacing.getEnum() == Constants.EN_NORMAL) { // give word spaces the possibility to shrink by a third, @@ -89,6 +95,10 @@ public class SpaceVal { } } + /** + * @param letterSpacing property + * @return space value + */ public static SpaceVal makeLetterSpacing(Property letterSpacing) { if (letterSpacing.getEnum() == Constants.EN_NORMAL) { // letter spaces are set to zero (or use different values?) diff --git a/src/java/org/apache/fop/traits/TraitEnum.java b/src/java/org/apache/fop/traits/TraitEnum.java index 18fdffaab..c473228cb 100644 --- a/src/java/org/apache/fop/traits/TraitEnum.java +++ b/src/java/org/apache/fop/traits/TraitEnum.java @@ -21,6 +21,8 @@ package org.apache.fop.traits; import java.io.Serializable; +import org.apache.fop.fo.Constants; + /** Base class for enumeration classes representing traits. */ public abstract class TraitEnum implements Serializable { diff --git a/src/java/org/apache/fop/util/AbstractPaintingState.java b/src/java/org/apache/fop/util/AbstractPaintingState.java index c0c3c7fc8..5944b546c 100644 --- a/src/java/org/apache/fop/util/AbstractPaintingState.java +++ b/src/java/org/apache/fop/util/AbstractPaintingState.java @@ -340,7 +340,7 @@ public abstract class AbstractPaintingState implements Cloneable, Serializable { /** * Sets the current state data * - * @param currentData state data + * @param data the state data */ protected void setData(AbstractData data) { this.data = data; @@ -468,6 +468,7 @@ public abstract class AbstractPaintingState implements Cloneable, Serializable { /** * Sets the current AffineTransform. + * @param baseTransform the transform */ public void setTransform(AffineTransform baseTransform) { this.transform = baseTransform; diff --git a/src/java/org/apache/fop/util/ColorExt.java b/src/java/org/apache/fop/util/ColorExt.java index e8f929ad1..6f4e21382 100644 --- a/src/java/org/apache/fop/util/ColorExt.java +++ b/src/java/org/apache/fop/util/ColorExt.java @@ -118,9 +118,10 @@ public final class ColorExt extends Color { * ICC color values * @return the requested color object */ - public static ColorExt createFromSvgIccColor(float red, float green, - float blue, float opacity, String profileName, String profileHref, - ColorSpace profileCS, float[] colorValues) { + public static ColorExt createFromSvgIccColor // CSOK: ParameterNumber + (float red, float green, + float blue, float opacity, String profileName, String profileHref, + ColorSpace profileCS, float[] colorValues) { //TODO this method is not referenced by FOP, can it be deleted? ColorExt ce = new ColorExt(red, green, blue, opacity); ce.rgbReplacementRed = -1; diff --git a/src/java/org/apache/fop/util/ColorProfileUtil.java b/src/java/org/apache/fop/util/ColorProfileUtil.java index f234dde66..35b6660dc 100644 --- a/src/java/org/apache/fop/util/ColorProfileUtil.java +++ b/src/java/org/apache/fop/util/ColorProfileUtil.java @@ -27,7 +27,10 @@ import java.io.UnsupportedEncodingException; /** * Helper methods for handling color profiles. */ -public class ColorProfileUtil { +public final class ColorProfileUtil { + + private ColorProfileUtil() { + } /** * Returns the profile description of an ICC profile diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java index 0ff93a058..8fe6c707f 100644 --- a/src/java/org/apache/fop/util/ColorUtil.java +++ b/src/java/org/apache/fop/util/ColorUtil.java @@ -520,7 +520,7 @@ public final class ColorUtil { /** * Initializes the colorMap with some predefined values. */ - private static void initializeColorMap() { + private static void initializeColorMap() { // CSOK: MethodLength colorMap = Collections.synchronizedMap(new java.util.HashMap()); colorMap.put("aliceblue", new Color(240, 248, 255)); diff --git a/src/java/org/apache/fop/util/CommandLineLogger.java b/src/java/org/apache/fop/util/CommandLineLogger.java index 0da112e5c..a9e59158f 100644 --- a/src/java/org/apache/fop/util/CommandLineLogger.java +++ b/src/java/org/apache/fop/util/CommandLineLogger.java @@ -1,9 +1,10 @@ -/* Licensed to the Apache Software Foundation (ASF) under one or more -/* contributor license agreements. See the NOTICE file distributed with -/* this work for additional information regarding copyright ownership. -/* The ASF licenses this file to You under the Apache License, Version 2.0 -/* (the "License"); you may not use this file except in compliance with -/* the License. You may obtain a copy of the License at +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/src/java/org/apache/fop/util/ConversionUtils.java b/src/java/org/apache/fop/util/ConversionUtils.java index f445134fc..fcdb4cdbd 100644 --- a/src/java/org/apache/fop/util/ConversionUtils.java +++ b/src/java/org/apache/fop/util/ConversionUtils.java @@ -25,6 +25,9 @@ package org.apache.fop.util; */ public final class ConversionUtils { + private ConversionUtils() { + } + /** * Converts the given base <code>String</code> into * an array of <code>int</code>, splitting the base along the diff --git a/src/java/org/apache/fop/util/DataURIResolver.java b/src/java/org/apache/fop/util/DataURIResolver.java index 99a8318c8..19ca31b22 100644 --- a/src/java/org/apache/fop/util/DataURIResolver.java +++ b/src/java/org/apache/fop/util/DataURIResolver.java @@ -32,6 +32,10 @@ public class DataURIResolver implements URIResolver { private final URIResolver newResolver = new org.apache.xmlgraphics.util.uri.DataURIResolver(); /** + * @param href an href + * @param base a base + * @return a source + * @throws TransformerException if not caught * @deprecated * @see org.apache.xmlgraphics.util.uri.DataURIResolver#resolve(String, * String) diff --git a/src/java/org/apache/fop/util/DataURLUtil.java b/src/java/org/apache/fop/util/DataURLUtil.java index 8568df274..46ff8635b 100644 --- a/src/java/org/apache/fop/util/DataURLUtil.java +++ b/src/java/org/apache/fop/util/DataURLUtil.java @@ -24,23 +24,34 @@ import java.io.InputStream; import java.io.Writer; /** - * @deprecated + * @deprecated use org.apache.xmlgraphics.util.uri.DataURLUtil directly * @see org.apache.xmlgraphics.util.uri.DataURLUtil */ -public class DataURLUtil { +public final class DataURLUtil { + + private DataURLUtil() { + } /** + * @param in an input stream + * @param mediatype a MIME media type + * @return a data url as a string + * @throws IOException if not caught * @deprecated * @see org.apache.xmlgraphics.util.uri.DataURLUtil#createDataURL(InputStream, * String) */ public static String createDataURL(InputStream in, String mediatype) - throws IOException { + throws IOException { return org.apache.xmlgraphics.util.uri.DataURLUtil.createDataURL(in, mediatype); } /** + * @param in an input stream + * @param mediatype a MIME media type + * @param writer a writer + * @throws IOException if not caught * @deprecated * @see org.apache.xmlgraphics.util.uri.DataURLUtil#writeDataURL(InputStream, * String, Writer) diff --git a/src/java/org/apache/fop/util/DecimalFormatCache.java b/src/java/org/apache/fop/util/DecimalFormatCache.java index d8c3b7361..a6634f50b 100644 --- a/src/java/org/apache/fop/util/DecimalFormatCache.java +++ b/src/java/org/apache/fop/util/DecimalFormatCache.java @@ -28,7 +28,10 @@ import java.util.Locale; * is not thread-safe but since FOP needs to format a lot of numbers the same way, it shall * be cached in a {@link ThreadLocal}. */ -public class DecimalFormatCache { +public final class DecimalFormatCache { + + private DecimalFormatCache() { + } private static final String BASE_FORMAT = "0.################"; diff --git a/src/java/org/apache/fop/util/LogUtil.java b/src/java/org/apache/fop/util/LogUtil.java index 23f275644..664667a76 100644 --- a/src/java/org/apache/fop/util/LogUtil.java +++ b/src/java/org/apache/fop/util/LogUtil.java @@ -25,7 +25,10 @@ import org.apache.fop.apps.FOPException; /** * Convenience Logging utility methods used in FOP */ -public class LogUtil { +public final class LogUtil { + + private LogUtil() { + } /** * Convenience method that handles any error appropriately diff --git a/src/java/org/apache/fop/util/UnitConv.java b/src/java/org/apache/fop/util/UnitConv.java index cf599712f..b0c87ec18 100644 --- a/src/java/org/apache/fop/util/UnitConv.java +++ b/src/java/org/apache/fop/util/UnitConv.java @@ -15,7 +15,7 @@ * limitations under the License. */ -/* $Id: $ */ +/* $Id$ */ package org.apache.fop.util; @@ -27,6 +27,9 @@ import java.awt.geom.AffineTransform; */ public final class UnitConv { + private UnitConv() { + } + /** * conversion factory from millimeters to inches. * @deprecated use org.apache.xmlgraphics.util.UnitConv.IN2MM instead. diff --git a/src/java/org/apache/fop/util/WriterOutputStream.java b/src/java/org/apache/fop/util/WriterOutputStream.java index e08109ab0..17ec5d658 100644 --- a/src/java/org/apache/fop/util/WriterOutputStream.java +++ b/src/java/org/apache/fop/util/WriterOutputStream.java @@ -24,7 +24,7 @@ import java.io.OutputStream; import java.io.Writer; /** - * @deprecated + * @deprecated use org.apache.xmlgraphics.util.WriterOutputStream instead * @see org.apache.xmlgraphics.util.WriterOutputStream */ public class WriterOutputStream extends OutputStream { @@ -32,9 +32,7 @@ public class WriterOutputStream extends OutputStream { private final org.apache.xmlgraphics.util.WriterOutputStream writerOutputStream; /** - * @deprecated - * @see org.apache.xmlgraphics.util.WriterOutputStream#WriterOutputStream(Writer) - * String) + * @param writer a writer */ public WriterOutputStream(Writer writer) { writerOutputStream = new org.apache.xmlgraphics.util.WriterOutputStream( @@ -42,52 +40,35 @@ public class WriterOutputStream extends OutputStream { } /** - * @deprecated - * @see org.apache.xmlgraphics.util.WriterOutputStream#WriterOutputStream(Writer, - * String) String) + * @param writer a writer + * @param encoding stream encoding */ public WriterOutputStream(Writer writer, String encoding) { writerOutputStream = new org.apache.xmlgraphics.util.WriterOutputStream( writer, encoding); } - /** - * @deprecated - * @see org.apache.xmlgraphics.util.WriterOutputStream#close() - */ + /** {@inheritDoc} */ public void close() throws IOException { writerOutputStream.close(); } - /** - * @deprecated - * @see org.apache.xmlgraphics.util.WriterOutputStream#flush() - */ + /** {@inheritDoc} */ public void flush() throws IOException { writerOutputStream.flush(); } - /** - * @deprecated - * @see org.apache.xmlgraphics.util.WriterOutputStream#write(byte[], int, - * int) - */ + /** {@inheritDoc} */ public void write(byte[] buf, int offset, int length) throws IOException { writerOutputStream.write(buf, offset, length); } - /** - * @deprecated - * @see org.apache.xmlgraphics.util.WriterOutputStream#write(byte[]) - */ + /** {@inheritDoc} */ public void write(byte[] buf) throws IOException { writerOutputStream.write(buf); } - /** - * @deprecated - * @see org.apache.xmlgraphics.util.WriterOutputStream#write(int) - */ + /** {@inheritDoc} */ public void write(int b) throws IOException { writerOutputStream.write(b); } diff --git a/src/java/org/apache/fop/util/XMLUtil.java b/src/java/org/apache/fop/util/XMLUtil.java index f7c013a2f..0a55ce573 100644 --- a/src/java/org/apache/fop/util/XMLUtil.java +++ b/src/java/org/apache/fop/util/XMLUtil.java @@ -30,7 +30,10 @@ import org.xml.sax.helpers.AttributesImpl; /** * A collection of utility method for XML handling. */ -public class XMLUtil implements XMLConstants { +public final class XMLUtil implements XMLConstants { + + private XMLUtil() { + } /** * Returns an attribute value as a boolean value. diff --git a/src/java/org/apache/fop/util/bitmap/BitmapImageUtil.java b/src/java/org/apache/fop/util/bitmap/BitmapImageUtil.java index c08076316..b2706c5c2 100644 --- a/src/java/org/apache/fop/util/bitmap/BitmapImageUtil.java +++ b/src/java/org/apache/fop/util/bitmap/BitmapImageUtil.java @@ -32,14 +32,17 @@ import java.awt.image.WritableRaster; /** * Utility method for dealing with bitmap images. */ -public class BitmapImageUtil { +public final class BitmapImageUtil { + + private BitmapImageUtil() { + } /** * Indicates whether an image is a monochrome (1 bit black and white) image. * @param img the image * @return true if it's a monochrome image */ - public static final boolean isMonochromeImage(RenderedImage img) { + public static boolean isMonochromeImage(RenderedImage img) { return (getColorIndexSize(img) == 2); } @@ -48,7 +51,7 @@ public class BitmapImageUtil { * @param img the image (must be 1 bit monochrome) * @return true if a zero bit indicates a black/dark pixel, false for a white/bright pixel */ - public static final boolean isZeroBlack(RenderedImage img) { + public static boolean isZeroBlack(RenderedImage img) { if (!isMonochromeImage(img)) { throw new IllegalArgumentException("Image is not a monochrome image!"); } @@ -65,7 +68,7 @@ public class BitmapImageUtil { * @param b the blue component * @return the gray value */ - public static final int convertToGray(int r, int g, int b) { + public static int convertToGray(int r, int g, int b) { return (r * 30 + g * 59 + b * 11) / 100; } @@ -74,7 +77,7 @@ public class BitmapImageUtil { * @param rgb the RGB value * @return the gray value */ - public static final int convertToGray(int rgb) { + public static int convertToGray(int rgb) { int r = (rgb & 0xFF0000) >> 16; int g = (rgb & 0xFF00) >> 8; int b = rgb & 0xFF; @@ -86,7 +89,7 @@ public class BitmapImageUtil { * @param img the image * @return the size of the color index or 0 if there's no color index */ - public static final int getColorIndexSize(RenderedImage img) { + public static int getColorIndexSize(RenderedImage img) { ColorModel cm = img.getColorModel(); if (cm instanceof IndexColorModel) { IndexColorModel icm = (IndexColorModel)cm; @@ -101,7 +104,7 @@ public class BitmapImageUtil { * @param img the image * @return true if it's a grayscale image */ - public static final boolean isGrayscaleImage(RenderedImage img) { + public static boolean isGrayscaleImage(RenderedImage img) { return (img.getColorModel().getColorSpace().getNumComponents() == 1); } @@ -111,7 +114,7 @@ public class BitmapImageUtil { * @param targetDimension the new target dimensions or null if no scaling is necessary * @return the sRGB image */ - public static final BufferedImage convertTosRGB(RenderedImage img, + public static BufferedImage convertTosRGB(RenderedImage img, Dimension targetDimension) { return convertAndScaleImage(img, targetDimension, BufferedImage.TYPE_INT_RGB); } @@ -122,7 +125,7 @@ public class BitmapImageUtil { * @param targetDimension the new target dimensions or null if no scaling is necessary * @return the grayscale image */ - public static final BufferedImage convertToGrayscale(RenderedImage img, + public static BufferedImage convertToGrayscale(RenderedImage img, Dimension targetDimension) { return convertAndScaleImage(img, targetDimension, BufferedImage.TYPE_BYTE_GRAY); } @@ -133,7 +136,7 @@ public class BitmapImageUtil { * @param targetDimension the new target dimensions or null if no scaling is necessary * @return the monochrome image */ - public static final BufferedImage convertToMonochrome(RenderedImage img, + public static BufferedImage convertToMonochrome(RenderedImage img, Dimension targetDimension) { return toBufferedImage(convertToMonochrome(img, targetDimension, 0.0f)); } @@ -146,7 +149,7 @@ public class BitmapImageUtil { * Valid values: a value between 0.0f (fastest) and 1.0f (best) * @return the monochrome image */ - public static final RenderedImage convertToMonochrome(RenderedImage img, + public static RenderedImage convertToMonochrome(RenderedImage img, Dimension targetDimension, float quality) { if (!isMonochromeImage(img)) { if (quality >= 0.5f) { @@ -234,6 +237,7 @@ public class BitmapImageUtil { } } + /** @return the bitmap converter */ public static MonochromeBitmapConverter createDefaultMonochromeBitmapConverter() { MonochromeBitmapConverter converter = null; try { diff --git a/src/java/org/apache/fop/util/bitmap/DitherUtil.java b/src/java/org/apache/fop/util/bitmap/DitherUtil.java index c61befc9c..2fa2e9402 100644 --- a/src/java/org/apache/fop/util/bitmap/DitherUtil.java +++ b/src/java/org/apache/fop/util/bitmap/DitherUtil.java @@ -24,7 +24,10 @@ import java.awt.Color; /** * Utility methods for dithering. */ -public class DitherUtil { +public final class DitherUtil { + + private DitherUtil() { + } /** Selects a 2x2 Bayer dither matrix (5 grayscales) */ public static final int DITHER_MATRIX_2X2 = 2; diff --git a/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java b/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java index 8c26bd622..002b3f95c 100644 --- a/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java +++ b/src/java/org/apache/fop/util/text/AdvancedMessageFormat.java @@ -29,7 +29,7 @@ import org.apache.xmlgraphics.util.Service; /** * Formats messages based on a template and with a set of named parameters. This is similar to - * {@link java.util.MessageFormat} but uses named parameters and supports conditional sub-groups. + * {@link java.text.MessageFormat} but uses named parameters and supports conditional sub-groups. * <p> * Example: * </p> |