You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ac...@apache.org on 2008/03/27 17:16:38 UTC

svn commit: r641873 [5/5] - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop: image/ render/afp/ render/afp/extensions/ render/afp/modca/ render/afp/modca/triplets/ render/pdf/ render/ps/extensions/

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java?rev=641873&r1=641872&r2=641873&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java Thu Mar 27 09:16:30 2008
@@ -22,7 +22,7 @@
 import java.awt.Color;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.ArrayList;
+import java.util.List;
 
 /**
  * The Presentation Text object is the data object used in document processing
@@ -47,17 +47,15 @@
      */
     private static final String DEFAULT_NAME = "PTO00001";
 
-    private PresentationTextData currentPresentationTextData = null;
+    private PresentationTextData currentPresentationTextData;
 
-    private ArrayList presentationTextData = new ArrayList();
+    private List presentationTextData;
 
     /**
      * Default constructor for the PresentationTextObject
      */
     public PresentationTextObject() {
-
         this(DEFAULT_NAME);
-
     }
 
     /**
@@ -66,15 +64,13 @@
      * @param name the name of this presentation object
      */
     public PresentationTextObject(String name) {
-
         super(name);
-
     }
 
     /**
      * Create the presentation text data for the byte array of data.
      *
-     * @param fontNumber
+     * @param fontNum
      *            The font resource identifier.
      * @param x
      *            The x coordinate for the text data.
@@ -89,18 +85,16 @@
      * @param data
      *            The text data to be created.
      */
-    public void createTextData(int fontNumber, int x, int y, Color col,
+    public void createTextData(int fontNum, int x, int y, Color col,
             int vsci, int ica, byte[] data) {
-
         // Use a default orientation of zero
-        createTextData(fontNumber, x, y, 0, col, vsci, ica, data);
-
+        createTextData(fontNum, x, y, 0, col, vsci, ica, data);
     }
 
     /**
      * Create the presentation text data for the byte array of data.
      *
-     * @param fontReference
+     * @param fontRef
      *            The font resource identifier.
      * @param x
      *            The x coordinate for the text data.
@@ -117,25 +111,19 @@
      * @param data
      *            The text data to be created.
      */
-    public void createTextData(int fontReference, int x, int y, int orientation,
+    public void createTextData(int fontRef, int x, int y, int orientation,
         Color col, int vsci, int ica, byte[] data) {
-
         if (currentPresentationTextData == null) {
             startPresentationTextData();
         }
-
         try {
 
-            currentPresentationTextData.createTextData(fontReference, x, y,
+            currentPresentationTextData.createTextData(fontRef, x, y,
                 orientation, col, vsci, ica, data);
-
         } catch (MaximumSizeExceededException msee) {
-
             endPresentationTextData();
-            createTextData(fontReference, x, y, orientation, col, vsci, ica, data);
-
+            createTextData(fontRef, x, y, orientation, col, vsci, ica, data);
         }
-
     }
 
     /**
@@ -180,47 +168,38 @@
      */
     public void createLineData(int x1, int y1, int x2, int y2, int thickness,
         int orientation, Color col) {
-
         if (currentPresentationTextData == null) {
             startPresentationTextData();
         }
-
         try {
-
             currentPresentationTextData.createLineData(x1, y1, x2, y2,
                 thickness, orientation, col);
-
         } catch (MaximumSizeExceededException msee) {
-
             endPresentationTextData();
             createLineData(x1, y1, x2, y2, thickness, orientation, col);
-
         }
-
     }
 
     /**
      * Helper method to mark the start of the presentation text data
      */
     private void startPresentationTextData() {
-
+        if (presentationTextData == null) {
+            presentationTextData = new java.util.ArrayList();
+        }
         if (presentationTextData.size() == 0) {
             currentPresentationTextData = new PresentationTextData(true);
         } else {
             currentPresentationTextData = new PresentationTextData();
         }
-
         presentationTextData.add(currentPresentationTextData);
-
     }
 
     /**
      * Helper method to mark the end of the presentation text data
      */
     private void endPresentationTextData() {
-
         currentPresentationTextData = null;
-
     }
 
     /**
@@ -228,15 +207,10 @@
      * @param os The stream to write to
      * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
-
+    public void writeDataStream(OutputStream os) throws IOException {
         writeStart(os);
-
-        writeObjectList(presentationTextData, os);
-
+        writeObjects(presentationTextData, os);
         writeEnd(os);
-
     }
 
     /**
@@ -244,20 +218,14 @@
      * @return the name of this presentation text object
      */
     public String getName() {
-
         return name;
-
     }
 
     /**
-     * Helper method to write the start of the presenation text object.
-     * @param os The stream to write to
+     * {@inheritDoc}
      */
-    private void writeStart(OutputStream os)
-        throws IOException {
-
+    protected void writeStart(OutputStream os) throws IOException {
         byte[] data = new byte[17];
-
         data[0] = 0x5A; // Structured field identifier
         data[1] = 0x00; // Length byte 1
         data[2] = 0x10; // Length byte 2
@@ -267,27 +235,17 @@
         data[6] = 0x00; // Flags
         data[7] = 0x00; // Reserved
         data[8] = 0x00; // Reserved
-
         for (int i = 0; i < nameBytes.length; i++) {
-
             data[9 + i] = nameBytes[i];
-
         }
-
         os.write(data);
-
     }
 
     /**
-     * Helper method to write the end of the presenation text object.
-     * @param os The stream to write to
+     * {@inheritDoc}
      */
-    private void writeEnd(OutputStream os)
-        throws IOException {
-
-
+    protected void writeEnd(OutputStream os) throws IOException {
         byte[] data = new byte[17];
-
         data[0] = 0x5A; // Structured field identifier
         data[1] = 0x00; // Length byte 1
         data[2] = 0x10; // Length byte 2
@@ -297,15 +255,10 @@
         data[6] = 0x00; // Flags
         data[7] = 0x00; // Reserved
         data[8] = 0x00; // Reserved
-
         for (int i = 0; i < nameBytes.length; i++) {
-
             data[9 + i] = nameBytes[i];
-
         }
-
         os.write(data);
-
     }
 
     /**
@@ -316,22 +269,14 @@
      * method terminates the control sequence.
      */
     public void endControlSequence() {
-
         if (currentPresentationTextData == null) {
             startPresentationTextData();
         }
-
         try {
-
             currentPresentationTextData.endControlSequence();
-
         } catch (MaximumSizeExceededException msee) {
-
             endPresentationTextData();
             endControlSequence();
-
         }
-
     }
-
 }

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/Registry.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,353 @@
+/*
+ * 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.afp.modca;
+
+import java.io.UnsupportedEncodingException;
+
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * MOD:CA object type registry
+ */
+public final class Registry {
+    
+    /** IOB supported object types */
+    public static final byte IOCA_FS10 = 5;
+    public static final byte IOCA_FS11 = 11;
+    public static final byte IOCA_FS45 = 12;
+    public static final byte DIB_WIN = 17; //device independent bitmap
+    public static final byte DIB_OS2 = 18;
+    public static final byte PCX = 19;
+    public static final byte GIF = 22;
+    public static final byte JFIF = 23; // jpeg file interchange format 
+    public static final byte PDF_SINGLE_PAGE = 25; 
+    public static final byte PCL_PAGE_OBJECT = 34; 
+    public static final byte EPS_TRANS = 48;
+    public static final byte PDF_SINGLE_PAGE_TRANS = 49;
+    public static final byte JPEG2000 = 58;
+    
+    /** IOB unsupported object types */
+    public static final byte EPS = 13;
+    public static final byte TIFF = 14;
+    public static final byte COM_SETUP_FILE = 15;
+    public static final byte TAPE_LABEL_SETUP_FILE = 16;
+    public static final byte CMT = 20; // color mapping table
+    public static final byte ANACOMP_CONTROL_RECORD = 24; 
+    public static final byte PDF_RESOURCE_OBJECT = 26; 
+    public static final byte IOCA_FS42 = 45;
+    public static final byte RESIDENT_COLOR_PROFILE = 46;
+    public static final byte IOCA_FS45_TILE_RESOURCE = 47;
+    public static final byte FONT = 51;
+    public static final byte FONT_COLLECTION = 53;
+    public static final byte RESOURCE_ACCESS_TABLE = 54; 
+    public static final byte IOCA_FS40 = 55;
+    public static final byte UP3I_PRINT_DATA = 56;
+    public static final byte COLOR_MANAGEMENT_RESOURCE = 57;
+
+    
+    /** internal mapping array references */
+    private static final int COMPONENT_ID = 0;
+    private static final int OBJECT_TYPE_NAME = 1;
+    private static final int OBJECT_ID = 2;
+    private static final int CAN_BE_INCLUDED = 3;
+
+    private byte[][][] componentIdMap;
+
+    private static Registry instance = null;
+
+    /**
+     * @return a single instance of Registry
+     */
+    public static Registry getInstance() {
+        synchronized (instance) {
+            if (instance == null) {
+                instance = new Registry();
+            }            
+        }
+        return instance;
+    }
+    
+    private Registry() {
+        init();
+    }
+    
+    private void init() {
+        try {
+            componentIdMap = new byte[][][] {
+            /* object type id (OID), object type name, compontent Id, can be included with IOB?, */ 
+            {
+                {IOCA_FS10},
+                "IOCA FS10".getBytes(AFPConstants.EBCIDIC_ENCODING),
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x05},
+                {1}
+            },
+            {
+                {IOCA_FS11},
+                "IOCA FS11".getBytes(AFPConstants.EBCIDIC_ENCODING),
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x0B},
+                {1}
+            },
+            {
+                {IOCA_FS45},
+                "IOCA FS45".getBytes(AFPConstants.EBCIDIC_ENCODING),
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x0C},
+                {1}
+            },
+            {
+                {EPS},
+                "Encapsulated Postscript".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x0D},
+                {0}
+            },
+            {
+                {TIFF},
+                "TIFF".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x0E},
+                {0}
+            },
+            {
+                {COM_SETUP_FILE},
+                "COM setup".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x0F},
+                {0}
+            },
+            {
+                {TAPE_LABEL_SETUP_FILE},
+                "Tape Label setup".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x10},
+                {0}
+            },
+            {
+                {DIB_WIN},
+                "DIB, Windows Version".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x11},
+                {1}
+            },
+            {
+                {DIB_OS2},
+                "DIB, OS/2 PM Version".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x12},
+                {1}
+            },
+            {
+                {PCX},
+                "PCX".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x13},
+                {1}
+            },
+            {
+                {CMT},
+                "Color Mapping Table (CMT)".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x14},
+                {0}
+            },
+            {
+                {GIF},
+                "GIF".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x16},
+                {1}
+            },
+            {
+                {JFIF},
+                "JFIF".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x17},
+                {1}
+            },
+            {
+                {ANACOMP_CONTROL_RECORD},
+                "AnaStak Control Record".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x18},
+                {0}
+            },
+            {
+                {PDF_SINGLE_PAGE},
+                "PDF Single-page Object".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x19},
+                {1}
+            },
+            {
+                {PDF_RESOURCE_OBJECT},
+                "PDF Resource Object".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x1A},
+                {0}
+            },
+            {
+                {PCL_PAGE_OBJECT},
+                "PCL Page Object".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x22},
+                {1}
+            },
+            {
+                {IOCA_FS42},
+                "IOCA FS42".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x2D},
+                {0}
+            },
+            {
+                {RESIDENT_COLOR_PROFILE},
+                "Resident Color Profile".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x2E},
+                {0}
+            },
+            {
+                {IOCA_FS45_TILE_RESOURCE},
+                "IOCA FS45".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x2E},
+                {0}
+            },
+            {
+                {EPS_TRANS},
+                "EPS with Transparency".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x30},
+                {1}
+            },
+            {
+                {PDF_SINGLE_PAGE_TRANS},
+                "PDF with Transparency".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x31},
+                {1}
+            },
+            {
+                {FONT},
+                "TrueType/OpenType Font".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x33},
+                {0}
+            },
+            {
+                {FONT_COLLECTION},
+                "TrueType/OpenType Font Collection".getBytes(
+                        AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x35},
+                {0}
+            },
+            {
+                {RESOURCE_ACCESS_TABLE},
+                "Resource Access Table".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x36},
+                {0}
+            },
+            {
+                {IOCA_FS40},
+                "IOCA FS40".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x37},
+                {0}
+            },
+            {
+                {UP3I_PRINT_DATA},
+                "IP3i Print Data".getBytes(AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x38},
+                {0}
+            },
+            {
+                {COLOR_MANAGEMENT_RESOURCE},
+                "Color Management Resource (CMR)".getBytes(
+                        AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x39},
+                {0}
+            },
+            {
+                {JPEG2000},
+                "JPEG2000 (JP2) File Format".getBytes(
+                        AFPConstants.EBCIDIC_ENCODING),                
+                {0x06, 0x07, 0x2B, 0x12, 0x00, 0x04, 0x01, 0x01, 0x3A},
+                {1}
+            }
+            };
+        } catch (UnsupportedEncodingException e) {
+            // should never happen!
+            LogFactory.getLog("org.apache.fop.render.afp.modca.Registry").error(e.getMessage());
+        }        
+    }
+
+    private byte[][][] getComponentIdMap() {
+        if (componentIdMap == null) {
+            init();
+        }
+        return componentIdMap;
+    }
+
+    private byte[][] getMapData(byte compontentId) {
+        getComponentIdMap();
+        for (int i = 0; i < componentIdMap.length; i++) {
+            if (compontentId == componentIdMap[i][0][0]) {
+                return componentIdMap[i];
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns a registry Entry for a given componentId
+     * @param compontentId a compontent id
+     * @return the registry entry for a give componentId
+     */
+    public Entry getEntry(byte compontentId) {
+        byte[][] data = getMapData(compontentId);
+        if (data != null) {
+            return new Registry.Entry(data);
+        }
+        return null;
+    }
+
+    /**
+     * Encapsulates a MOD:CA Registry Entry
+     */
+    public final class Entry {
+        private byte[][] data;
+
+        /**
+         * Main constructor
+         * @param the map data structure array
+         */
+        private Entry(byte[][] data) {
+            this.data = data;
+        }
+        
+        /**
+         * Returns a MOD:CA object type OID from a given a componentId
+         * @return the corresponding object type id for a given component id
+         * or null if the component id is unknown and the object type OID was not found.
+         */
+        public byte[] getOID() {
+            return data[OBJECT_ID];
+        }
+
+        /**
+         * @return the object type name for the given componentId 
+         */
+        public byte[] getObjectTypeName() {
+            return data[OBJECT_TYPE_NAME];
+        }
+
+        /**
+         * @return the compontentId for this entry
+         */
+        public byte[] getComponentId() {
+            return data[COMPONENT_ID];
+        }
+
+        /**
+         * @return true if this component can be included with an IOB structured field
+         */
+        public boolean canBeIncluded() {
+            return data[CAN_BE_INCLUDED][0] == 1;
+        }
+    }
+}

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceEnvironmentGroup.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,158 @@
+/*
+ * 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.afp.modca;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+/**
+ * A Resource Environment Group contains a set of resources for a document
+ * or for a group of pages in a document.
+ */
+public class ResourceEnvironmentGroup extends AbstractEnvironmentGroup {
+    /**
+     * Default name for the resource group
+     */
+    private static final String DEFAULT_NAME = "REG00001";
+
+    /**
+     * The maps data resources contained in this resource environment group
+     */
+    private List mapDataResources = null;
+    
+    /**
+     * The maps page overlays contained in this resource environment group
+     */
+    private List mapPageOverlays = null;
+    
+    /**
+     * The pre-process presentation objects contained in this resource environment group
+     */
+    private List preProcessPresentationObjects = null;
+
+    /**
+     * The resource environment group state
+     */
+    private boolean complete = false;
+
+    /**
+     * Default constructor
+     */
+    public ResourceEnvironmentGroup() {
+        this(DEFAULT_NAME);
+    }
+
+    private List getMapDataResources() {
+        if (mapDataResources == null) {
+            this.mapDataResources = new java.util.ArrayList();
+        }
+        return this.mapDataResources;
+    }
+
+    private List getMapPageOverlays() {
+        if (mapPageOverlays == null) {
+            this.mapPageOverlays = new java.util.ArrayList();
+        }
+        return this.mapPageOverlays;
+    }
+
+    private List getPreprocessPresentationObjects() {
+        if (preProcessPresentationObjects == null) {
+            this.preProcessPresentationObjects = new java.util.ArrayList();
+        }
+        return this.preProcessPresentationObjects;
+    }
+
+    /**
+     * Constructor for the ResourceEnvironmentGroup, this takes a
+     * name parameter which must be 8 characters long.
+     * @param name the resource environment group name
+     */
+    public ResourceEnvironmentGroup(String name) {
+        super(name);
+    }
+
+    /**
+     * Adds an AFP object mapping reference to this resource environment group
+     * @param obj the object to add
+     */
+    public void addObject(AbstractStructuredAFPObject obj) {
+        getMapDataResources().add(new MapDataResource(obj));
+        getPreprocessPresentationObjects().add(new PreprocessPresentationObject(obj));
+    }
+        
+    /**
+     * Returns an indication if the resource environment group is complete
+     * @return whether or not this resource environment group is complete or not
+     */
+    public boolean isComplete() {
+        return complete;
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    protected void writeStart(OutputStream os) throws IOException {
+        byte[] data = new byte[17];
+        data[0] = 0x5A; // Structured field identifier
+        data[1] = 0x00; // Length byte 1
+        data[2] = 0x10; // Length byte 2
+        data[3] = (byte) 0xD3; // Structured field id byte 1
+        data[4] = (byte) 0xA8; // Structured field id byte 2
+        data[5] = (byte) 0xD9; // Structured field id byte 3
+        data[6] = 0x00; // Flags
+        data[7] = 0x00; // Reserved
+        data[8] = 0x00; // Reserved
+        for (int i = 0; i < nameBytes.length; i++) {
+            data[9 + i] = nameBytes[i];
+        }
+        os.write(data);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void writeContent(OutputStream os) throws IOException {
+        writeObjects(mapDataResources, os);
+        writeObjects(mapPageOverlays, os);
+        writeObjects(preProcessPresentationObjects, os);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void writeEnd(OutputStream os) throws IOException {
+        byte[] data = new byte[17];
+        data[0] = 0x5A; // Structured field identifier
+        data[1] = 0x00; // Length byte 1
+        data[2] = 0x10; // Length byte 2
+        data[3] = (byte) 0xD3; // Structured field id byte 1
+        data[4] = (byte) 0xA9; // Structured field id byte 2
+        data[5] = (byte) 0xD9; // Structured field id byte 3
+        data[6] = 0x00; // Flags
+        data[7] = 0x00; // Reserved
+        data[8] = 0x00; // Reserved
+        for (int i = 0; i < nameBytes.length; i++) {
+            data[9 + i] = nameBytes[i];
+        }
+        os.write(data);
+    }
+}

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java?rev=641873&r1=641872&r2=641873&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceGroup.java Thu Mar 27 09:16:30 2008
@@ -21,32 +21,34 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Map;
+
+import org.apache.fop.render.afp.DataObjectParameters;
+import org.apache.fop.render.afp.ImageObjectParameters;
+import org.apache.fop.render.afp.modca.triplets.FullyQualifiedNameTriplet;
+import org.apache.fop.render.afp.tools.StringUtils;
+import org.apache.xmlgraphics.image.codec.tiff.TIFFImage;
 
 /**
  * A Resource Group contains a set of overlays.
  */
 public final class ResourceGroup extends AbstractNamedAFPObject {
-
+    
     /**
      * Default name for the resource group
      */
     private static final String DEFAULT_NAME = "RG000001";
 
-
     /**
-     * The overlays contained in this resource group
+     * Mapping of resource uri to data resource object (image/graphic) 
      */
-    private List overlays = new ArrayList();
+    private Map/*<String,AbstractAFPObject>*/ resourceMap = null;
 
     /**
      * Default constructor
      */
     public ResourceGroup() {
-
         this(DEFAULT_NAME);
-
     }
 
     /**
@@ -55,53 +57,208 @@
      * @param name the resource group name
      */
     public ResourceGroup(String name) {
-
         super(name);
-
     }
 
+    private static final String IMAGE_NAME_PREFIX = "IMG";
+    private static final String GRAPHIC_NAME_PREFIX = "GRA";
+    private static final String PAGE_SEGMENT_NAME_PREFIX = "PAG";
+    private static final String BARCODE_NAME_PREFIX = "BAR";
+    private static final String OTHER_NAME_PREFIX = "OTH";
+    
     /**
-     * Adds an overlay to the resource group
-     * @param overlay the overlay to add
+     * Converts a byte array containing 24 bit RGB image data to a grayscale
+     * image.
+     * 
+     * @param io
+     *            the target image object
+     * @param raw
+     *            the buffer containing the RGB image data
+     * @param width
+     *            the width of the image in pixels
+     * @param height
+     *            the height of the image in pixels
+     * @param bitsPerPixel
+     *            the number of bits to use per pixel
      */
-    public void addOverlay(Overlay overlay) {
-        overlays.add(overlay);
+    private static void convertToGrayScaleImage(ImageObject io, byte[] raw, int width,
+            int height, int bitsPerPixel) {
+        int pixelsPerByte = 8 / bitsPerPixel;
+        int bytewidth = (width / pixelsPerByte);
+        if ((width % pixelsPerByte) != 0) {
+            bytewidth++;
+        }
+        byte[] bw = new byte[height * bytewidth];
+        byte ib;
+        for (int y = 0; y < height; y++) {
+            ib = 0;
+            int i = 3 * y * width;
+            for (int x = 0; x < width; x++, i += 3) {
+
+                // see http://www.jguru.com/faq/view.jsp?EID=221919
+                double greyVal = 0.212671d * ((int) raw[i] & 0xff) + 0.715160d
+                        * ((int) raw[i + 1] & 0xff) + 0.072169d
+                        * ((int) raw[i + 2] & 0xff);
+                switch (bitsPerPixel) {
+                case 1:
+                    if (greyVal < 128) {
+                        ib |= (byte) (1 << (7 - (x % 8)));
+                    }
+                    break;
+                case 4:
+                    greyVal /= 16;
+                    ib |= (byte) ((byte) greyVal << ((1 - (x % 2)) * 4));
+                    break;
+                case 8:
+                    ib = (byte) greyVal;
+                    break;
+                default:
+                    throw new UnsupportedOperationException(
+                            "Unsupported bits per pixel: " + bitsPerPixel);
+                }
+
+                if ((x % pixelsPerByte) == (pixelsPerByte - 1)
+                        || ((x + 1) == width)) {
+                    bw[(y * bytewidth) + (x / pixelsPerByte)] = ib;
+                    ib = 0;
+                }
+            }
+        }
+        io.setImageIDESize((byte) bitsPerPixel);
+        io.setImageData(bw);
     }
 
     /**
-     * Returns the list of overlays
-     * @return the list of overlays
+     * Helper method to create an image on the current container and to return
+     * the object.
+     * @param params the set of image object parameters
+     * @return a newly created image object
      */
-    public List getOverlays() {
-        return overlays;
+    private ImageObject createImage(ImageObjectParameters params) {
+        String name = IMAGE_NAME_PREFIX
+                + StringUtils.lpad(String.valueOf(getResourceCount() + 1), '0', 5);
+        ImageObject imageObj = new ImageObject(name);
+        if (params.hasCompression()) {
+            int compression = params.getCompression();
+            switch (compression) {
+            case TIFFImage.COMP_FAX_G3_1D:
+                imageObj.setImageEncoding(ImageContent.COMPID_G3_MH);
+                    break;
+                case TIFFImage.COMP_FAX_G3_2D:
+                    imageObj.setImageEncoding(ImageContent.COMPID_G3_MR);
+                    break;
+                case TIFFImage.COMP_FAX_G4_2D:
+                    imageObj.setImageEncoding(ImageContent.COMPID_G3_MMR);
+                    break;
+                default:
+                    throw new IllegalStateException(
+                            "Invalid compression scheme: " + compression);
+            }
+        }
+        imageObj.setFullyQualifiedName(
+                FullyQualifiedNameTriplet.TYPE_BEGIN_RESOURCE_OBJECT_REF,
+                FullyQualifiedNameTriplet.FORMAT_URL, params.getUri());
+        imageObj.setImageParameters(params.getWidthRes(), params.getHeightRes(), 
+                params.getImageDataWidth(), params.getImageDataHeight());
+        if (params.isColor()) {
+            imageObj.setImageIDESize((byte)24);
+            imageObj.setImageData(params.getData());
+        } else {
+            convertToGrayScaleImage(imageObj, params.getData(),
+                    params.getImageDataWidth(), params.getImageDataHeight(),
+                    params.getBitsPerPixel());
+        }
+        return imageObj;
     }
-
+    
     /**
-     * Accessor method to obtain write the AFP datastream for
-     * the resource group.
-     * @param os The stream to write to
-     * @throws java.io.IOException if an I/O exception of some sort has occurred
+     * Helper method to create a graphic in the current container and to return
+     * the object.
+     * @param params the data object parameters
+     * @return a newly created graphics object
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
-
-        writeStart(os);
-
-        writeObjectList(overlays, os);
-
-        writeEnd(os);
+    private GraphicsObject createGraphic(DataObjectParameters params) {
+        String name = GRAPHIC_NAME_PREFIX
+            + StringUtils.lpad(String.valueOf(getResourceCount() + 1), '0', 5);
+        GraphicsObject graphicsObj = new GraphicsObject(name);
+        return graphicsObj;
+    }
 
+    /**
+     * Adds a data object to this resource group
+     * @param params the data object parameters
+     * @return an include object reference
+     */
+    public IncludeObject addObject(DataObjectParameters params) {
+        ResourceObject resourceObj = (ResourceObject)getResourceMap().get(params.getUri());
+        if (resourceObj == null) {
+            AbstractDataObject dataObj;
+            if (params instanceof ImageObjectParameters) {
+                dataObj = createImage((ImageObjectParameters)params);
+            } else {
+                dataObj = createGraphic(params);
+            }
+            // TODO: AC - rotation?
+            int rotation = 0;
+            dataObj.setViewport(params.getX(), params.getY(),
+                    params.getWidth(), params.getHeight(),
+                    params.getWidthRes(), params.getHeightRes(), rotation);
+            
+            // Wrap the data object in a resource object
+            resourceObj = new ResourceObject(dataObj.getName(), dataObj);
+            getResourceMap().put(params.getUri(), resourceObj);
+        }
+        IncludeObject includeObj = new IncludeObject(resourceObj);
+        //includeObj.setObjectAreaSize(params.getX(), params.getY());
+        return includeObj;
+    }
+    
+    /**
+     * @return the number of resources contained in this resource group
+     */
+    public int getResourceCount() {
+        if (resourceMap != null) {
+           return resourceMap.size(); 
+        }
+        return 0;
+    }
+    
+    /**
+     * Returns true if the resource exists within this resource group,
+     * false otherwise.
+     * 
+     * @param uri the uri of the resource
+     * @return true if the resource exists within this resource group
+     */
+    public boolean resourceExists(String uri) {
+        return getResourceMap().containsKey(uri);
+    }
+    
+    /**
+     * Returns the list of resources
+     * @return the list of resources
+     */
+    public Map/*<String,AbstractAFPObject>*/ getResourceMap() {
+        if (resourceMap == null) {
+            resourceMap = new java.util.HashMap/*<String,AbstractAFPObject>*/();
+        }
+        return resourceMap;
     }
 
     /**
-     * Helper method to write the start of the resource group.
-     * @param os The stream to write to
+     * {@inheritDoc}
      */
-    private void writeStart(OutputStream os)
-        throws IOException {
+    public void writeContent(OutputStream os) throws IOException {
+        if (resourceMap != null) {
+            super.writeObjects(resourceMap.values(), os);
+        }
+    }
 
+    /**
+     * {@inheritDoc}
+     */
+    protected void writeStart(OutputStream os) throws IOException {
         byte[] data = new byte[17];
-
         data[0] = 0x5A; // Structured field identifier
         data[1] = 0x00; // Length byte 1
         data[2] = 0x10; // Length byte 2
@@ -111,26 +268,17 @@
         data[6] = 0x00; // Flags
         data[7] = 0x00; // Reserved
         data[8] = 0x00; // Reserved
-
         for (int i = 0; i < nameBytes.length; i++) {
-
             data[9 + i] = nameBytes[i];
-
         }
-
         os.write(data);
-
     }
 
     /**
-     * Helper method to write the end of the resource group.
-     * @param os The stream to write to
+     * {@inheritDoc}
      */
-    private void writeEnd(OutputStream os)
-        throws IOException {
-
+    protected void writeEnd(OutputStream os) throws IOException {
         byte[] data = new byte[17];
-
         data[0] = 0x5A; // Structured field identifier
         data[1] = 0x00; // Length byte 1
         data[2] = 0x10; // Length byte 2
@@ -140,15 +288,16 @@
         data[6] = 0x00; // Flags
         data[7] = 0x00; // Reserved
         data[8] = 0x00; // Reserved
-
         for (int i = 0; i < nameBytes.length; i++) {
-
             data[9 + i] = nameBytes[i];
-
         }
-
         os.write(data);
-
     }
-
-}
\ No newline at end of file
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString() {
+        return this.name + " " + this.resourceMap;
+    }
+}

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceObject.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceObject.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/ResourceObject.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,180 @@
+/*
+ * 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.afp.modca;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.fop.render.afp.modca.triplets.Triplet;
+import org.apache.fop.render.afp.tools.BinaryUtils;
+
+/**
+ * This resource structured field begins an envelope that is used to carry
+ * resource objects in print-file-level (external) resource groups. 
+ */
+public class ResourceObject extends AbstractPreparedAFPObject {
+    
+    /**
+     * Resource object types
+     */
+    private static final byte GRAPHICS_OBJECT = 0x03;
+    private static final byte BARCODE_OBJECT = 0x05;
+    private static final byte IMAGE_OBJECT = 0x06;
+    private static final byte FONT_CHARACTER_SET_OBJECT = 0x40;
+    private static final byte CODE_PAGE_OBJECT = 0x41;
+    private static final byte CODED_FONT_OBJECT = 0x42;
+    private static final byte OBJECT_CONTAINER = (byte) 0x92;
+    private static final byte DOCUMENT_OBJECT = (byte) 0xA8;
+    private static final byte PAGE_SEGMENT_OBJECT = (byte) 0xFB;
+    private static final byte OVERLAY_OBJECT = (byte) 0xFC;
+    private static final byte PAGEDEF_OBJECT = (byte) 0xFD;
+    private static final byte FORMDEF_OBJECT = (byte) 0xFE;
+        
+    /**
+     * the resource object
+     */    
+    private AbstractNamedAFPObject resourceObj = null;
+    
+    /**
+     * Default constructor
+     * 
+     * @param name the name of this resource (reference id)
+     * @param resourceObj the resource object to be added
+     */
+    public ResourceObject(String name, AbstractNamedAFPObject resourceObj) {
+        super(name);
+        this.resourceObj = resourceObj;
+        byte type;
+        if (resourceObj instanceof ImageObject) {
+            type = IMAGE_OBJECT;
+        } else if (resourceObj instanceof GraphicsObject) {
+            type = GRAPHICS_OBJECT;
+        } else if (resourceObj instanceof Document) {
+            type = DOCUMENT_OBJECT;
+        } else if (resourceObj instanceof PageSegment) {
+            type = PAGE_SEGMENT_OBJECT;
+        } else if (resourceObj instanceof Overlay) {
+            type = OVERLAY_OBJECT;
+        } else {
+            throw new UnsupportedOperationException(
+                    "Unsupported resource object type " + resourceObj);
+        }
+        setResourceObjectType(type);
+    }
+
+    private void setResourceObjectType(byte type) {
+        getTriplets().add(new ResourceObjectTypeTriplet(type));        
+    }
+    
+    /**
+     * @return the resource object contained in this envelope 
+     */
+    public AbstractNamedAFPObject getResource() {
+        return this.resourceObj;
+    }
+        
+    /**
+     * {@inheritDoc}
+     */
+    protected void writeStart(OutputStream os) throws IOException {
+        super.writeStart(os);
+        
+        // Set the total record length
+        byte[] len = BinaryUtils.convert(18 + getTripletDataLength(), 2);
+        byte[] data = new byte[] {
+            0x5A, // Structured field identifier
+            len[0], // Length byte 1
+            len[1], // Length byte 2
+            (byte)0xD3, // Structured field id byte 1
+            (byte)0xA8, // Structured field id byte 2
+            (byte)0xCE, // Structured field id byte 3
+            0x00, // Flags
+            0x00, // Reserved
+            0x00, // Reserved
+            nameBytes[0],            
+            nameBytes[1],
+            nameBytes[2],
+            nameBytes[3],
+            nameBytes[4],
+            nameBytes[5],
+            nameBytes[6],
+            nameBytes[7],
+            0x00, // Reserved
+            0x00, // Reserved
+        };
+        os.write(data);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void writeContent(OutputStream os) throws IOException {
+        super.writeContent(os); // write triplets
+        if (resourceObj != null) {
+            resourceObj.writeDataStream(os);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void writeEnd(OutputStream os) throws IOException {
+        byte[] data = new byte[] {
+           0x5A, // Structured field identifier
+           0x00, // Length byte 1
+           0x10, // Length byte 2
+           (byte)0xD3, // Structured field id byte 1
+           (byte)0xA9, // Structured field id byte 2
+           (byte)0xCE, // Structured field id byte 3
+           0x00, // Flags
+           0x00, // Reserved
+           0x00, // Reserved
+           nameBytes[0],            
+           nameBytes[1],
+           nameBytes[2],
+           nameBytes[3],
+           nameBytes[4],
+           nameBytes[5],
+           nameBytes[6],
+           nameBytes[7],
+        };
+        os.write(data);
+    }
+    
+    private class ResourceObjectTypeTriplet extends Triplet {
+
+        private static final byte RESOURCE_OBJECT = 0x21;
+
+        /**
+         * Main constructor
+         * 
+         * @param type
+         *            the resource type
+         */
+        public ResourceObjectTypeTriplet(byte type) {
+            super(RESOURCE_OBJECT,
+                new byte[] {
+                    type,
+                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+                }
+            );
+        }
+    }
+}

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/FullyQualifiedNameTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/FullyQualifiedNameTriplet.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/FullyQualifiedNameTriplet.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/FullyQualifiedNameTriplet.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,102 @@
+/*
+ * 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: $ */
+
+/*
+ * 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.afp.modca.triplets;
+
+
+/**
+ * A Fully Qualified Name triplet enable the identification and referencing of
+ * objects using Gloabl Identifiers (GIDs). 
+ */
+public class FullyQualifiedNameTriplet extends Triplet {
+    // Specifies how the GID will be used
+    public static final byte TYPE_REPLACE_FIRST_GID_NAME = 0x01;
+    public static final byte TYPE_FONT_FAMILY_NAME = 0x07;
+    public static final byte TYPE_FONT_TYPEFACE_NAME = 0x08;
+    public static final byte TYPE_MODCA_RESOURCE_HIERARCHY_REF = 0x09;
+    public static final byte TYPE_BEGIN_RESOURCE_GROUP_REF = 0x0A;
+    public static final byte TYPE_ATTRIBUTE_GID = 0x0B;
+    public static final byte TYPE_PROCESS_ELEMENT_GID = 0x0C;
+    public static final byte TYPE_BEGIN_PAGE_GROUP_REF = 0x0D;
+    public static final byte TYPE_MEDIA_TYPE_REF = 0x11;
+    public static final byte TYPE_COLOR_MANAGEMENT_RESOURCE_REF = 0x41;
+    public static final byte TYPE_DATA_OBJECT_FONT_BASE_FONT_ID = 0x6E;
+    public static final byte TYPE_DATA_OBJECT_FONT_LINKED_FONT_ID = 0x7E;
+    public static final byte TYPE_BEGIN_DOCUMENT_REF = (byte)0x83;
+    public static final byte TYPE_BEGIN_RESOURCE_OBJECT_REF = (byte)0x84;
+    public static final byte TYPE_CODE_PAGE_NAME_REF = (byte)0x85;        
+    public static final byte TYPE_FONT_CHARSET_NAME_REF = (byte)0x86;
+    public static final byte TYPE_BEGIN_PAGE_REF = (byte)0x87;
+    public static final byte TYPE_BEGIN_MEDIUM_MAP_REF = (byte)0x8D;
+    public static final byte TYPE_CODED_FONT_NAME_REF = (byte)0x8E;        
+    public static final byte TYPE_BEGIN_DOCUMENT_INDEX_REF = (byte)0x98;        
+    public static final byte TYPE_BEGIN_OVERLAY_REF = (byte)0xB0;
+    public static final byte TYPE_DATA_OBJECT_INTERNAL_RESOURCE_REF = (byte)0xBE;
+    public static final byte TYPE_INDEX_ELEMENT_GID = (byte)0xCA;
+    public static final byte TYPE_OTHER_OBJECT_DATA_REF = (byte)0xCE;
+    public static final byte TYPE_DATA_OBJECT_EXTERNAL_RESOURCE_REF = (byte)0xDE;
+    
+    // GID Format
+    public static final byte FORMAT_CHARSTR = (byte)0x00;
+    public static final byte FORMAT_OID = (byte)0x10;
+    public static final byte FORMAT_URL = (byte)0x20;
+    
+    private byte[] fqName;
+    
+    /**
+     * @return the actual fully qualified name of this triplet
+     */
+    public byte[] getFullyQualifiedName() {
+        return fqName;
+    }
+
+    /**
+     * Main constructor
+     * @param fqnType the fully qualified name type
+     * @param fqnFmt the fully qualified name format
+     * @param fqName the fully qualified name
+     */
+    public FullyQualifiedNameTriplet(byte fqnType, byte fqnFmt, byte[] fqName) {
+        super(FULLY_QUALIFIED_NAME);
+        this.fqName = fqName;
+        super.data = new byte[2 + fqName.length];
+        data[0] = fqnType;
+        data[1] = fqnFmt;
+        // FQName
+        System.arraycopy(fqName, 0, data, 2, fqName.length);
+    }
+}
\ No newline at end of file

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/MeasurementUnitsTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/MeasurementUnitsTriplet.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/MeasurementUnitsTriplet.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/MeasurementUnitsTriplet.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,50 @@
+/*
+ * 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.afp.modca.triplets;
+
+import org.apache.fop.render.afp.tools.BinaryUtils;
+
+/**
+ * The Measurement Units triplet is used to specify the units of measure
+ * for a presentation space
+ */
+public class MeasurementUnitsTriplet extends Triplet {
+
+    private static final byte TEN_INCHES = 0x00; 
+    private static final byte TEN_CM = 0x01;
+    
+    /**
+     * Main constructor
+     */
+    public MeasurementUnitsTriplet() {
+        super(MEASUREMENT_UNITS);
+        //TODO: units correct?
+        byte[] xUnits = BinaryUtils.convert(1, 2);
+        byte[] yUnits = BinaryUtils.convert(1, 2);
+        super.data = new byte[] {
+             TEN_INCHES, // XoaBase
+             TEN_INCHES, // YoaBase
+             xUnits[0], // XoaUnits (x units per unit base)                
+             xUnits[1],
+             yUnits[0], // YoaUnits (y units per unit base)
+             yUnits[1]
+        };
+    }
+}

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectAreaSizeTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectAreaSizeTriplet.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectAreaSizeTriplet.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectAreaSizeTriplet.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,49 @@
+/*
+ * 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.afp.modca.triplets;
+
+import org.apache.fop.render.afp.tools.BinaryUtils;
+
+/**
+ * The Object Area Size triplet is used to specify the extent of an object area
+ * in the X and Y directions
+ */
+public class ObjectAreaSizeTriplet extends Triplet {
+
+    /**
+     * Main constructor
+     * @param x the object area extent for the X axis
+     * @param y the object area extent for the Y axis
+     */
+    public ObjectAreaSizeTriplet(int x, int y) {
+        super(Triplet.OBJECT_AREA_SIZE);
+        byte[] xOASize = BinaryUtils.convert(x, 3);
+        byte[] yOASize = BinaryUtils.convert(y, 3);
+        super.data = new byte[] {
+            0x02, // SizeType
+            xOASize[0], // XoaSize - Object area extent for X axis
+            xOASize[1],
+            xOASize[2],
+            yOASize[0], // YoaSize - Object area extent for Y axis
+            yOASize[1],
+            yOASize[2]
+        };
+    }
+}

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectClassificationTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectClassificationTriplet.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectClassificationTriplet.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ObjectClassificationTriplet.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,70 @@
+/*
+ * 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.afp.modca.triplets;
+
+import org.apache.fop.render.afp.modca.Registry;
+
+/**
+ * The Object Classification is used to classify and identify object data.
+ * The object data may or may not be defined by an IBM presentation architecture
+ */
+public class ObjectClassificationTriplet extends Triplet {    
+    public static final byte CLASS_TIME_INVARIANT_PAGINATED_PRESENTATION_OBJECT = 0x01;
+    public static final byte CLASS_TIME_VARIANT_PRESENTATION_OBJECT = 0x10;
+    public static final byte CLASS_EXECUTABLE_PROGRAM = 0x20;
+    public static final byte CLASS_SETUP_FILE = 0x30;
+    public static final byte CLASS_SECONDARY_RESOURCE = 0x40;
+    public static final byte CLASS_DATA_OBJECT_FONT = 0x41;
+    
+    /**
+     * Main constructor
+     * 
+     * @param objectClass
+     *             the object class type
+     * @param componentId
+     *             the object componentId
+     */
+    public ObjectClassificationTriplet(byte objectClass, byte componentId) {
+        super(OBJECT_CLASSIFICATION);
+        byte[] data = new byte[93];
+        data[0] = 0x00; // reserved (must be zero)
+        data[1] = objectClass; // ObjClass
+        data[2] = 0x00; // reserved (must be zero)
+        data[3] = 0x00; // reserved (must be zero)
+        data[4] = 0x00; // StrucFlgs - Information on the structure of the object container
+        data[5] = 0x00; // StrucFlgs
+        
+        Registry.Entry entry = Registry.getInstance().getEntry(componentId);
+        
+        if (entry == null) {
+            throw new UnsupportedOperationException("unknown registry entry " + componentId);
+        }
+        // RegObjId - MOD:CA-registered ASN.1 OID for object type (8-23)
+        System.arraycopy(entry.getOID(), 0, data, 6, entry.getOID().length);
+            
+        // ObjTpName - name of object type (24-55)
+        System.arraycopy(entry.getObjectTypeName(), 0, data, 22,
+                entry.getObjectTypeName().length);
+             
+        // ObjLev (not specified) - Release level or version number of object type (56-63)
+
+        // CompName (not specified) - Name of company or org that owns object definition (64-95)
+    }        
+}
\ No newline at end of file

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ResourceObjectTypeTriplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ResourceObjectTypeTriplet.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ResourceObjectTypeTriplet.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/ResourceObjectTypeTriplet.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,21 @@
+/*
+ * 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.afp.modca.triplets;
+

Added: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/Triplet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/Triplet.java?rev=641873&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/Triplet.java (added)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/triplets/Triplet.java Thu Mar 27 09:16:30 2008
@@ -0,0 +1,158 @@
+/*
+ * 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.afp.modca.triplets;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+
+import org.apache.fop.render.afp.modca.AFPConstants;
+import org.apache.fop.render.afp.modca.AbstractAFPObject;
+
+/**
+ * A simple implementation of a MOD:CA triplet
+ */
+public class Triplet extends AbstractAFPObject {
+    public static final byte CODED_GRAPHIC_CHARACTER_SET_GLOBAL_IDENTIFIER = 0x01;
+    public static final byte FULLY_QUALIFIED_NAME = 0x02;    
+    public static final byte MAPPING_OPTION = 0x04;  
+    public static final byte OBJECT_CLASSIFICATION = 0x10;    
+    public static final byte MODCA_INTERCHANGE_SET = 0x18;    
+    public static final byte FONT_DESCRIPTOR_SPECIFICATION = 0x1F;    
+    public static final byte OBJECT_FUNCTION_SET_SPECIFICATION = 0x21;    
+    public static final byte EXTENDED_RESOURCE_LOCAL_IDENTIFIER = 0x22;    
+    public static final byte RESOURCE_LOCAL_IDENTIFIER = 0x24;   
+    public static final byte RESOURCE_SECTION_NUMBER = 0x25;   
+    public static final byte CHARACTER_ROTATION = 0x26;   
+    public static final byte OBJECT_BYTE_OFFSET = 0x2D;   
+    public static final byte ATTRIBUTE_VALUE = 0x36;   
+    public static final byte DESCRIPTOR_POSITION = 0x43;   
+    public static final byte MEDIA_EJECT_CONTROL = 0x45;  
+    public static final byte PAGE_OVERLAY_CONDITIONAL_PROCESSING = 0x46;  
+    public static final byte RESOURCE_USAGE_ATTRIBUTE = 0x47;  
+    public static final byte MEASUREMENT_UNITS = 0x4B;  
+    public static final byte OBJECT_AREA_SIZE = 0x4C;  
+    public static final byte AREA_DEFINITION = 0x4D;  
+    public static final byte COLOR_SPECIFICATION = 0x4E;  
+    public static final byte ENCODING_SCHEME_ID = 0x50;  
+    public static final byte MEDIUM_MAP_PAGE_NUMBER = 0x56;  
+    public static final byte OBJECT_BYTE_EXTENT = 0x57;  
+    public static final byte OBJECT_STRUCTURED_FIELD_OFFSET = 0x58;  
+    public static final byte OBJECT_STRUCTURED_FIELD_EXTENT = 0x59;  
+    public static final byte OBJECT_OFFSET = 0x5A;  
+    public static final byte FONT_HORIZONTAL_SCALE_FACTOR = 0x5D;  
+    public static final byte OBJECT_COUNT = 0x5E;  
+    public static final byte OBJECT_DATE_AND_TIMESTAMP = 0x62;  
+    public static final byte COMMENT = 0x65;  
+    public static final byte MEDIUM_ORIENTATION = 0x68;  
+    public static final byte RESOURCE_OBJECT_INCLUDE = 0x6C;  
+    public static final byte PRESENTATION_SPACE_RESET_MIXING = 0x70;  
+    public static final byte PRESENTATION_SPACE_MIXING_RULE = 0x71;  
+    public static final byte UNIVERSAL_DATE_AND_TIMESTAMP = 0x72;  
+    public static final byte TONER_SAVER = 0x74;
+    public static final byte COLOR_FIDELITY = 0x75;
+    public static final byte FONT_FIDELITY = 0x78;
+    public static final byte ATTRIBUTE_QUALIFIER = (byte)0x80;
+    public static final byte PAGE_POSITION_INFORMATION = (byte)0x81;
+    public static final byte PARAMETER_VALUE = (byte)0x82;
+    public static final byte PRESENTATION_CONTROL = (byte)0x83;
+    public static final byte FONT_RESOLUTION_AND_METRIC_TECHNOLOGY = (byte)0x84;
+    public static final byte FINISHING_OPERATION = (byte)0x85;
+    public static final byte TEXT_FIDELITY = (byte)0x86;
+    public static final byte MEDIA_FIDELITY = (byte)0x87;
+    public static final byte FINISHING_FIDELITY = (byte)0x88;
+    public static final byte DATA_OBJECT_FONT_DESCRIPTOR = (byte)0x8B;
+    public static final byte LOCALE_SELECTOR = (byte)0x8C;
+    public static final byte UP3I_FINISHING_OPERATION = (byte)0x8E;
+    public static final byte COLOR_MANAGEMENT_RESOURCE_DESCRIPTOR = (byte)0x91;
+    public static final byte RENDERING_INTENT = (byte)0x95;
+    public static final byte CMR_TAG_FIDELITY = (byte)0x96;
+    public static final byte DEVICE_APPEARANCE = (byte)0x97;
+
+    /**
+     * the triplet identifier
+     */
+    protected byte id;
+
+    /**
+     * the triplet's data contents
+     */
+    protected byte[] data;
+
+    /**
+     * Main constructor
+     * @param id the triplet identifier (see static definitions above)
+     * @param contents the data item contained in this triplet
+     */
+    public Triplet(byte id, byte[] contents) {
+        this(id);
+        this.data = contents;
+    }
+
+    /**
+     * Constructor
+     * @param id the triplet identifier (see static definitions above)
+     */
+    public Triplet(byte id) {
+        this.id = id;
+    }
+
+    /**
+     * Constructor
+     * @param id the triplet identifier (see static definitions above)
+     * @param content the content byte data
+     */
+    public Triplet(byte id, byte content) {
+        this(id, new byte[] {content});
+    }
+
+    /**
+     * Constructor
+     * @param id the triplet identifier (see static definitions above)
+     * @param data the data item (in String form) contained in this triplet
+     * @throws UnsupportedEncodingException EBCIDIC encoding is not supported
+     */
+    public Triplet(byte id, String data) throws UnsupportedEncodingException {
+        this(id, data.getBytes(AFPConstants.EBCIDIC_ENCODING));
+    }
+        
+    /**
+     * {@inheritDoc}
+     */
+    public void writeDataStream(OutputStream os) throws IOException {
+        os.write((byte)data.length + 2);
+        os.write(id);
+        os.write(data);
+    }
+    
+    /**
+     * @return the triplet identifier
+     */
+    public byte getId() {
+        return this.id;
+    }
+
+    /**
+     * @return the contents of the triplet
+     */
+    public byte[] getData() {
+        return this.data;
+    }
+}

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java?rev=641873&r1=641872&r2=641873&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/pdf/PDFRenderer.java Thu Mar 27 09:16:30 2008
@@ -1086,10 +1086,10 @@
     /** 
      * {@inheritDoc} 
      */
-    protected void fillRect(float x, float y, float w, float h) {
-        if (w != 0 && h != 0) {
+    protected void fillRect(float x, float y, float width, float height) {
+        if (width > 0 && height > 0) {
             currentStream.add(format(x) + " " + format(y) + " " 
-                    + format(w) + " " + format(h) + " re f\n");
+                    + format(width) + " " + format(height) + " re f\n");
         }
     }
     
@@ -1684,7 +1684,7 @@
         endTextObject();
         putImage(url, pos, foreignAttributes);
     }
-    
+     
     /**
      * Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
      * @param uri URL of the bitmap
@@ -1767,6 +1767,7 @@
             this.pdfDoc.output(ostream);
         } catch (IOException ioe) {
             // ioexception will be caught later
+            log.error(ioe.getMessage());
         }
     }
 

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java?rev=641873&r1=641872&r2=641873&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java Thu Mar 27 09:16:30 2008
@@ -27,8 +27,6 @@
  */
 public class PSCommentAfterElement extends AbstractPSCommentElement {
 
-    protected static final String ELEMENT = "ps-comment-after";
-
     /**
      * Main constructor
      * @param parent node
@@ -42,7 +40,7 @@
      * @see org.apache.fop.fo.FONode#getLocalName()
      */
     public String getLocalName() {
-        return ELEMENT;
+        return PSCommentAfter.ELEMENT;
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java?rev=641873&r1=641872&r2=641873&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java Thu Mar 27 09:16:30 2008
@@ -27,8 +27,6 @@
  */
 public class PSCommentBeforeElement extends AbstractPSCommentElement {
 
-    protected static final String ELEMENT = "ps-comment-before";
-
     /**
      * Main constructor
      * @param parent parent node
@@ -42,7 +40,7 @@
      * @see org.apache.fop.fo.FONode#getLocalName()
      */
     public String getLocalName() {
-        return ELEMENT;
+        return PSCommentBefore.ELEMENT;
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java?rev=641873&r1=641872&r2=641873&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java Thu Mar 27 09:16:30 2008
@@ -42,8 +42,8 @@
             foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker());
             foObjs.put(PSPageSetupCodeElement.ELEMENT, new PSPageSetupCodeMaker());
             foObjs.put(PSSetPageDeviceElement.ELEMENT, new PSSetPageDeviceMaker());
-            foObjs.put(PSCommentBeforeElement.ELEMENT, new PSCommentBeforeMaker());
-            foObjs.put(PSCommentAfterElement.ELEMENT, new PSCommentAfterMaker());
+            foObjs.put(PSCommentBefore.ELEMENT, new PSCommentBeforeMaker());
+            foObjs.put(PSCommentAfter.ELEMENT, new PSCommentAfterMaker());
         }
     }
 



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