aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/afp
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/afp')
-rw-r--r--src/java/org/apache/fop/afp/AFPBorderPainter.java97
-rw-r--r--src/java/org/apache/fop/afp/AFPDataObjectInfo.java7
-rw-r--r--src/java/org/apache/fop/afp/AFPEventProducer.java5
-rw-r--r--src/java/org/apache/fop/afp/AFPGraphics2D.java2
-rw-r--r--src/java/org/apache/fop/afp/AFPLineDataInfo.java14
-rw-r--r--src/java/org/apache/fop/afp/AFPRectanglePainter.java43
-rw-r--r--src/java/org/apache/fop/afp/AFPStreamer.java2
-rw-r--r--src/java/org/apache/fop/afp/AbstractAFPPainter.java2
-rw-r--r--src/java/org/apache/fop/afp/DataStream.java8
-rw-r--r--src/java/org/apache/fop/afp/Factory.java7
-rw-r--r--src/java/org/apache/fop/afp/Startable.java2
-rw-r--r--src/java/org/apache/fop/afp/fonts/CharacterSet.java3
-rw-r--r--src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java5
-rw-r--r--src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java4
-rw-r--r--src/java/org/apache/fop/afp/fonts/DoubleByteFont.java2
-rw-r--r--src/java/org/apache/fop/afp/fonts/OutlineFont.java6
-rw-r--r--src/java/org/apache/fop/afp/fonts/RasterFont.java3
-rw-r--r--src/java/org/apache/fop/afp/goca/AbstractGraphicsCoord.java3
-rw-r--r--src/java/org/apache/fop/afp/goca/GraphicsCharacterString.java2
-rw-r--r--src/java/org/apache/fop/afp/goca/GraphicsFillet.java1
-rw-r--r--src/java/org/apache/fop/afp/goca/GraphicsSetMix.java3
-rw-r--r--src/java/org/apache/fop/afp/goca/GraphicsSetPatternSymbol.java2
-rw-r--r--src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java6
-rw-r--r--src/java/org/apache/fop/afp/ioca/ImageRasterPattern.java5
-rw-r--r--src/java/org/apache/fop/afp/modca/AbstractAFPObject.java7
-rw-r--r--src/java/org/apache/fop/afp/modca/AbstractEnvironmentGroup.java5
-rw-r--r--src/java/org/apache/fop/afp/modca/AbstractPageObject.java4
-rw-r--r--src/java/org/apache/fop/afp/modca/ActiveEnvironmentGroup.java4
-rw-r--r--src/java/org/apache/fop/afp/modca/GraphicsObject.java8
-rw-r--r--src/java/org/apache/fop/afp/modca/ImageDataDescriptor.java3
-rw-r--r--src/java/org/apache/fop/afp/modca/IncludeObject.java5
-rw-r--r--src/java/org/apache/fop/afp/modca/MapCodedFont.java5
-rw-r--r--src/java/org/apache/fop/afp/modca/ObjectContainer.java4
-rw-r--r--src/java/org/apache/fop/afp/modca/PageGroup.java1
-rw-r--r--src/java/org/apache/fop/afp/modca/PreprocessPresentationObject.java4
-rw-r--r--src/java/org/apache/fop/afp/modca/triplets/CommentTriplet.java5
-rw-r--r--src/java/org/apache/fop/afp/modca/triplets/ObjectClassificationTriplet.java3
-rw-r--r--src/java/org/apache/fop/afp/modca/triplets/Triplet.java61
-rw-r--r--src/java/org/apache/fop/afp/ptoca/LineDataInfoProducer.java3
-rw-r--r--src/java/org/apache/fop/afp/svg/AFPBridgeContext.java9
-rw-r--r--src/java/org/apache/fop/afp/svg/AFPGraphicsConfiguration.java3
-rw-r--r--src/java/org/apache/fop/afp/svg/AFPTextHandler.java13
-rw-r--r--src/java/org/apache/fop/afp/svg/AFPTextPainter.java2
-rw-r--r--src/java/org/apache/fop/afp/util/BinaryUtils.java3
-rw-r--r--src/java/org/apache/fop/afp/util/CubicBezierApproximator.java5
-rw-r--r--src/java/org/apache/fop/afp/util/StringUtils.java5
46 files changed, 267 insertions, 129 deletions
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