xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acumis...@apache.org
Subject svn commit: r704434 - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp: AFPGraphics2D.java AFPGraphics2DAdapter.java AFPInfo.java AFPSVGHandler.java
Date Tue, 14 Oct 2008 10:19:22 GMT
Author: acumiskey
Date: Tue Oct 14 03:19:16 2008
New Revision: 704434

URL: http://svn.apache.org/viewvc?rev=704434&view=rev
Log:
Fixes resource naming/levelling for fox:conversion-mode="bitmap" GOCA fallback.

Modified:
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2D.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPInfo.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPSVGHandler.java

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2D.java?rev=704434&r1=704433&r2=704434&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2D.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2D.java
Tue Oct 14 03:19:16 2008
@@ -468,8 +468,9 @@
 
         imageObjectInfo.setMimeType(MimeConstants.MIME_AFP_IOCA_FS45);
         imageObjectInfo.setBitsPerPixel(state.getBitsPerPixel());
+        imageObjectInfo.setResourceInfo(info.getResourceInfo());
 
-        AFPResourceManager resourceManager = info.getAFPResourceManager();
+        AFPResourceManager resourceManager = info.getResourceManager();
         try {
             resourceManager.createObject(imageObjectInfo);
         } catch (IOException ioe) {

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java?rev=704434&r1=704433&r2=704434&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java
Tue Oct 14 03:19:16 2008
@@ -96,14 +96,16 @@
             RendererContextWrapper ctx = RendererContext.wrapRendererContext(context);
             BufferedImage bi = paintToBufferedImage(painter, ctx, resolution, false, false);
 
+            AffineTransform trans = state.getData().getTransform();
             float scale = AFPRenderer.NORMAL_AFP_RESOLUTION
                             / context.getUserAgent().getTargetResolution();
             if (scale != 1) {
                 at.scale(scale, scale);
+                if (!at.isIdentity()) {
+                    trans.concatenate(at);
+                }
             }
 
-            AffineTransform trans = state.getData().getTransform();
-            trans.concatenate(at);
 
             // concatenate to transformation matrix
 //            state.concatenate(at);

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPInfo.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPInfo.java?rev=704434&r1=704433&r2=704434&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPInfo.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPInfo.java
Tue Oct 14 03:19:16 2008
@@ -39,7 +39,7 @@
     private int y;
 
     /** see HANDLER_CONFIGURATION */
-    private Configuration cfg;
+    private Configuration handlerConfiguration;
 
     /** see AFP_FONT_INFO */
     private FontInfo fontInfo;
@@ -53,6 +53,9 @@
     /** true if SVG should be rendered as a bitmap instead of natively */
     private boolean paintAsBitmap;
 
+    /** the resource information */
+    private AFPResourceInfo resourceInfo;
+
     /**
      * Returns the width.
      *
@@ -95,7 +98,7 @@
      * @return the handler configuration
      */
     public Configuration getHandlerConfiguration() {
-        return this.cfg;
+        return this.handlerConfiguration;
     }
 
     /**
@@ -104,7 +107,7 @@
      * @param cfg the handler configuration
      */
     public void setHandlerConfiguration(Configuration cfg) {
-        this.cfg = cfg;
+        this.handlerConfiguration = cfg;
     }
 
     /**
@@ -130,7 +133,7 @@
      *
      * @return the AFPResourceManager
      */
-    public AFPResourceManager getAFPResourceManager() {
+    public AFPResourceManager getResourceManager() {
         return this.resourceManager;
     }
 
@@ -241,17 +244,36 @@
         return this.paintAsBitmap;
     }
 
+    /**
+     * Sets the resource information
+     *
+     * @param resourceInfo the resource information
+     */
+    public void setResourceInfo(AFPResourceInfo resourceInfo) {
+        this.resourceInfo = resourceInfo;
+    }
+
+    /**
+     * Returns the resource information
+     *
+     * @return the resource information
+     */
+    public AFPResourceInfo getResourceInfo() {
+        return resourceInfo;
+    }
+
     /** {@inheritDoc} */
     public String toString() {
         return "AFPInfo{width=" + width
             + ", height=" + height
             + ", x=" + x
             + ", y=" + y
-            + ", cfg=" + cfg
+            + ", cfg=" + handlerConfiguration
             + ", fontInfo=" + fontInfo
             + ", resourceManager=" + resourceManager
             + ", state=" + state
             + ", paintAsBitmap=" + paintAsBitmap
+            + ", resourceInfo=" + resourceInfo
         + "}";
     }
 

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPSVGHandler.java?rev=704434&r1=704433&r2=704434&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
Tue Oct 14 03:19:16 2008
@@ -82,11 +82,16 @@
         afpi.setResourceManager(((AFPResourceManager)context.getProperty(
                 AFPRendererContextConstants.AFP_RESOURCE_MANAGER)));
 
-        Map foreign = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
-        QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
-        if (foreign != null
-                && "bitmap".equalsIgnoreCase((String)foreign.get(qName))) {
-            afpi.setPaintAsBitmap(true);
+        Map foreignAttributes = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
+        if (foreignAttributes != null) {
+            AFPForeignAttributeReader foreignAttributeReader = new AFPForeignAttributeReader();
+            AFPResourceInfo resourceInfo = foreignAttributeReader.getResourceInfo(foreignAttributes);
+            afpi.setResourceInfo(resourceInfo);
+
+            QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
+            if ("bitmap".equalsIgnoreCase((String)foreignAttributes.get(qName))) {
+                afpi.setPaintAsBitmap(true);
+            }
         }
         return afpi;
     }
@@ -225,7 +230,7 @@
         // Set the object area info
         graphicsObjectInfo.setObjectAreaInfo(objectAreaInfo);
 
-        AFPResourceManager resourceManager = afpInfo.getAFPResourceManager();
+        AFPResourceManager resourceManager = afpInfo.getResourceManager();
 
         // Create the graphics object
         resourceManager.createObject(graphicsObjectInfo);



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message