aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-10-16 13:06:58 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-10-16 13:06:58 +0000
commit9d2aeb2c4bc8b6d375bc59398c72fd658f1800ca (patch)
tree31693c8d9f18c86a1ba03776e1f44078431ab7d3 /src
parent62c0527665f62b52f6dd774fc2edfa236bbe873c (diff)
downloadxmlgraphics-fop-9d2aeb2c4bc8b6d375bc59398c72fd658f1800ca.tar.gz
xmlgraphics-fop-9d2aeb2c4bc8b6d375bc59398c72fd658f1800ca.zip
Added GOCA mime.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@705234 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java7
-rw-r--r--src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java b/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java
index 5128b96cf..dc86b8c38 100644
--- a/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java
+++ b/src/java/org/apache/fop/render/afp/AFPImageGraphics2DFactory.java
@@ -24,6 +24,7 @@ import java.io.IOException;
import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D;
import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
+import org.apache.xmlgraphics.util.MimeConstants;
/**
@@ -50,6 +51,10 @@ public class AFPImageGraphics2DFactory extends AFPDataObjectInfoFactory {
AFPGraphicsObjectInfo graphicsObjectInfo
= (AFPGraphicsObjectInfo)super.create(afpImageInfo);
+ // set mime type (unsupported by MOD:CA registry)
+ graphicsObjectInfo.setMimeType(MimeConstants.MIME_AFP_GOCA);
+
+ // set graphics 2d
AFPGraphics2DAdapter g2dAdapter = afpImageInfo.g2dAdapter;
AFPGraphics2D g2d = g2dAdapter.getGraphics2D();
AFPInfo afpInfo = AFPSVGHandler.getAFPInfo(afpImageInfo.rendererContext);
@@ -58,10 +63,12 @@ public class AFPImageGraphics2DFactory extends AFPDataObjectInfoFactory {
g2d.setState(state);
graphicsObjectInfo.setGraphics2D(g2d);
+ // set painter
ImageGraphics2D imageG2D = (ImageGraphics2D)afpImageInfo.img;
Graphics2DImagePainter painter = imageG2D.getGraphics2DImagePainter();
graphicsObjectInfo.setPainter(painter);
+ // set object area
AFPObjectAreaInfo objectAreaInfo = graphicsObjectInfo.getObjectAreaInfo();
Rectangle area = new Rectangle(objectAreaInfo.getWidth(), objectAreaInfo.getHeight());
graphicsObjectInfo.setArea(area);
diff --git a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
index 85784af55..aba38af2f 100644
--- a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
@@ -240,6 +240,7 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator {
} else {
afpRenderer.setColorImages(true);
}
+
// images are embedded directly without conversion to bitmapped IOCA
afpRenderer.setNativeImages(imagesCfg.getAttributeAsBoolean("native", false));