xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r603656 [5/7] - in /xmlgraphics/fop/branches/Temp_ImagePackageRedesign: ./ examples/fo/basic/ lib/ src/documentation/ src/documentation/content/xdocs/ src/documentation/content/xdocs/trunk/ src/documentation/intermediate-format-ng/ src/java...
Date Wed, 12 Dec 2007 16:13:16 GMT
Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/CharacterSetOrientation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/CharacterSetOrientation.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/CharacterSetOrientation.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/CharacterSetOrientation.java Wed Dec 12 08:13:06 2007
@@ -19,7 +19,6 @@
 
 package org.apache.fop.render.afp.fonts;
 
-
 /**
  * The IBM Font Object Content Architecture (FOCA) supports presentation
  * of character shapes by defining their characteristics, which include
@@ -31,10 +30,10 @@
  * that you communicate this information clearly to rotate and position
  * characters correctly on the physical or logical page.
  *
- * This class proivdes font metric information for a particular font
+ * This class provides font metric information for a particular font
  * as by the orientation.
  *
- * This informtaion is obtained directly from the AFP font files which must
+ * This information is obtained directly from the AFP font files which must
  * be installed in the classpath under in the location specified by the path
  * attribute in the afp-font.xml file.
  * <p/>
@@ -44,53 +43,53 @@
     /**
      * The code page to which the character set relates
      */
-    private String _codePage;
+    private String codePage;
 
     /**
      * The encoding used for the code page
      */
-    private String _encoding;
+    private String encoding;
 
     /**
      * The ascender height for the character set
      */
-    private int _ascender;
+    private int ascender;
 
     /**
      * The descender depth for the character set
      */
-    private int _descender;
+    private int descender;
 
     /**
      * The height of capital letters
      */
-    private int _capHeight;
+    private int capHeight;
 
     /**
      * The characters in the charcater set
      */
-    private int[] _characters = new int[256];
+    private int[] chars = new int[256];
 
     /**
      * The height of lowercase letters
      */
-    private int _xHeight;
+    private int xHeight;
 
     /**
      * The first character
      */
-    private int _firstCharacter;
+    private int firstChar;
 
     /**
      * The last character
      */
-    private int _lastCharacter;
+    private int lastChar;
 
 
     /**
      * The character set orientation
      */
-    private int _orientation = 0;
+    private int orientation = 0;
 
     /**
      * Constructor for the CharacterSetOrientation, the orientation is
@@ -98,9 +97,7 @@
      * @param orientation the character set orientation
      */
     public CharacterSetOrientation(int orientation) {
-
-        _orientation = orientation;
-
+        this.orientation = orientation;
     }
 
     /**
@@ -116,7 +113,7 @@
      * @return the ascender value in millipoints
      */
     public int getAscender() {
-        return _ascender;
+        return ascender;
     }
 
     /**
@@ -126,7 +123,7 @@
      * @return the cap height value in millipoints
      */
     public int getCapHeight() {
-        return _capHeight;
+        return capHeight;
     }
 
     /**
@@ -136,7 +133,7 @@
      * @return the descender value in millipoints
      */
     public int getDescender() {
-        return _descender;
+        return descender;
     }
 
     /**
@@ -144,7 +141,7 @@
      * @return the first character
      */
     public int getFirstChar() {
-        return _firstCharacter;
+        return firstChar;
     }
 
     /**
@@ -152,7 +149,7 @@
      * @return the last character
      */
     public int getLastChar() {
-        return _lastCharacter;
+        return lastChar;
     }
 
     /**
@@ -160,7 +157,7 @@
      * @return the orientation
      */
     public int getOrientation() {
-        return _orientation;
+        return orientation;
     }
 
     /**
@@ -169,11 +166,9 @@
      * @return the widths of all characters
      */
     public int[] getWidths() {
-
         int arr[] = new int[(getLastChar() - getFirstChar()) + 1];
-        System.arraycopy(_characters, getFirstChar(), arr, 0, (getLastChar() - getFirstChar()) + 1);
+        System.arraycopy(chars, getFirstChar(), arr, 0, (getLastChar() - getFirstChar()) + 1);
         return arr;
-
     }
 
     /**
@@ -182,7 +177,7 @@
      * @return heightX the typical height of characters
      */
     public int getXHeight() {
-        return _xHeight;
+        return xHeight;
     }
 
     /**
@@ -192,7 +187,7 @@
      * @return the widths of the character
      */
     public int width(int character) {
-        return _characters[character];
+        return chars[character];
     }
 
     /**
@@ -208,7 +203,7 @@
      * @param ascender the ascender to set
      */
     public void setAscender(int ascender) {
-        _ascender = ascender;
+        this.ascender = ascender;
     }
 
     /**
@@ -218,7 +213,7 @@
      * @param capHeight the cap height to set
      */
     public void setCapHeight(int capHeight) {
-        _capHeight = capHeight;
+        this.capHeight = capHeight;
     }
 
     /**
@@ -228,23 +223,23 @@
      * @param descender the descender value in millipoints
      */
     public void setDescender(int descender) {
-        _descender = descender;
+        this.descender = descender;
     }
 
     /**
      * The first character in the character set
-     * @param firstCharacter the first character
+     * @param firstChar the first character
      */
-    public void setFirstChar(int firstCharacter) {
-        _firstCharacter = firstCharacter;
+    public void setFirstChar(int firstChar) {
+        this.firstChar = firstChar;
     }
 
     /**
      * The last character in the character set
-     * @param lastCharacter the last character
+     * @param lastChar the last character
      */
-    public void setLastChar(int lastCharacter) {
-        _lastCharacter = lastCharacter;
+    public void setLastChar(int lastChar) {
+        this.lastChar = lastChar;
     }
 
     /**
@@ -255,13 +250,13 @@
      */
     public void setWidth(int character, int width) {
 
-        if (character >= _characters.length) {
+        if (character >= chars.length) {
             // Increase the size of the array if necessary
-            int arr[] = new int[(character - _firstCharacter) + 1];
-            System.arraycopy(_characters, 0, arr, 0, _characters.length);
-            _characters = arr;
+            int arr[] = new int[(character - firstChar) + 1];
+            System.arraycopy(chars, 0, arr, 0, chars.length);
+            chars = arr;
         }
-        _characters[character] = width;
+        chars[character] = width;
 
     }
 
@@ -271,6 +266,6 @@
      * @param xHeight the typical height of characters
      */
     public void setXHeight(int xHeight) {
-        _xHeight = xHeight;
+        this.xHeight = xHeight;
     }
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/FopCharacterSet.java Wed Dec 12 08:13:06 2007
@@ -27,8 +27,8 @@
 public class FopCharacterSet extends CharacterSet {
 
     /** The character set for this font */
-    private Typeface _characterSet = null;
-    private int _size = 0;
+    private Typeface charSet = null;
+    private int size = 0;
 
     /**
      * Constructor for the CharacterSetMetric object, the character set is used
@@ -37,17 +37,18 @@
      * @param encoding the encoding of the font
      * @param name the character set name
      * @param size the font size
-     * @param characterSet the fop character set
+     * @param charSet the fop character set
      */
     public FopCharacterSet(
         String codePage,
         String encoding,
         String name,
         int size,
-        Typeface characterSet) {
+        Typeface charSet) {
+        
         super(codePage, encoding, name, null);
-        _characterSet = characterSet;
-        _size = size * 1000;
+        this.charSet = charSet;
+        this.size = size * 1000;
     }
 
     /**
@@ -63,7 +64,7 @@
      * @return the ascender value in millipoints
      */
     public int getAscender() {
-        return _characterSet.getAscender(_size);
+        return charSet.getAscender(size);
     }
 
     /**
@@ -73,7 +74,7 @@
      * @return the cap height value in millipoints
      */
     public int getCapHeight() {
-        return _characterSet.getCapHeight(_size);
+        return charSet.getCapHeight(size);
     }
 
     /**
@@ -83,7 +84,7 @@
      * @return the descender value in millipoints
      */
     public int getDescender() {
-        return _characterSet.getDescender(_size);
+        return charSet.getDescender(size);
     }
 
     /**
@@ -107,7 +108,7 @@
      * @return the widths of all characters
      */
     public int[] getWidths() {
-        return _characterSet.getWidths();
+        return charSet.getWidths();
     }
 
     /**
@@ -115,7 +116,7 @@
      * @return the typical height of characters
      */
     public int getXHeight() {
-        return _characterSet.getXHeight(_size);
+        return charSet.getXHeight(size);
     }
 
     /**
@@ -125,7 +126,7 @@
      * @return the width of the character
      */
     public int width(int character) {
-        return _characterSet.getWidth(character, _size);
+        return charSet.getWidth(character, size);
     }
 
     /**
@@ -134,7 +135,7 @@
      * @return the mapped character
      */
     public char mapChar(char c) {
-        return _characterSet.mapChar(c);
+        return charSet.mapChar(c);
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/OutlineFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/OutlineFont.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/OutlineFont.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/OutlineFont.java Wed Dec 12 08:13:06 2007
@@ -28,19 +28,19 @@
 public class OutlineFont extends AFPFont {
 
     /** The character set for this font */
-    private CharacterSet _characterSet = null;
+    private CharacterSet charSet = null;
 
     /**
      * Constructor for an outline font.
      *
      * @param name
      *            the name of the font
-     * @param characterSet
+     * @param charSet
      *            the chracter set
      */
-    public OutlineFont(String name, CharacterSet characterSet) {
+    public OutlineFont(String name, CharacterSet charSet) {
         super(name);
-        _characterSet = characterSet;
+        this.charSet = charSet;
     }
 
     /**
@@ -50,7 +50,7 @@
      */
     public CharacterSet getCharacterSet() {
 
-        return _characterSet;
+        return charSet;
 
     }
 
@@ -61,26 +61,24 @@
      */
     public CharacterSet getCharacterSet(int size) {
 
-        return _characterSet;
+        return charSet;
 
     }
 
     /**
      * Get the first character in this font.
+     * @return the first character in this font
      */
     public int getFirstChar() {
-
-        return _characterSet.getFirstChar();
-
+        return charSet.getFirstChar();
     }
 
     /**
      * Get the last character in this font.
+     * @return the last character in this font
      */
     public int getLastChar() {
-
-        return _characterSet.getLastChar();
-
+        return charSet.getLastChar();
     }
 
     /**
@@ -90,11 +88,10 @@
      *
      * @param size
      *            the point size
+     * @return the ascender for the given size
      */
     public int getAscender(int size) {
-
-        return _characterSet.getAscender() / 1000 * size;
-
+        return charSet.getAscender() / 1000 * size;
     }
 
     /**
@@ -102,11 +99,10 @@
      *
      * @param size
      *            the point size
+     * @return the cap height for the given size
      */
     public int getCapHeight(int size) {
-
-        return _characterSet.getCapHeight() / 1000 * size;
-
+        return charSet.getCapHeight() / 1000 * size;
     }
 
     /**
@@ -116,11 +112,10 @@
      *
      * @param size
      *            the point size
+     * @return the descender for the given size
      */
     public int getDescender(int size) {
-
-        return _characterSet.getDescender() / 1000 * size;
-
+        return charSet.getDescender() / 1000 * size;
     }
 
     /**
@@ -128,20 +123,20 @@
      *
      * @param size
      *            the point size
+     * @return the x height for the given size
      */
     public int getXHeight(int size) {
-
-        return _characterSet.getXHeight() / 1000 * size;
-
+        return charSet.getXHeight() / 1000 * size;
     }
 
     /**
      * Obtain the width of the character for the specified point size.
+     * @param character the character
+     * @param size point size
+     * @return the width of the character for the specified point size
      */
     public int getWidth(int character, int size) {
-
-        return _characterSet.width(character) / 1000 * size;
-
+        return charSet.width(character) / 1000 * size;
     }
 
     /**
@@ -153,13 +148,11 @@
      * @return the widths of all characters
      */
     public int[] getWidths(int size) {
-
-        int[] widths =  _characterSet.getWidths();
+        int[] widths =  charSet.getWidths();
         for (int i = 0; i < widths.length; i++) {
             widths[i] = widths[i] / 1000 * size;
         }
         return widths;
-
     }
 
     /**
@@ -169,9 +162,7 @@
      * @return the widths of all characters
      */
     public int[] getWidths() {
-
         return getWidths(1000);
-
     }
 
     /**
@@ -180,7 +171,7 @@
      * @return the mapped character
      */
     public char mapChar(char c) {
-        return _characterSet.mapChar(c);
+        return charSet.mapChar(c);
     }
 
     /**
@@ -188,7 +179,6 @@
      * @return the encoding
      */
     public String getEncoding() {
-        return _characterSet.getEncoding();
+        return charSet.getEncoding();
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/RasterFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/RasterFont.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/RasterFont.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/fonts/RasterFont.java Wed Dec 12 08:13:06 2007
@@ -39,9 +39,9 @@
     /** Static logging instance */
     protected static final Log log = LogFactory.getLog("org.apache.fop.render.afp.fonts");
 
-    private HashMap _characterSets = new HashMap();
+    private Map charSets = new HashMap();
 
-    private CharacterSet _characterSet = null;
+    private CharacterSet charSet = null;
 
     /**
      * Constructor for the raster font requires the name, weight and style
@@ -54,12 +54,14 @@
         super(name);
     }
 
+    /**
+     * Adds the character set for the given point size
+     * @param size point size
+     * @param characterSet character set
+     */
     public void addCharacterSet(int size, CharacterSet characterSet) {
-
-        _characterSets.put(String.valueOf(size), characterSet);
-
-        _characterSet = characterSet;
-
+        this.charSets.put(String.valueOf(size), characterSet);
+        this.charSet = characterSet;
     }
 
     /**
@@ -71,14 +73,14 @@
     public CharacterSet getCharacterSet(int size) {
 
         String pointsize = String.valueOf(size / 1000);
-        CharacterSet csm = (CharacterSet) _characterSets.get(pointsize);
+        CharacterSet csm = (CharacterSet) charSets.get(pointsize);
         if (csm == null) {
-            csm = (CharacterSet) _characterSets.get(size + "mpt");
+            csm = (CharacterSet) charSets.get(size + "mpt");
         }
         if (csm == null) {
             // Get char set with nearest font size
             int distance = Integer.MAX_VALUE;
-            for (Iterator it = _characterSets.entrySet().iterator(); it.hasNext(); ) {
+            for (Iterator it = charSets.entrySet().iterator(); it.hasNext();) {
                 Map.Entry me = (Map.Entry)it.next();
                 String key = (String)me.getKey();
                 if (!key.endsWith("mpt")) {
@@ -91,7 +93,7 @@
                 }
             }
             if (csm != null) {
-                _characterSets.put(size + "mpt", csm);
+                charSets.put(size + "mpt", csm);
                 String msg = "No " + (size / 1000) + "pt font " + getFontName()
                     + " found, substituted with " + pointsize + "pt font";
                 log.warn(msg);
@@ -109,29 +111,29 @@
 
     /**
      * Get the first character in this font.
+     * @return the first character in this font.
      */
     public int getFirstChar() {
-
-        Iterator i = _characterSets.values().iterator();
-        if (i.hasNext()) {
-            CharacterSet csm = (CharacterSet) i.next();
+        Iterator it = charSets.values().iterator();
+        if (it.hasNext()) {
+            CharacterSet csm = (CharacterSet) it.next();
             return csm.getFirstChar();
         } else {
             String msg = "getFirstChar() - No character set found for font:" + getFontName();
             log.error(msg);
             throw new FontRuntimeException(msg);
         }
-
     }
 
     /**
      * Get the last character in this font.
+     * @return the last character in this font.
      */
     public int getLastChar() {
 
-        Iterator i = _characterSets.values().iterator();
-        if (i.hasNext()) {
-            CharacterSet csm = (CharacterSet) i.next();
+        Iterator it = charSets.values().iterator();
+        if (it.hasNext()) {
+            CharacterSet csm = (CharacterSet) it.next();
             return csm.getLastChar();
         } else {
             String msg = "getLastChar() - No character set found for font:" + getFontName();
@@ -147,22 +149,20 @@
      * used to denote the part of the letter extending above the x-height.
      *
      * @param size the point size
+     * @return the ascender for the given point size
      */
     public int getAscender(int size) {
-
         return getCharacterSet(size).getAscender();
-
     }
 
     /**
      * Obtains the height of capital letters for the specified point size.
      *
      * @param size the point size
+     * @return the cap height for the specified point size
      */
     public int getCapHeight(int size) {
-
         return getCharacterSet(size).getCapHeight();
-
     }
 
     /**
@@ -171,31 +171,30 @@
      * letter extending below the base line.
      *
      * @param size the point size
+     * @return the descender for the specified point size
      */
     public int getDescender(int size) {
-
         return getCharacterSet(size).getDescender();
-
     }
 
     /**
      * The "x-height" (the height of the letter "x").
      *
      * @param size the point size
+     * @return the x height for the given point size
      */
     public int getXHeight(int size) {
-
         return getCharacterSet(size).getXHeight();
-
     }
 
     /**
      * Obtain the width of the character for the specified point size.
+     * @param character the character
+     * @param size the point size
+     * @return the width for the given point size
      */
     public int getWidth(int character, int size) {
-
         return getCharacterSet(size).width(character);
-
     }
 
     /**
@@ -207,9 +206,7 @@
      * @return the widths of all characters
      */
     public int[] getWidths(int size) {
-
         return getCharacterSet(size).getWidths();
-
     }
 
     /**
@@ -219,9 +216,7 @@
      * @return the widths of all characters
      */
     public int[] getWidths() {
-
         return getWidths(1000);
-
     }
 
     /**
@@ -230,7 +225,7 @@
      * @return the mapped character
      */
     public char mapChar(char c) {
-        return _characterSet.mapChar(c);
+        return charSet.mapChar(c);
     }
 
     /**
@@ -238,7 +233,7 @@
      * @return the encoding
      */
     public String getEncoding() {
-        return _characterSet.getEncoding();
+        return charSet.getEncoding();
     }
 
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPConstants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPConstants.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPConstants.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPConstants.java Wed Dec 12 08:13:06 2007
@@ -28,11 +28,10 @@
     /**
      * The encoding to use to convert to EBCIDIC
      */
-    public String EBCIDIC_ENCODING = "Cp1146";
+    String EBCIDIC_ENCODING = "Cp1146";
 
     /**
      * The encoding to use to convert to ASCII
      */
-    public String ASCII_ENCODING = "Cp1252";
-
+    String ASCII_ENCODING = "Cp1252";
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java Wed Dec 12 08:13:06 2007
@@ -22,9 +22,12 @@
 import java.awt.Color;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.fop.render.afp.AFPFontAttributes;
 import org.apache.fop.render.afp.fonts.AFPFont;
 import org.apache.fop.render.afp.tools.StringUtils;
 
@@ -132,7 +135,7 @@
      * The outputstream for the data stream
      */
     private OutputStream outputStream = null;
-
+    
     /**
      * Default constructor for the AFPDataStream.
      */
@@ -147,7 +150,6 @@
      *            the outputStream which the document is written to.
      */
     public void startDocument(OutputStream docOutputStream) {
-
         if (document != null) {
             String msg = "Invalid state - document already started.";
             log.warn("startDocument():: " + msg);
@@ -156,7 +158,6 @@
 
         this.document = new Document();
         this.outputStream = docOutputStream;
-
     }
 
     /**
@@ -168,7 +169,6 @@
      *             throws an I/O exception of some sort has occurred
      */
     public void endDocument() throws IOException {
-
         if (complete) {
             String msg = "Invalid state - document already ended.";
             log.warn("endDocument():: " + msg);
@@ -206,19 +206,19 @@
      *            the height of the page
      * @param pageRotation
      *            the rotation of the page
-     * @param pageWidthResolution
+     * @param pageWidthRes
      *            the width resolution of the page
-     * @param pageHeightResolution
+     * @param pageHeightRes
      *            the height resolution of the page
      */
     public void startPage(int pageWidth, int pageHeight, int pageRotation,
-            int pageWidthResolution, int pageHeightResolution) {
+            int pageWidthRes, int pageHeightRes) {
 
         String pageName = "PGN"
                 + StringUtils.lpad(String.valueOf(pageCount++), '0', 5);
 
         currentPageObject = new PageObject(pageName, pageWidth, pageHeight,
-                pageRotation, pageWidthResolution, pageHeightResolution);
+                pageRotation, pageWidthRes, pageHeightRes);
         currentPage = currentPageObject;
         currentOverlay = null;
         setOffsets(0, 0, 0);
@@ -265,11 +265,9 @@
      * Helper method to mark the end of the current overlay.
      */
     public void endOverlay() {
-
         currentOverlay.endPage();
         currentOverlay = null;
         currentPage = currentPageObject;
-
     }
 
     /**
@@ -278,7 +276,6 @@
      * @return current page object that was saved
      */
     public PageObject savePage() {
-
         PageObject pageObject = currentPageObject;
         if (currentPageGroup != null) {
             currentPageGroup.addPage(currentPageObject);
@@ -288,7 +285,6 @@
         currentPageObject = null;
         currentPage = null;
         return pageObject;
-
     }
 
     /**
@@ -298,10 +294,8 @@
      *            page object
      */
     public void restorePage(PageObject pageObject) {
-
         currentPageObject = pageObject;
         currentPage = pageObject;
-
     }
 
     /**
@@ -311,7 +305,6 @@
      *             thrown when an I/O exception of some sort has occurred
      */
     public void endPage() throws IOException {
-
         currentPageObject.endPage();
         if (currentPageGroup != null) {
             currentPageGroup.addPage(currentPageObject);
@@ -319,10 +312,8 @@
             document.addPage(currentPageObject);
             document.writeDataStream(this.outputStream);
         }
-
         currentPageObject = null;
         currentPage = null;
-
     }
 
     /**
@@ -342,6 +333,21 @@
     }
 
     /**
+     * Creates the given page fonts in the current page
+     * @param pageFonts a collection of AFP font attributes
+     */
+    public void addFontsToCurrentPage(Map pageFonts) {
+        Iterator iter = pageFonts.values().iterator();
+        while (iter.hasNext()) {
+            AFPFontAttributes afpFontAttributes = (AFPFontAttributes)iter.next();
+            createFont(
+                afpFontAttributes.getFontReference(),
+                afpFontAttributes.getFont(),
+                afpFontAttributes.getPointSize());
+        }
+    }
+
+    /**
      * Helper method to create a map coded font object on the current page, this
      * method delegates the construction of the map coded font object to the
      * active environment group on the current page.
@@ -353,18 +359,17 @@
      * @param size
      *            the point size of the font
      */
-    public void createFont(byte fontReference, AFPFont font, int size) {
-
+    public void createFont(int fontReference, AFPFont font, int size) {
         currentPage.createFont(fontReference, font, size);
-
     }
 
+
     /**
      * Helper method to create text on the current page, this method delegates
      * to the current presentation text object in order to construct the text.
      * 
-     * @param fontNumber
-     *            the font number used as the resource identifier
+     * @param fontReference
+     *            the font reference used as the resource identifier
      * @param x
      *            the x coordinate of the text
      * @param y
@@ -378,81 +383,125 @@
      * @param data
      *            the text data to create
      */
-    public void createText(int fontNumber, int x, int y, Color col, int vsci,
+    public void createText(int fontReference, int x, int y, Color col, int vsci,
             int ica, byte[] data) {
-
-        currentPage.createText(fontNumber, x + xOffset, y + yOffset, rotation,
+        currentPage.createText(fontReference, x + xOffset, y + yOffset, rotation,
                 col, vsci, ica, data);
-
     }
 
     /**
      * Returns an ImageObject used to create an image in the datastream.
-     * 
+     *
      * @param x
      *            the x position of the image
      * @param y
      *            the y position of the image
-     * @param w
+     * @param width
      *            the width of the image
-     * @param h
+     * @param height
      *            the height of the image
+     * @param widthRes
+     *            the resolution width of the image
+     * @param heightRes
+     *            the resolution height of the image
+     * @return
+     *            a new image object
+     */
+    public ImageObject getImageObject(int x, int y, int width, int height,
+            int widthRes, int heightRes) {
+        ImageObject imageObj = currentPage.getImageObject();
+        setObjectViewPort(imageObj, x, y, width, height, widthRes, heightRes);
+        return imageObj;
+    }
+
+    /**
+     * Returns an GraphicObject used to create an graphic in the datastream.
+     *
+     * @param x
+     *            the x position of the graphic
+     * @param y
+     *            the y position of the graphic
+     * @param width
+     *            the width of the graphic
+     * @param height
+     *            the height of the graphic
+     * @param widthRes
+     *            the resolution width of the graphic
+     * @param heightRes
+     *            the resolution height of the graphic
+     * @return
+     *            a new graphics object
+     */
+    public GraphicsObject getGraphicsObject(int x, int y, int width, int height,
+            int widthRes, int heightRes) {
+        GraphicsObject graphicsObj = currentPage.getGraphicsObject();
+        setObjectViewPort(graphicsObj, x, y, width, height, widthRes, heightRes);
+        return graphicsObj;
+    }
+
+    /**
+     * Sets the object view port taking into account rotation.
+     *
+     * @param x
+     *            the x position of the object
+     * @param y
+     *            the y position of the object
+     * @param w
+     *            the width of the object
+     * @param h
+     *            the height of the object
      * @param wr
-     *            the width resolution of the image
+     *            the resolution width of the object
      * @param hr
-     *            the height resolution of the image
-     * @return ImageObject used to create an image in the datastream
+     *            the resolution height of the object
+     * @return
+     *            a new graphics object
      */
-    public ImageObject getImageObject(int x, int y, int w, int h, int wr, int hr) {
-
+    private void setObjectViewPort(AbstractDataObject dataObj,
+            int x, int y, int w, int h, int wr, int hr) {
         int xOrigin;
         int yOrigin;
         int width;
         int height;
-        int widthResolution;
-        int heightResolution;
-
-        switch (rotation) {
+        int widthRes;
+        int heightRes;
+        switch (this.rotation) {
         case 90:
             xOrigin = currentPage.getWidth() - y - yOffset;
             yOrigin = x + xOffset;
             width = h;
             height = w;
-            widthResolution = hr;
-            heightResolution = wr;
+            widthRes = hr;
+            heightRes = wr;
             break;
         case 180:
             xOrigin = currentPage.getWidth() - x - xOffset;
             yOrigin = currentPage.getHeight() - y - yOffset;
             width = w;
             height = h;
-            widthResolution = wr;
-            heightResolution = hr;
+            widthRes = wr;
+            heightRes = hr;
             break;
         case 270:
             xOrigin = y + yOffset;
             yOrigin = currentPage.getHeight() - x - xOffset;
             width = h;
             height = w;
-            widthResolution = hr;
-            heightResolution = wr;
+            widthRes = hr;
+            heightRes = wr;
             break;
         default:
             xOrigin = x + xOffset;
             yOrigin = y + yOffset;
             width = w;
             height = h;
-            widthResolution = wr;
-            heightResolution = hr;
+            widthRes = wr;
+            heightRes = hr;
             break;
         }
-        ImageObject io = currentPage.getImageObject();
-        io.setImageViewport(xOrigin, yOrigin, width, height, rotation,
-                widthResolution, heightResolution);
-        return io;
-
+        dataObj.setViewport(xOrigin, yOrigin, width, height, widthRes, heightRes, rotation);
     }
-
+        
     /**
      * Method to create a line on the current page.
      * 
@@ -471,10 +520,8 @@
      */
     public void createLine(int x1, int y1, int x2, int y2, int thickness,
             Color col) {
-
         currentPage.createLine(x1 + xOffset, y1 + yOffset, x2 + xOffset, y2
                 + yOffset, thickness, rotation, col);
-
     }
 
     /**
@@ -499,10 +546,8 @@
      */
     public void createShading(int x, int y, int w, int h, int red, int green,
             int blue) {
-
         currentPage.createShading(x + xOffset, y + xOffset, w, h, red, green,
                 blue);
-
     }
 
     /**
@@ -513,12 +558,10 @@
      *            the name of the static overlay
      */
     public void createIncludePageOverlay(String name) {
-
         currentPageObject.createIncludePageOverlay(name, 0, 0, rotation);
         ActiveEnvironmentGroup aeg = currentPageObject
                 .getActiveEnvironmentGroup();
         aeg.createOverlay(name);
-
     }
 
     /**
@@ -528,12 +571,10 @@
      *            the name of the medium map
      */
     public void createInvokeMediumMap(String name) {
-
         if (currentPageGroup == null) {
             startPageGroup();
         }
         currentPageGroup.createInvokeMediumMap(name);
-
     }
 
     /**
@@ -547,7 +588,6 @@
      *            the y coordinate for the overlay
      */
     public void createIncludePageSegment(String name, int x, int y) {
-
         int xOrigin;
         int yOrigin;
         switch (rotation) {
@@ -569,7 +609,6 @@
             break;
         }
         currentPage.createIncludePageSegment(name, xOrigin, yOrigin);
-
     }
 
     /**
@@ -579,13 +618,11 @@
      *            the array of key value pairs.
      */
     public void createPageTagLogicalElement(TagLogicalElementBean[] attributes) {
-
         for (int i = 0; i < attributes.length; i++) {
             String name = (String) attributes[i].getKey();
             String value = (String) attributes[i].getValue();
             currentPage.createTagLogicalElement(name, value);
         }
-
     }
 
     /**
@@ -594,15 +631,12 @@
      * @param attributes
      *            the array of key value pairs.
      */
-    public void createPageGroupTagLogicalElement(
-            TagLogicalElementBean[] attributes) {
-
+    public void createPageGroupTagLogicalElement(TagLogicalElementBean[] attributes) {
         for (int i = 0; i < attributes.length; i++) {
             String name = (String) attributes[i].getKey();
             String value = (String) attributes[i].getValue();
             currentPageGroup.createTagLogicalElement(name, value);
         }
-
     }
 
     /**
@@ -614,13 +648,11 @@
      *            The tag value
      */
     public void createTagLogicalElement(String name, String value) {
-
         if (currentPageGroup != null) {
             currentPageGroup.createTagLogicalElement(name, value);
         } else {
             currentPage.createTagLogicalElement(name, value);
         }
-
     }
 
     /**
@@ -697,5 +729,4 @@
         }
 
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractAFPObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractAFPObject.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractAFPObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractAFPObject.java Wed Dec 12 08:13:06 2007
@@ -44,7 +44,7 @@
      * DataStream objects must implement the writeDataStream()
      * method to write its data to the given OutputStream
      * @param os The outputsteam stream
-     * @throws java.io.IOException
+     * @throws java.io.IOException in the event that an I/O exception occurred
      */
     public abstract void writeDataStream(OutputStream os) throws IOException;
 
@@ -52,15 +52,14 @@
      * Help method to write a set of AFPObjects to the AFP datastream.
      * @param afpObjects a list of AFPObjects
      * @param os The stream to write to
-     * @throws java.io.IOException
+     * @throws java.io.IOException in the event that an I/O exception occurred
      */
     protected void writeObjectList(List afpObjects, OutputStream os)
-        throws IOException {
+    throws IOException {
 
-        for (Iterator it = afpObjects.iterator(); it.hasNext(); ) {
+        Iterator it = afpObjects.iterator();
+        while (it.hasNext()) {
             ((AbstractAFPObject)it.next()).writeDataStream(os);
         }
-
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractDescriptor.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractDescriptor.java Wed Dec 12 08:13:06 2007
@@ -28,22 +28,22 @@
     /** height of this descriptor */
     protected int height = 0;
     /** width resolution of this descriptor */
-    protected int widthResolution = 0;
+    protected int widthRes = 0;
     /** height resolution of this descriptor */
-    protected int heightResolution = 0;
+    protected int heightRes = 0;
 
     /**
      * Constructor a PresentationTextDescriptor for the specified
      * width and height.
      * @param width The width of the page.
      * @param height The height of the page.
-     * @param widthResolution The width resolution of the page.
-     * @param heightResolution The height resolution of the page.
+     * @param widthRes The width resolution of the page.
+     * @param heightRes The height resolution of the page.
      */
-    public AbstractDescriptor(int width, int height, int widthResolution, int heightResolution) {
+    public AbstractDescriptor(int width, int height, int widthRes, int heightRes) {
         this.width = width;
         this.height = height;
-        this.widthResolution = widthResolution;
-        this.heightResolution = heightResolution;
+        this.widthRes = widthRes;
+        this.heightRes = heightRes;
     }
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractNamedAFPObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractNamedAFPObject.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractNamedAFPObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractNamedAFPObject.java Wed Dec 12 08:13:06 2007
@@ -25,7 +25,7 @@
  * A named data stream object has an 8 byte EBCIDIC name.
  */
 public abstract class AbstractNamedAFPObject extends AbstractAFPObject {
-    
+        
     /**
      * The actual name of the object
      */
@@ -35,35 +35,50 @@
      * The name of the object in EBCIDIC bytes
      */
     protected byte[] nameBytes;
-    
+
+    /**
+     * Default constructor
+     */
+    protected AbstractNamedAFPObject() {
+    }
+
+    private static final int DEFAULT_NAME_LENGTH = 8;
+
+    /**
+     * @return the name length of this object
+     */
+    protected int getNameLength() {
+        return DEFAULT_NAME_LENGTH;
+    }
+
     /**
      * Constructor for the ActiveEnvironmentGroup, this takes a
      * name parameter which should be 8 characters long.
      * @param name the object name
      */
     public AbstractNamedAFPObject(String name) {
-        
-        this.name = name;
-        if (name.length() < 8) {
-            name = (name + "       ").substring(0, 8);
-        } else if (name.length() > 8) {
-            log.warn("Constructor:: name truncated to 8 chars" + name);
-            name = name.substring(0, 8);
+        int nameLen = getNameLength();
+        if (name.length() < nameLen) {
+            this.name = (name + "       ").substring(0, nameLen);
+        } else if (name.length() > nameLen) {
+            log.warn("Constructor:: name truncated to " + nameLen + " chars: " + name);
+            this.name = name.substring(0, nameLen);
+        } else {
+            this.name = name;            
         }
         
         try {
             
-            nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
+            this.nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
             
         } catch (UnsupportedEncodingException usee) {
             
-            nameBytes = name.getBytes();
+            this.nameBytes = name.getBytes();
             log.warn(
                 "Constructor:: UnsupportedEncodingException translating the name "
                 + name);
             
         }
         
-    }
-    
+    }    
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java Wed Dec 12 08:13:06 2007
@@ -105,13 +105,13 @@
      *            the height of the page.
      * @param rotation
      *            the rotation of the page.
-     * @param widthResolution
+     * @param widthRes
      *            the width resolution of the page.
-     * @param heightResolution
+     * @param heightRes
      *            the height resolution of the page.
      */
     public AbstractPageObject(String name, int width, int height, int rotation,
-            int widthResolution, int heightResolution) {
+            int widthRes, int heightRes) {
 
         super(name);
         this.width = width;
@@ -121,8 +121,7 @@
         /**
          * Every page object must have an ActiveEnvironmentGroup
          */
-        activeEnvironmentGroup = new ActiveEnvironmentGroup(width, height,
-                widthResolution, heightResolution);
+        activeEnvironmentGroup = new ActiveEnvironmentGroup(width, height, widthRes, heightRes);
 
         if (rotation != 0) {
             switch (rotation) {
@@ -138,13 +137,6 @@
                 default:
             }
         }
-
-        /**
-         * We have a presentation text object per page
-         */
-        presentationTextObject = new PresentationTextObject();
-        objects.add(presentationTextObject);
-
     }
 
     /**
@@ -159,10 +151,8 @@
      * @param size
      *            the point size of the font
      */
-    public void createFont(byte fontReference, AFPFont font, int size) {
-
+    public void createFont(int fontReference, AFPFont font, int size) {
         activeEnvironmentGroup.createFont(fontReference, font, size, 0);
-
     }
 
     /**
@@ -186,20 +176,14 @@
      */
     public void createLine(int x1, int y1, int x2, int y2, int thickness,
             int lineRotation, Color col) {
-
-        if (presentationTextObject == null) {
-            presentationTextObject = new PresentationTextObject();
-            objects.add(presentationTextObject);
-        }
-        presentationTextObject.createLineData(x1, y1, x2, y2, thickness, lineRotation, col);
-
+        getPresentationTextObject().createLineData(x1, y1, x2, y2, thickness, lineRotation, col);
     }
 
     /**
      * Helper method to create text on the current page, this method delegates
      * to the presentation text object in order to construct the text.
      *
-     * @param fontNumber
+     * @param fontReference
      *            the font number used as the resource identifier
      * @param x
      *            the x coordinate of the text data
@@ -216,15 +200,10 @@
      * @param data
      *            the text data to create
      */
-    public void createText(int fontNumber, int x, int y, int textRotation, Color col,
+    public void createText(int fontReference, int x, int y, int textRotation, Color col,
             int vsci, int ica, byte[] data) {
-
-        if (presentationTextObject == null) {
-            presentationTextObject = new PresentationTextObject();
-            objects.add(presentationTextObject);
-        }
-        presentationTextObject.createTextData(fontNumber, x, y, textRotation, col, vsci, ica, data);
-
+        getPresentationTextObject().createTextData(
+                fontReference, x, y, textRotation, col, vsci, ica, data);
     }
 
     /**
@@ -232,13 +211,10 @@
      * sequence on the current presenation text object.
      */
     public void endPage() {
-
         if (presentationTextObject != null) {
             presentationTextObject.endControlSequence();
         }
-
         complete = true;
-
     }
 
     /**
@@ -327,6 +303,19 @@
     }
 
     /**
+     * Helper method to create a presentation text object
+     * on the current page and to return the object.
+     * @return the presentation text object
+     */
+    private PresentationTextObject getPresentationTextObject() {
+        if (presentationTextObject == null) {
+            this.presentationTextObject = new PresentationTextObject();
+            objects.add(this.presentationTextObject);
+        }
+        return presentationTextObject;
+    }
+    
+    /**
      * Helper method to create an image on the current page and to return
      * the object.
      * @return the image object
@@ -335,16 +324,32 @@
 
         if (presentationTextObject != null) {
             presentationTextObject.endControlSequence();
+            presentationTextObject = null;
         }
-        presentationTextObject = null;
-
         String imageName = "IMG"
             + StringUtils.lpad(String.valueOf(objects.size() + 1),
             '0', 5);
+        ImageObject imageObj = new ImageObject(imageName);
+        objects.add(imageObj);
+        return imageObj;
+    }
 
-        ImageObject io = new ImageObject(imageName);
-        objects.add(io);
-        return io;
+    /**
+     * Helper method to create a graphic on the current page and to return
+     * the object.
+     * @return the graphics object
+     */
+    public GraphicsObject getGraphicsObject() {
+        if (presentationTextObject != null) {
+            presentationTextObject.endControlSequence();
+            presentationTextObject = null;
+        }
+        String graphicName = "GRA"
+            + StringUtils.lpad(String.valueOf(objects.size() + 1),
+            '0', 5);
+        GraphicsObject graphicsObj = new GraphicsObject(graphicName);
+        objects.add(graphicsObj);
+        return graphicsObj;
     }
 
     /**
@@ -356,10 +361,8 @@
      *            the value of the tag
      */
     public void createTagLogicalElement(String name, String value) {
-
         TagLogicalElement tle = new TagLogicalElement(name, value);
         tagLogicalElements.add(tle);
-
     }
 
     /**
@@ -368,10 +371,8 @@
      * @param content the byte data
      */
     public void createNoOperation(String content) {
-
         NoOperation noOp = new NoOperation(content);
         objects.add(noOp);
-
     }
 
     /**
@@ -380,15 +381,13 @@
      * @param name
      *            the name of the page segment
      * @param xCoor
-     *            the x cooridinate of the page segment.
+     *            the x coordinate of the page segment.
      * @param yCoor
-     *            the y cooridinate of the page segment.
+     *            the y coordinate of the page segment.
      */
     public void createIncludePageSegment(String name, int xCoor, int yCoor) {
-
         IncludePageSegment ips = new IncludePageSegment(name, xCoor, yCoor);
         segments.add(ips);
-
     }
 
     /**
@@ -431,5 +430,4 @@
     public int getRotation() {
         return rotation;
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ActiveEnvironmentGroup.java Wed Dec 12 08:13:06 2007
@@ -20,7 +20,7 @@
 package org.apache.fop.render.afp.modca;
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.fop.render.afp.fonts.AFPFont;
 
@@ -47,7 +47,7 @@
     /**
      * The collection of MapCodedFont objects
      */
-    private ArrayList mapCodedFonts = new ArrayList();
+    private List mapCodedFonts = new java.util.ArrayList();
 
     /**
      * The Object Area Descriptor for the active environment group
@@ -72,19 +72,19 @@
     /**
      * The collection of MapPageOverlay objects
      */
-    private ArrayList mapPageOverlays = new ArrayList();
+    private List mapPageOverlays = new java.util.ArrayList();
 
     /**
      * Default constructor for the ActiveEnvironmentGroup.
      * @param width the page width
      * @param height the page height
-     * @param widthResolution the page width resolution
-     * @param heightResolution the page height resolution
+     * @param widthRes the page width resolution
+     * @param heightRes the page height resolution
      */
     public ActiveEnvironmentGroup(int width, int height,
-            int widthResolution, int heightResolution) {
+            int widthRes, int heightRes) {
 
-        this(DEFAULT_NAME, width, height, widthResolution, heightResolution);
+        this(DEFAULT_NAME, width, height, widthRes, heightRes);
 
     }
 
@@ -94,24 +94,24 @@
      * @param name the active environment group name
      * @param width the page width
      * @param height the page height
-     * @param widthResolution the page width resolution
-     * @param heightResolution the page height resolution
+     * @param widthRes the page width resolution
+     * @param heightRes the page height resolution
      */
     public ActiveEnvironmentGroup(String name, int width, int height,
-            int widthResolution, int heightResolution) {
+            int widthRes, int heightRes) {
 
         super(name);
 
         // Create PageDescriptor
-        pageDescriptor = new PageDescriptor(width, height, widthResolution, heightResolution);
+        pageDescriptor = new PageDescriptor(width, height, widthRes, heightRes);
 
         // Create ObjectAreaDescriptor
         objectAreaDescriptor = new ObjectAreaDescriptor(width, height,
-                widthResolution, heightResolution);
+                widthRes, heightRes);
 
         // Create PresentationTextDataDescriptor
         presentationTextDataDescriptor = new PresentationTextDescriptor(width, height,
-                    widthResolution, heightResolution);
+                    widthRes, heightRes);
 
     }
 
@@ -243,7 +243,7 @@
      * @param orientation the orientation of the font (e.g. 0, 90, 180, 270)
      */
     public void createFont(
-        byte fontReference,
+        int fontReference,
         AFPFont font,
         int size,
         int orientation) {
@@ -256,7 +256,7 @@
         }
 
         try {
-
+            
             mcf.addFont(
                 fontReference,
                 font,

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageCellPosition.java Wed Dec 12 08:13:06 2007
@@ -32,32 +32,32 @@
     /**
      * Offset of image cell in X direction
      */
-    private int _XcoSet = 0;
+    private int xOffset = 0;
 
     /**
      * Offset of image cell in Y direction
      */
-    private int _YcoSet = 0;
+    private int yOffset = 0;
 
     /**
      * Size of image cell in X direction
      */
-    private byte[] _XcSize = new byte[] { (byte)0xFF, (byte)0xFF };
+    private byte[] xSize = new byte[] {(byte)0xFF, (byte)0xFF};
 
     /**
      * Size of image cell in Y direction
      */
-    private byte[] _YcSize = new byte[] { (byte)0xFF, (byte)0xFF };
+    private byte[] ySize = new byte[] {(byte)0xFF, (byte)0xFF};
 
     /**
      * Size of fill rectangle in X direction
      */
-    private byte[] _XFillSize = new byte[] { (byte)0xFF, (byte)0xFF };
+    private byte[] xFillSize = new byte[] {(byte)0xFF, (byte)0xFF};
 
     /**
      * Size of fill rectangle in Y direction
      */
-    private byte[] _YFillSize = new byte[] { (byte)0xFF, (byte)0xFF };
+    private byte[] yFillSize = new byte[] {(byte)0xFF, (byte)0xFF};
 
     /**
      * Constructor for the ImageCellPosition
@@ -65,20 +65,16 @@
      * @param y The offset of image cell in Y direction
      */
     public ImageCellPosition(int x, int y) {
-
-        _XcoSet = x;
-        _YcoSet = y;
-
+        xOffset = x;
+        yOffset = y;
     }
 
     /**
      * Accessor method to write the AFP datastream for the Image Cell Position
      * @param os The stream to write to
-     * @throws java.io.IOException
+     * @throws java.io.IOException if an I/O exception occurred
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
-
+    public void writeDataStream(OutputStream os) throws IOException {
         byte[] data = new byte[21];
 
         data[0] = 0x5A;
@@ -97,7 +93,7 @@
          * Specifies the offset along the Xp direction, in image points,
          * of this image cell from the IM image object area origin.
          */
-        byte[] x1 = BinaryUtils.convert(_XcoSet, 2);
+        byte[] x1 = BinaryUtils.convert(xOffset, 2);
         data[9] = x1[0];
         data[10] = x1[1];
 
@@ -105,24 +101,23 @@
          * Specifies the offset along the Yp direction, in image points,
          * of this image cell from the IM image object area origin.
          */
-        byte[] x2 = BinaryUtils.convert(_YcoSet, 2);
+        byte[] x2 = BinaryUtils.convert(yOffset, 2);
         data[11] = x2[0];
         data[12] = x2[1];
 
-        data[13] = _XcSize[0];
-        data[14] = _XcSize[1];
+        data[13] = xSize[0];
+        data[14] = xSize[1];
 
-        data[15] = _YcSize[0];
-        data[16] = _YcSize[1];
+        data[15] = ySize[0];
+        data[16] = ySize[1];
 
-        data[17] = _XFillSize[0];
-        data[18] = _XFillSize[1];
+        data[17] = xFillSize[0];
+        data[18] = xFillSize[1];
 
-        data[19] = _YFillSize[0];
-        data[20] = _YFillSize[1];
+        data[19] = yFillSize[0];
+        data[20] = yFillSize[1];
 
         os.write(data);
-
     }
 
     /**
@@ -133,11 +128,9 @@
      * @param xcSize The size to set.
      */
     public void setXSize(int xcSize) {
-
         byte[] x = BinaryUtils.convert(xcSize, 2);
-        _XcSize[0] = x[0];
-        _XcSize[1] = x[1];
-
+        xSize[0] = x[0];
+        xSize[1] = x[1];
     }
 
     /**
@@ -148,14 +141,12 @@
      * be used as the fill rectangle X-extent. The fill rectangle is
      * filled in the X direction by repeating the image cell in the
      * X direction. The image cell can be truncated to fit the rectangle.
-     * @param xFillSize The size to set.
+     * @param size The size to set.
      */
-    public void setXFillSize(int xFillSize) {
-
-        byte[] x = BinaryUtils.convert(xFillSize, 2);
-        _XFillSize[0] = x[0];
-        _XFillSize[1] = x[1];
-
+    public void setXFillSize(int size) {
+        byte[] x = BinaryUtils.convert(size, 2);
+        this.xFillSize[0] = x[0];
+        this.xFillSize[1] = x[1];
     }
 
     /**
@@ -163,14 +154,12 @@
      * of this image cell. A value of X'FFFF' indicates that the
      * default extent specified in bytes 30 and 31 of the Image
      * Input Descriptor (IID) is to be used.
-     * @param ycSize The size to set.
+     * @param size The size to set.
      */
-    public void setYSize(int ycSize) {
-
-        byte[] x = BinaryUtils.convert(ycSize, 2);
-        _YcSize[0] = x[0];
-        _YcSize[1] = x[1];
-
+    public void setYSize(int size) {
+        byte[] x = BinaryUtils.convert(size, 2);
+        this.ySize[0] = x[0];
+        this.ySize[1] = x[1];
     }
 
     /**
@@ -181,14 +170,11 @@
      * be used as the fill rectangle Y-extent. The fill rectangle is
      * filled in the Y direction by repeating the image cell in the
      * Y direction. The image cell can be truncated to fit the rectangle.
-     * @param yFillSize The size to set.
+     * @param size The size to set.
      */
-    public void setYFillSize(int yFillSize) {
-
-        byte[] x = BinaryUtils.convert(yFillSize, 2);
-        _YFillSize[0] = x[0];
-        _YFillSize[1] = x[1];
-
+    public void setYFillSize(int size) {
+        byte[] x = BinaryUtils.convert(size, 2);
+        this.yFillSize[0] = x[0];
+        this.yFillSize[1] = x[1];
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageContent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageContent.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageContent.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageContent.java Wed Dec 12 08:13:06 2007
@@ -18,43 +18,45 @@
 /* $Id$ */
 
 package org.apache.fop.render.afp.modca;
+
 import java.io.IOException;
 import java.io.OutputStream;
 import org.apache.fop.render.afp.tools.BinaryUtils;
 
 /**
+ * Image content IOCA object
  */
 public class ImageContent extends AbstractAFPObject {
 
     /**
      * The image size parameter
      */
-    private ImageSizeParameter _imageSizeParameter = null;
+    private ImageSizeParameter imageSizeParam = null;
 
     /**
      * The image encoding
      */
-    private byte _encoding = 0x03;
+    private byte encoding = 0x03;
 
     /**
      * The image ide size
      */
-    private byte _size = 1;
+    private byte size = 1;
 
     /**
      * The image compression
      */
-    private byte _compression = (byte)0xC0;
+    private byte compression = (byte)0xC0;
 
     /**
      * The image color model
      */
-    private byte _colorModel = 0x01;
+    private byte colorModel = 0x01;
 
     /**
      * The image data
      */
-    private byte _data[] = null;
+    private byte[] data = null;
 
     /**
      * Constructor for the image content
@@ -72,60 +74,60 @@
      * @param vsize The vertival size of the image.
      */
     public void setImageSize(int hresol, int vresol, int hsize, int vsize) {
-        _imageSizeParameter = new ImageSizeParameter(hresol, vresol, hsize, vsize);
+        this.imageSizeParam = new ImageSizeParameter(hresol, vresol, hsize, vsize);
     }
 
     /**
      * Sets the image encoding.
-     * @param encoding The image encoding.
+     * @param enc The image encoding.
      */
-    public void setImageEncoding(byte encoding) {
-        _encoding = encoding;
+    public void setImageEncoding(byte enc) {
+        this.encoding = enc;
     }
 
     /**
      * Sets the image compression.
-     * @param compression The image compression.
+     * @param comp The image compression.
      */
-    public void setImageCompression(byte compression) {
-        _compression = compression;
+    public void setImageCompression(byte comp) {
+        this.compression = comp;
     }
 
     /**
      * Sets the image IDE size.
-     * @param size The IDE size.
+     * @param siz The IDE size.
      */
-    public void setImageIDESize(byte size) {
-        _size = size;
+    public void setImageIDESize(byte siz) {
+        this.size = siz;
     }
 
     /**
      * Sets the image IDE color model.
-     * @param colorModel    the IDE color model.
+     * @param model    the IDE color model.
      */
-    public void setImageIDEColorModel(byte colorModel) {
-        _colorModel = colorModel;
+    public void setImageIDEColorModel(byte model) {
+        this.colorModel = model;
     }
 
     /**
      * Set the data of the image.
+     * @param dat the image data
      */
-    public void setImageData(byte data[]) {
-        _data = data;
+    public void setImageData(byte[] dat) {
+        this.data = dat;
     }
 
     /**
      * Accessor method to write the AFP datastream for the Image Content
      * @param os The stream to write to
-     * @throws java.io.IOException
+     * @throws java.io.IOException if an I/O exception occurs
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
+    public void writeDataStream(OutputStream os) throws IOException {
 
         writeStart(os);
 
-        if (_imageSizeParameter != null) {
-            _imageSizeParameter.writeDataStream(os);
+        if (imageSizeParam != null) {
+            imageSizeParam.writeDataStream(os);
         }
 
         os.write(getImageEncodingParameter());
@@ -136,12 +138,12 @@
 
         os.write(getExternalAlgorithmParameter());
 
-        if (_data != null) {
+        if (data != null) {
             int off = 0;
-            while (off < _data.length) {
-                int len = Math.min(30000, _data.length - off);
+            while (off < data.length) {
+                int len = Math.min(30000, data.length - off);
                 os.write(getImageDataStart(len));
-                os.write(_data, off, len);
+                os.write(data, off, len);
                 off += len;
             }
         }
@@ -154,33 +156,25 @@
      * Helper method to write the start of the Image Content.
      * @param os The stream to write to
      */
-    private void writeStart(OutputStream os)
-        throws IOException {
-
-        byte[] data = new byte[] {
+    private void writeStart(OutputStream os) throws IOException {
+        byte[] startData = new byte[] {
             (byte)0x91, // ID
                   0x01, // Length
             (byte)0xff, // Object Type = IOCA Image Object
         };
-
-        os.write(data);
-
+        os.write(startData);
     }
 
     /**
      * Helper method to write the end of the Image Content.
      * @param os The stream to write to
      */
-    private void writeEnd(OutputStream os)
-        throws IOException {
-
-        byte[] data = new byte[] {
+    private void writeEnd(OutputStream os) throws IOException {
+        byte[] endData = new byte[] {
             (byte)0x93, // ID
                   0x00, // Length
         };
-
-        os.write(data);
-
+        os.write(endData);
     }
 
     /**
@@ -188,21 +182,16 @@
      * @return byte[] The data stream.
      */
     private byte[] getImageDataStart(int len) {
-
-        byte[] data = new byte[] {
+        byte[] imageDataStartData = new byte[] {
             (byte)0xFE, // ID
             (byte)0x92, // ID
                   0x00, // Length
                   0x00, // Length
         };
-
         byte[] l = BinaryUtils.convert(len, 2);
-        data[2] = l[0];
-        data[3] = l[1];
-
-
-        return data;
-
+        imageDataStartData[2] = l[0];
+        imageDataStartData[3] = l[1];
+        return imageDataStartData;
     }
 
     /**
@@ -210,16 +199,13 @@
      * @return byte[] The data stream.
      */
     private byte[] getImageEncodingParameter() {
-
-        byte[] data = new byte[] {
+        byte[] imageEncParamData = new byte[] {
             (byte)0x95, // ID
                   0x02, // Length
-                  _encoding,
+                  encoding,
                   0x01, // RECID
         };
-
-        return data;
-
+        return imageEncParamData;
     }
 
     /**
@@ -227,9 +213,8 @@
      * @return byte[] The data stream.
      */
     private byte[] getExternalAlgorithmParameter() {
-
-        if (_encoding == (byte)0x83 && _compression != 0) {
-            byte[] data = new byte[] {
+        if (encoding == (byte)0x83 && compression != 0) {
+            byte[] extAlgParamData = new byte[] {
                 (byte)0x95, // ID
                       0x00, // Length
                       0x10, // ALGTYPE = Compression Algorithm
@@ -238,13 +223,13 @@
                       0x00, // Reserved
                       0x00, // Reserved
                       0x00, // Reserved
-              _compression, // MARKER
+              compression, // MARKER
                       0x00, // Reserved
                       0x00, // Reserved
                       0x00, // Reserved
             };
-            data[1] = (byte)(data.length - 2);
-            return data;
+            extAlgParamData[1] = (byte)(extAlgParamData.length - 2);
+            return extAlgParamData;
         }
         return new byte[0];
     }
@@ -254,15 +239,12 @@
      * @return byte[] The data stream.
      */
     private byte[] getImageIDESizeParameter() {
-
-        byte[] data = new byte[] {
+        byte[] imageIDESizeParamData = new byte[] {
             (byte)0x96, // ID
                   0x01, // Length
-                  _size,
+                  size,
         };
-
-        return data;
-
+        return imageIDESizeParamData;
     }
 
     /**
@@ -270,15 +252,14 @@
      * @return byte[] The data stream.
      */
     private byte[] getIDEStructureParameter() {
-
-        if (_colorModel != 0 && _size == 24) {
-            byte bits = (byte)(_size / 3);
-            byte[] data = new byte[] {
+        if (colorModel != 0 && size == 24) {
+            byte bits = (byte)(size / 3);
+            byte[] ideStructParamData = new byte[] {
                 (byte)0x9B, // ID
                       0x00, // Length
                       0x00, // FLAGS
                       0x00, // Reserved
-               _colorModel, // COLOR MODEL
+               colorModel, // COLOR MODEL
                       0x00, // Reserved
                       0x00, // Reserved
                       0x00, // Reserved
@@ -286,10 +267,9 @@
                       bits,
                       bits,
             };
-            data[1] = (byte)(data.length - 2);
-            return data;
+            ideStructParamData[1] = (byte)(ideStructParamData.length - 2);
+            return ideStructParamData;
         }
         return new byte[0];
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageDataDescriptor.java Wed Dec 12 08:13:06 2007
@@ -27,10 +27,17 @@
  */
 public class ImageDataDescriptor extends AbstractAFPObject {
 
-    private int _xresol = 0;
-    private int _yresol = 0;
-    private int _width = 0;
-    private int _height = 0;
+    /** x resolution */
+    private int xresol = 0;
+    
+    /** y resolution */
+    private int yresol = 0;
+    
+    /** width */
+    private int width = 0;
+    
+    /** height */
+    private int height = 0;
 
     /**
      * Constructor for a ImageDataDescriptor for the specified
@@ -41,26 +48,25 @@
      * @param height The height of the height.
      */
     public ImageDataDescriptor(int xresol, int yresol, int width, int height) {
-
-        _xresol = xresol;
-        _yresol = yresol;
-        _width = width;
-        _height = height;
-
+        this.xresol = xresol;
+        this.yresol = yresol;
+        this.width = width;
+        this.height = height;
     }
 
     /**
-     * Accessor method to write the AFP datastream for the Image Data Descriptor
-     * @param os The stream to write to
-     * @throws java.io.IOException
+     * {@inheritDoc}
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
-
+    public void writeDataStream(OutputStream os) throws IOException {
+        byte[] len = BinaryUtils.convert(21, 2);
+        byte[] xres = BinaryUtils.convert(xresol, 2);
+        byte[] yres = BinaryUtils.convert(yresol, 2);
+        byte[] w = BinaryUtils.convert(width, 2);
+        byte[] h = BinaryUtils.convert(height, 2);
         byte[] data = new byte[] {
             0x5A,
-            0x00,
-            0x20,
+            len[0],
+            len[1],
             (byte) 0xD3,
             (byte) 0xA6,
             (byte) 0xFB,
@@ -68,42 +74,19 @@
             0x00, // Reserved
             0x00, // Reserved
             0x00, // Unit base - 10 Inches
-            0x00, // XRESOL
-            0x00, //
-            0x00, // YRESOL
-            0x00, //
-            0x00, // XSIZE
-            0x00, //
-            0x00, // YSIZE
-            0x00, //
+            xres[0], // XRESOL
+            xres[1], //
+            yres[0], // YRESOL
+            yres[1], //
+            w[0], // XSIZE
+            w[1], //
+            h[0], // YSIZE
+            h[1], //
             (byte)0xF7, // ID = Set IOCA Function Set
             0x02, // Length
             0x01, // Category = Function set identifier
             0x0B, // FCNSET = IOCA FS 11
         };
-
-        byte[] l = BinaryUtils.convert(data.length - 1, 2);
-        data[1] = l[0];
-        data[2] = l[1];
-
-        byte[] x = BinaryUtils.convert(_xresol, 2);
-        data[10] = x[0];
-        data[11] = x[1];
-
-        byte[] y = BinaryUtils.convert(_yresol, 2);
-        data[12] = y[0];
-        data[13] = y[1];
-
-        byte[] w = BinaryUtils.convert(_width, 2);
-        data[14] = w[0];
-        data[15] = w[1];
-
-        byte[] h = BinaryUtils.convert(_height, 2);
-        data[16] = h[0];
-        data[17] = h[1];
-
         os.write(data);
-
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageInputDescriptor.java Wed Dec 12 08:13:06 2007
@@ -33,16 +33,15 @@
     /**
      * The resolution of the raster image (default 240)
      */
-    private int _resolution = 240;
+    private int resolution = 240;
 
 
     /**
      * Accessor method to write the AFP datastream for the Image Input Descriptor
      * @param os The stream to write to
-     * @throws java.io.IOException
+     * @throws java.io.IOException if an I/O exception occurred
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
+    public void writeDataStream(OutputStream os) throws IOException {
 
         byte[] data = new byte[45];
 
@@ -75,7 +74,7 @@
         // Y Base (Fixed x00)
         data[22] = 0x00;
 
-        byte[] imagepoints = BinaryUtils.convert(_resolution * 10, 2);
+        byte[] imagepoints = BinaryUtils.convert(resolution * 10, 2);
 
         /**
          * Specifies the number of image points per unit base for the X axis
@@ -141,7 +140,7 @@
      * @param resolution The resolution value
      */
     public void setResolution(int resolution) {
-        _resolution = resolution;
+        this.resolution = resolution;
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageObject.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageObject.java Wed Dec 12 08:13:06 2007
@@ -27,12 +27,7 @@
 /**
  * An IOCA Image Data Object
  */
-public class ImageObject extends AbstractNamedAFPObject {
-
-    /**
-     * The object environment group
-     */
-    private ObjectEnvironmentGroup objectEnvironmentGroup = null;
+public class ImageObject extends AbstractDataObject {
 
     /**
      * The image segment
@@ -45,34 +40,7 @@
      * @param name The name of the image.
      */
     public ImageObject(String name) {
-
         super(name);
-
-    }
-
-    /**
-     * Sets the image display area position and size.
-     *
-     * @param x
-     *            the x position of the image
-     * @param y
-     *            the y position of the image
-     * @param w
-     *            the width of the image
-     * @param h
-     *            the height of the image
-     * @param r
-     *            the rotation of the image
-     * @param wr
-     *            the width resolution of the image
-     * @param hr
-     *            the height resolution of the image
-     */
-    public void setImageViewport(int x, int y, int w, int h, int r, int wr, int hr) {
-        if (objectEnvironmentGroup == null) {
-            objectEnvironmentGroup = new ObjectEnvironmentGroup();
-        }
-        objectEnvironmentGroup.setObjectArea(x, y, w, h, r, wr, hr);
     }
 
     /**
@@ -149,24 +117,16 @@
     }
 
     /**
-     * Sets the ObjectEnvironmentGroup.
-     * @param objectEnvironmentGroup The objectEnvironmentGroup to set
-     */
-    public void setObjectEnvironmentGroup(ObjectEnvironmentGroup objectEnvironmentGroup) {
-        this.objectEnvironmentGroup = objectEnvironmentGroup;
-    }
-
-    /**
      * Helper method to return the start of the image object.
+     * @param len the length of this ipd start
      * @return byte[] The data stream.
      */
     private byte[] getIPDStart(int len) {
-
+        byte[] l = BinaryUtils.convert(len + 8, 2);
         byte[] data = new byte[] {
-
             0x5A, // Structured field identifier
-            0x00, // Length byte 1
-            0x10, // Length byte 2
+            l[0], // Length byte 1
+            l[1], // Length byte 2
             (byte) 0xD3, // Structured field id byte 1
             (byte) 0xEE, // Structured field id byte 2
             (byte) 0xFB, // Structured field id byte 3
@@ -174,29 +134,14 @@
             0x00, // Reserved
             0x00, // Reserved
         };
-
-        byte[] l = BinaryUtils.convert(len + 8, 2);
-        data[1] = l[0];
-        data[2] = l[1];
-
         return data;
-
     }
 
     /**
-     * Accessor method to write the AFP datastream for the Image Object
-     * @param os The stream to write to
-     * @throws java.io.IOException thrown if an I/O exception of some sort has occurred
+     * {@inheritDoc}
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
-
-        writeStart(os);
-
-        if (objectEnvironmentGroup != null) {
-            objectEnvironmentGroup.writeDataStream(os);
-        }
-
+    protected void writeContent(OutputStream os) throws IOException {
+        super.writeContent(os);
         if (imageSegment != null) {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             imageSegment.writeDataStream(baos);
@@ -209,20 +154,13 @@
                 off += len;
             }
         }
-
-        writeEnd(os);
-
     }
 
     /**
-     * Helper method to write the start of the Image 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
@@ -232,26 +170,19 @@
         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 Image Object.
      * @param os The stream to write to
+     * @throws IOException in the event
      */
-    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
@@ -261,15 +192,9 @@
         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_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageOutputControl.java Wed Dec 12 08:13:06 2007
@@ -34,24 +34,24 @@
     /**
      * The orientation of the image
      */
-    private int _orientation = 0;
+    private int orientation = 0;
 
     /**
      * Specifies the offset, along the X-axis, of the IM image object area
      * origin to the origin of the including page
      */
-    private int _Xcoordinate = 0;
+    private int xCoord = 0;
 
     /**
      * Specifies the offset, along the Y-axis, of the IM image object area
      * origin to the origin of the including page
      */
-    private int _Ycoordinate = 0;
+    private int yCoord = 0;
 
     /**
-     * Map an image point to a single presentation device pel
+     * Map an image point to a single presentation device
      */
-    private boolean _singlepoint = true;
+    private boolean singlePoint = true;
 
     /**
      * Constructor for the ImageOutputControl The x parameter specifies the
@@ -68,18 +68,17 @@
      */
     public ImageOutputControl(int x, int y) {
 
-        _Xcoordinate = x;
-        _Ycoordinate = y;
+        xCoord = x;
+        yCoord = y;
 
     }
 
     /**
      * Accessor method to write the AFP datastream for the Image Output Control
      * @param os The stream to write to
-     * @throws java.io.IOException
+     * @throws java.io.IOException if an I/O exception occured
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
+    public void writeDataStream(OutputStream os) throws IOException {
 
         byte[] data = new byte[33];
 
@@ -94,18 +93,18 @@
         data[8] = 0x00;
 
         // XoaOset
-        byte[] x1 = BinaryUtils.convert(_Xcoordinate, 3);
+        byte[] x1 = BinaryUtils.convert(xCoord, 3);
         data[9] = x1[0];
         data[10] = x1[1];
         data[11] = x1[2];
 
         // YoaOset
-        byte[] x2 = BinaryUtils.convert(_Ycoordinate, 3);
+        byte[] x2 = BinaryUtils.convert(yCoord, 3);
         data[12] = x2[0];
         data[13] = x2[1];
         data[14] = x2[2];
 
-        switch (_orientation) {
+        switch (orientation) {
             case 0:
                 // 0 and 90 degrees respectively
                 data[15] = 0x00;
@@ -154,7 +153,7 @@
         data[25] = 0x00;
         data[26] = 0x00;
 
-        if (_singlepoint) {
+        if (singlePoint) {
             data[27] = 0x03;
             data[28] = (byte) 0xE8;
             data[29] = 0x03;
@@ -185,12 +184,11 @@
 
         if (orientation == 0 || orientation == 90 || orientation == 180
             || orientation == 270) {
-            _orientation = orientation;
+            this.orientation = orientation;
         } else {
             throw new IllegalArgumentException(
                 "The orientation must be one of the values 0, 90, 180, 270");
         }
-
     }
 
     /**
@@ -202,7 +200,6 @@
      *            Use the singlepoint basis when true.
      */
     public void setSinglepoint(boolean singlepoint) {
-        _singlepoint = singlepoint;
+        singlePoint = singlepoint;
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterData.java Wed Dec 12 08:13:06 2007
@@ -48,32 +48,29 @@
     /**
      * The image raster data
      */
-    private byte[] _rasterdata;
+    private byte[] rasterData;
 
     /**
      * Constructor for the image raster data object
-     * @param rasterdata The raster image data
+     * @param data The raster image data
      */
-    public ImageRasterData(byte[] rasterdata) {
-
-        _rasterdata = rasterdata;
-
+    public ImageRasterData(byte[] data) {
+        this.rasterData = data;
     }
 
     /**
      * Accessor method to write the AFP datastream for the Image Raster Data
      * @param os The stream to write to
-     * @throws java.io.IOException
+     * @throws java.io.IOException if an I/O exception occurred
      */
-    public void writeDataStream(OutputStream os)
-        throws IOException {
+    public void writeDataStream(OutputStream os) throws IOException {
 
         byte[] data = new byte[9];
 
         data[0] = 0x5A;
 
         // The size of the structured field
-        byte[] x = BinaryUtils.convert(_rasterdata.length + 8, 2);
+        byte[] x = BinaryUtils.convert(rasterData.length + 8, 2);
         data[1] = x[0];
         data[2] = x[1];
 
@@ -85,8 +82,6 @@
         data[8] = 0x00;
 
         os.write(data);
-        os.write(_rasterdata);
-
+        os.write(rasterData);
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterPattern.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterPattern.java?rev=603656&r1=603655&r2=603656&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterPattern.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/render/afp/modca/ImageRasterPattern.java Wed Dec 12 08:13:06 2007
@@ -685,6 +685,7 @@
      * grey scale specified. The scale should be between 0 (darkest)
      * and 16 (lightest).
      * @param greyscale The grey scale value (0 - 16)
+     * @return the raster data byte array for the given greyscale value
      */
     public static byte[] getRasterData(int greyscale) {
 
@@ -751,13 +752,8 @@
         }
 
         for (int i = 0; i < repeat; i++) {
-
             System.arraycopy(greypattern, 0, rasterdata, i * 32, 32);
-
         }
-
         return rasterdata;
-
     }
-
 }



---------------------------------------------------------------------
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