aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-10-16 13:49:11 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-10-16 13:49:11 +0000
commitde6e3984aa643cc55384f73d1b358ba40e2ca1de (patch)
tree8a4e05526acd4929910173213cc91ebfa881a639 /src/java/org/apache
parent9d2aeb2c4bc8b6d375bc59398c72fd658f1800ca (diff)
downloadxmlgraphics-fop-de6e3984aa643cc55384f73d1b358ba40e2ca1de.tar.gz
xmlgraphics-fop-de6e3984aa643cc55384f73d1b358ba40e2ca1de.zip
Removed debug code
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@705242 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r--src/java/org/apache/fop/render/afp/AFPGraphics2D.java43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/java/org/apache/fop/render/afp/AFPGraphics2D.java b/src/java/org/apache/fop/render/afp/AFPGraphics2D.java
index e389afb52..2699cfa6b 100644
--- a/src/java/org/apache/fop/render/afp/AFPGraphics2D.java
+++ b/src/java/org/apache/fop/render/afp/AFPGraphics2D.java
@@ -215,6 +215,7 @@ public class AFPGraphics2D extends AbstractGraphics2D {
graphicsObj.beginArea();
}
AffineTransform trans = super.getTransform();
+
PathIterator iter = shape.getPathIterator(trans);
double[] vals = new double[6];
int[] coords = null;
@@ -295,7 +296,8 @@ public class AFPGraphics2D extends AbstractGraphics2D {
graphicsObj.addBox(coords);
} else if (shape instanceof Ellipse2D) {
Ellipse2D elip = (Ellipse2D) shape;
- final double factor = info.getResolution() / 100f;
+ int resolution = info.getResolution();
+ final double factor = resolution / 100f;
graphicsObj.setArcParams(
(int)Math.round(elip.getWidth() * factor),
(int)Math.round(elip.getHeight() * factor),
@@ -404,13 +406,19 @@ public class AFPGraphics2D extends AbstractGraphics2D {
// create image object info
AFPImageObjectInfo imageObjectInfo = new AFPImageObjectInfo();
+ imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS45);
+
+ imageObjectInfo.setBitsPerPixel(state.getBitsPerPixel());
+
+ imageObjectInfo.setResourceInfo(info.getResourceInfo());
+
int dataHeight = renderedImage.getHeight();
imageObjectInfo.setDataHeight(dataHeight);
int dataWidth = renderedImage.getWidth();
imageObjectInfo.setDataWidth(dataWidth);
- boolean colorImages = true;//state.isColorImages();
+ boolean colorImages = state.isColorImages();
imageObjectInfo.setColor(colorImages);
ByteArrayOutputStream boas = new ByteArrayOutputStream();
@@ -432,11 +440,6 @@ public class AFPGraphics2D extends AbstractGraphics2D {
imageObjectInfo.setUri(imageInfo.getOriginalURI());
}
- imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS45);
- imageObjectInfo.setBitsPerPixel(state.getBitsPerPixel());
- imageObjectInfo.setResourceInfo(info.getResourceInfo());
-
-
// create object area info
AFPObjectAreaInfo objectAreaInfo = new AFPObjectAreaInfo();
@@ -488,21 +491,21 @@ public class AFPGraphics2D extends AbstractGraphics2D {
g2d.setComposite(gc.getComposite());
- if (!g2d.drawImage(img, 0, 0, bufferedWidth, bufferedHeight, observer)) {
- return false;
- }
+ boolean drawn = g2d.drawImage(img, 0, 0, bufferedWidth, bufferedHeight, observer);
g2d.dispose();
- try {
- // get image object info
- AFPImageObjectInfo imageObjectInfo = getImageObjectInfo(bufferedImage, x, y, width, height);
-
- // create image resource
- AFPResourceManager resourceManager = info.getResourceManager();
- resourceManager.createObject(imageObjectInfo);
- return true;
- } catch (IOException ioe) {
- handleIOException(ioe);
+ if (drawn) {
+ try {
+ // get image object info
+ AFPImageObjectInfo imageObjectInfo = getImageObjectInfo(bufferedImage, x, y, width, height);
+
+ // create image resource
+ AFPResourceManager resourceManager = info.getResourceManager();
+ resourceManager.createObject(imageObjectInfo);
+ return true;
+ } catch (IOException ioe) {
+ handleIOException(ioe);
+ }
}
return false;
}