Author: acumiskey
Date: Tue Jul 22 10:25:27 2008
New Revision: 678812

URL: http://svn.apache.org/viewvc?rev=678812&view=rev
Log:
* Removed unused goca accessor methods from AFPState.
* Created LineDataInfo class, this simplifies all the parameter passing on line 
creation.

Added:
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/TextDataInfo.java
      - copied, changed from r678713, 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextDataInfo.java
Removed:
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextDataInfo.java
Modified:
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractState.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPState.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextPainter.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
    
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextObject.java

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractState.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractState.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractState.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/AbstractState.java
 Tue Jul 22 10:25:27 2008
@@ -30,16 +30,23 @@
  * A base class which holds information about the current rendering state.
  */
 public abstract class AbstractState {
+    
+    /** current state data */
     private AbstractData currentData = null;
+    
+    /** the state stack */
     private Stack/*<AbstractData>*/ stateStack = null;
 
     /**
      * Instantiates a new state data object
+     * 
      * @return a new state data object
      */
     protected abstract AbstractData instantiateData();
     
     /**
+     * Returns the currently valid state
+     * 
      * @return the currently valid state
      */
     public AbstractData getData() {
@@ -66,6 +73,7 @@
 
     /**
      * Get the color.
+     * 
      * @return the color
      */
     public Color getColor() {
@@ -77,6 +85,7 @@
 
     /**
      * Get the background color.
+     * 
      * @return the background color
      */
     public Color getBackColor() {
@@ -103,6 +112,7 @@
 
     /**
      * Set the current font name
+     * 
      * @param internalFontName the internal font name
      * @return true if the font name has changed
      */
@@ -116,6 +126,7 @@
 
     /**
      * Gets the current font name
+     * 
      * @return the current font name
      */
     public String getFontName() {
@@ -124,6 +135,7 @@
     
     /**
      * Gets the current font size
+     * 
      * @return the current font size
      */
     public int getFontSize() {
@@ -147,6 +159,7 @@
 
     /**
      * Set the current line width.
+     * 
      * @param width the line width in points
      * @return true if the line width has changed
      */
@@ -159,7 +172,8 @@
     }
 
     /**
-     * Gets the current line width
+     * Returns the current line width
+     * 
      * @return the current line width
      */
     public float getLineWidth() {
@@ -168,6 +182,7 @@
 
     /**
      * Sets the dash array (line type) for the current basic stroke
+     * 
      * @param dash the line dash array
      * @return true if the dash array has changed
      */
@@ -228,6 +243,7 @@
     
     /**
      * Concatenates the given AffineTransform to the current one.
+     * 
      * @param tf the transform to concatenate to the current level transform
      */
     public void concatenate(AffineTransform tf) {
@@ -260,6 +276,7 @@
      * Pop the state from the stack and set current values to popped state.
      * This should be called when a Q operator is used so
      * the state is restored to the correct values.
+     * 
      * @return the restored state, null if the stack is empty
      */
     public AbstractData pop() {
@@ -280,6 +297,8 @@
     }
 
     /**
+     * Return the state stack
+     * 
      * @return the state stack
      */
     protected Stack/*<AbstractData>*/ getStateStack() {
@@ -299,6 +318,7 @@
      * A base state data holding object 
      */
     public abstract class AbstractData implements Cloneable, Serializable {
+
         /** The current color */
         private Color color = null;
 
@@ -325,6 +345,7 @@
          * a new viewport. Note that all concatenation operations are logged
          * so they can be replayed if necessary (ex. for block-containers with
          * "fixed" positioning.
+         * 
          * @param at Transformation to perform
          */
         public void concatenate(AffineTransform at) {
@@ -333,6 +354,7 @@
 
         /**
          * Get the current AffineTransform.
+         * 
          * @return the current transform
          */
         public AffineTransform getTransform() {

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPRenderer.java
 Tue Jul 22 10:25:27 2008
@@ -373,14 +373,14 @@
         float[] dstPts = new float[srcPts.length];
         int[] coords = mpts2units(srcPts, dstPts);
         int x2 = coords[X] + Math.round(mpt2units(width * 1000));
-        int thickness = Math.round(mpt2units(height * 1000));
-        getAFPDataStream().createLine(
-                coords[X],
-                coords[Y],
-                x2,
-                coords[Y],
-                thickness,
-                currentState.getColor());
+        LineDataInfo lineDataInfo = new LineDataInfo();
+        lineDataInfo.x1 = coords[X];
+        lineDataInfo.y1 = coords[Y];
+        lineDataInfo.x2 = x2;
+        lineDataInfo.y2 = coords[Y];
+        lineDataInfo.thickness = Math.round(mpt2units(height * 1000));
+        lineDataInfo.color = currentState.getColor();
+        getAFPDataStream().createLine(lineDataInfo);
     }
 
     /** [EMAIL PROTECTED] */
@@ -397,166 +397,168 @@
             return;
         }
 
+        LineDataInfo lineDataInfo = new LineDataInfo();
+        lineDataInfo.color = col;
+
         switch (style) {
+        
         case Constants.EN_DOUBLE:
+            
+            lineDataInfo.x1 = coords[X1];
+            lineDataInfo.y1 = coords[Y1];
+
             if (horz) {
                 float h3 = height / 3;
-                float ym2 = dstPts[Y1] + h3 + h3;
-                afpDataStream.createLine(
-                        coords[X1],
-                        coords[Y1],
-                        coords[X2],
-                        coords[Y1],
-                        Math.round(h3),
-                        col);
-                afpDataStream.createLine(
-                        coords[X1],
-                        Math.round(ym2),
-                        coords[X2],
-                        Math.round(ym2),
-                        Math.round(h3),
-                        col);
+                lineDataInfo.thickness = Math.round(h3);
+                
+                lineDataInfo.x2 = coords[X2];
+                lineDataInfo.y2 = coords[Y1];
+                afpDataStream.createLine(lineDataInfo);
+                                
+                int ym2 = Math.round(dstPts[Y1] + h3 + h3);
+                lineDataInfo.y1 = ym2;
+                lineDataInfo.y2 = ym2;
+                afpDataStream.createLine(lineDataInfo);
             } else {
                 float w3 = width / 3;
-                float xm2 = dstPts[X1] + w3 + w3;
-                afpDataStream.createLine(
-                        coords[X1],
-                        coords[Y1],
-                        coords[X1],
-                        coords[Y2],
-                        Math.round(w3),
-                        col);
-                afpDataStream.createLine(
-                        Math.round(xm2),
-                        coords[Y1],
-                        Math.round(xm2),
-                        coords[Y2],
-                        Math.round(w3),
-                        col);
+                lineDataInfo.thickness = Math.round(w3);
+
+                lineDataInfo.x2 = coords[X1];
+                lineDataInfo.y2 = coords[Y2];                
+                afpDataStream.createLine(lineDataInfo);
+                
+                int xm2 = Math.round(dstPts[X1] + w3 + w3);
+                lineDataInfo.x1 = xm2;
+                lineDataInfo.x2 = xm2;
+                afpDataStream.createLine(lineDataInfo);
             }
             break;
+            
         case Constants.EN_DASHED:
+            lineDataInfo.x1 = coords[X1];
+
             if (horz) {
                 float w2 = 2 * height;
-                while (coords[X1] + w2 < coords[X2]) {
-                    afpDataStream.createLine(
-                            coords[X1],
-                            coords[Y1],
-                            coords[X1] + Math.round(w2),
-                            coords[Y1],
-                            Math.round(height),
-                            col);
-                    coords[X1] += 2 * w2;
+
+                lineDataInfo.y1 = coords[Y1];
+                lineDataInfo.x2 = coords[X1] + Math.round(w2);
+                lineDataInfo.y2 = coords[Y1];
+                lineDataInfo.thickness = Math.round(height);
+                
+                while (lineDataInfo.x1 + w2 < coords[X2]) {
+                    afpDataStream.createLine(lineDataInfo);                    
+                    lineDataInfo.x1 += 2 * w2; 
                 }
             } else {
                 float h2 = 2 * width;
-                while (coords[Y1] + h2 < coords[Y2]) {
-                    afpDataStream.createLine(
-                            coords[X1],
-                            coords[Y2],
-                            coords[X1],
-                            coords[Y1] + Math.round(h2),
-                            Math.round(width),
-                            col);
-                    coords[Y1] += 2 * h2;
+
+                lineDataInfo.y1 = coords[Y2];
+                lineDataInfo.x2 = coords[X1];
+                lineDataInfo.y2 = coords[Y1] + Math.round(h2);
+                lineDataInfo.thickness = Math.round(width);
+
+                while (lineDataInfo.y2 < coords[Y2]) {
+                    afpDataStream.createLine(lineDataInfo);
+                    lineDataInfo.y2 += 2 * h2;
                 }
             }
             break;
+            
         case Constants.EN_DOTTED:
+
+            lineDataInfo.x1 = coords[X1];
+            lineDataInfo.y1 = coords[Y1];
+
             if (horz) {
-                while (coords[X1] + height < coords[X2]) {
-                    afpDataStream.createLine(
-                            coords[X1],
-                            coords[Y1],
-                            coords[X1] + Math.round(height),
-                            coords[Y1],
-                            Math.round(height),
-                            col
-                    );
+                lineDataInfo.thickness = Math.round(height);
+                lineDataInfo.x2 = coords[X1] + lineDataInfo.thickness;
+                lineDataInfo.y2 = coords[Y1];
+                while (lineDataInfo.x2 < coords[X2]) {
+                    afpDataStream.createLine(lineDataInfo);
                     coords[X1] += 2 * height;
+                    lineDataInfo.x1 = coords[X1];
+                    lineDataInfo.x2 = coords[X1] + lineDataInfo.thickness;
                 }
             } else {
-                while (coords[Y1] + width < coords[Y2]) {
-                    afpDataStream.createLine(
-                            coords[X1],
-                            coords[Y1],
-                            coords[X1],
-                            coords[Y1] + Math.round(width),
-                            Math.round(width),
-                            col);
+                lineDataInfo.thickness = Math.round(width);
+                lineDataInfo.x2 = coords[X1];
+                lineDataInfo.y2 = coords[Y1] + lineDataInfo.thickness;
+                
+                while (lineDataInfo.y2 < coords[Y2]) {
+                    afpDataStream.createLine(lineDataInfo);
                     coords[Y1] += 2 * width;
+                    lineDataInfo.y1 = coords[Y1];
+                    lineDataInfo.y2 = coords[Y1] + lineDataInfo.thickness;
                 }
             }
             break;
         case Constants.EN_GROOVE:
         case Constants.EN_RIDGE: {
+            
             float colFactor = (style == EN_GROOVE ? 0.4f : -0.4f);
             if (horz) {
-                Color uppercol = lightenColor(col, -colFactor);
-                Color lowercol = lightenColor(col, colFactor);
+
+                lineDataInfo.x1 = coords[X1];
+                lineDataInfo.x2 = coords[X2];                
+
                 float h3 = height / 3;
-                afpDataStream.createLine(
-                        coords[X1],
-                        coords[Y1],
-                        coords[X2],
-                        coords[Y1],
-                        Math.round(h3),
-                        uppercol);
-                afpDataStream.createLine(
-                        coords[X1],
-                        Math.round(dstPts[Y1] + h3),
-                        coords[X2],
-                        Math.round(dstPts[Y1] + h3),
-                        Math.round(h3),
-                        col);
-                afpDataStream.createLine(
-                        coords[X1],
-                        Math.round(dstPts[Y1] + h3 + h3),
-                        coords[X2],
-                        Math.round(dstPts[Y1] + h3 + h3),
-                        Math.round(h3),
-                        lowercol);
+                
+                lineDataInfo.color = lightenColor(col, -colFactor);
+                lineDataInfo.thickness = Math.round(h3);
+                lineDataInfo.y1 = lineDataInfo.y2 = coords[Y1];
+                afpDataStream.createLine(lineDataInfo);
+                
+                lineDataInfo.color = col;                 
+                lineDataInfo.y1 = lineDataInfo.y2 = Math.round(dstPts[Y1] + 
h3);
+                afpDataStream.createLine(lineDataInfo);
+                
+                lineDataInfo.color = lightenColor(col, colFactor);
+                lineDataInfo.y1 = lineDataInfo.y2 = Math.round(dstPts[Y1] + h3 
+ h3);                
+                afpDataStream.createLine(lineDataInfo);
+                
             } else {
-                Color leftcol = lightenColor(col, -colFactor);
-                Color rightcol = lightenColor(col, colFactor);
+
+                lineDataInfo.y1 = coords[Y1];
+                lineDataInfo.y2 = coords[Y2];                
+
                 float w3 = width / 3;
                 float xm1 = dstPts[X1] + (w3 / 2);
-                afpDataStream.createLine(
-                        Math.round(xm1),
-                        coords[Y1],
-                        Math.round(xm1),
-                        coords[Y2],
-                        Math.round(w3),
-                        leftcol);
-                afpDataStream.createLine(
-                        Math.round(xm1 + w3),
-                        coords[Y1],
-                        Math.round(xm1 + w3),
-                        coords[Y2],
-                        Math.round(w3),
-                        col);
-                afpDataStream.createLine(
-                        Math.round(xm1 + w3 + w3),
-                        coords[Y1],
-                        Math.round(xm1 + w3 + w3),
-                        coords[Y2],
-                        Math.round(w3),
-                        rightcol);
+
+                lineDataInfo.color = lightenColor(col, -colFactor);
+                lineDataInfo.x1 = lineDataInfo.x2 = Math.round(xm1);
+                afpDataStream.createLine(lineDataInfo);
+                
+                lineDataInfo.color = col;
+                lineDataInfo.x1 = lineDataInfo.x2 = Math.round(xm1 + w3);
+                afpDataStream.createLine(lineDataInfo);
+
+                lineDataInfo.color = lightenColor(col, colFactor);
+                lineDataInfo.x1 = lineDataInfo.x2 = Math.round(xm1 + w3 + w3);
+                afpDataStream.createLine(lineDataInfo);
             }
             break;
         }
+        
         case Constants.EN_HIDDEN:
             break;
+            
         case Constants.EN_INSET:
         case Constants.EN_OUTSET:
         default:
-              afpDataStream.createLine(
-                      coords[X1],
-                      coords[Y1],
-                      (horz ? coords[X2] : coords[X1]),
-                      (horz ? coords[Y1] : coords[Y2]),
-                      Math.abs(Math.round(horz ? height : width)),
-                      col);
+              lineDataInfo.x1 = coords[X1]; 
+              lineDataInfo.y1 = coords[Y1];
+              if (horz) {
+                  lineDataInfo.thickness = Math.round(height); 
+                  lineDataInfo.x2 = coords[X2];
+                  lineDataInfo.y2 = coords[Y1];
+              } else {
+                  lineDataInfo.thickness = Math.round(width); 
+                  lineDataInfo.x2 = coords[X1];
+                  lineDataInfo.y2 = coords[Y2];                  
+              }
+              lineDataInfo.x2 = (horz ? coords[X2] : coords[X1]);
+              lineDataInfo.y2 = (horz ? coords[Y1] : coords[Y2]);
+              afpDataStream.createLine(lineDataInfo);
         }
     }
 
@@ -846,7 +848,7 @@
 
     /** [EMAIL PROTECTED] */
     public void renderText(TextArea text) {
-        log.debug(text.getText());
+//        log.debug(text.getText());
         renderInlineAreaBackAndBorders(text);
 
         String name = getInternalFontNameForArea(text);
@@ -909,7 +911,7 @@
 
         int interCharacterAdjustment = 
Math.round(mpt2units(text.getTextLetterSpaceAdjust()));
 
-        AFPTextDataInfo textDataInfo = new AFPTextDataInfo();
+        TextDataInfo textDataInfo = new TextDataInfo();
         textDataInfo.setFontReference(fontReference);
         textDataInfo.setX(coords[X]);
         textDataInfo.setY(coords[Y]);
@@ -917,6 +919,7 @@
         
textDataInfo.setVariableSpaceCharacterIncrement(variableSpaceCharacterIncrement);
         textDataInfo.setInterCharacterAdjustment(interCharacterAdjustment);
         textDataInfo.setData(data);
+        textDataInfo.setOrientation(currentState.getOrientation());
         getAFPDataStream().createText(textDataInfo);
         // word.getOffset() = only height of text itself
         // currentBlockIPPosition: 0 for beginning of line; nonzero

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPState.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPState.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPState.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPState.java
 Tue Jul 22 10:25:27 2008
@@ -47,9 +47,6 @@
     /** The current page */
     private AFPPageState pageState = new AFPPageState();
 
-    /** Whether or not GOCA is used for handling SVG */
-    private boolean goca = false; // false by default
-    
     /**
      * Sets the rotation to be used for portrait pages, valid values are 0
      * (default), 90, 180, 270.
@@ -190,24 +187,6 @@
     }
 
     /**
-     * Sets if GOCA is to be used for SVG handling
-     * 
-     * @param value is true if GOCA is used for SVG handling
-     */
-    public void setUseGOCA(boolean value) {
-        this.goca = value;
-    }
-    
-    /**
-     * Returns true if GOCA is enabled for SVG handling
-     * 
-     * @return true if GOCA is enabled for SVG handling
-     */
-    public boolean useGOCA() {
-        return this.goca;
-    }
-
-    /**
      * Sets if the current painted shape is to be filled
      * 
      * @param fill true if the current painted shape is to be filled
@@ -420,4 +399,14 @@
             + "}";
         }
     }
+
+    /**
+     * Returns the current text orientation
+     * TODO the current text orientation
+     * @return the current text orientation
+     */
+    public int getOrientation() {
+        return 0;
+    }
+
 }
\ No newline at end of file

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextPainter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextPainter.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextPainter.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextPainter.java
 Tue Jul 22 10:25:27 2008
@@ -62,7 +62,6 @@
     protected Log log = LogFactory.getLog(AFPTextPainter.class);
     
     private AFPTextHandler nativeTextHandler;
-    //private FontInfo fontInfo;
 
     /**
      * Use the stroking text painter to get the bounds and shape.

Copied: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/TextDataInfo.java
 (from r678713, 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextDataInfo.java)
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/TextDataInfo.java?p2=xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/TextDataInfo.java&p1=xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextDataInfo.java&r1=678713&r2=678812&rev=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPTextDataInfo.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/TextDataInfo.java
 Tue Jul 22 10:25:27 2008
@@ -22,19 +22,29 @@
 import java.awt.Color;
 
 /**
- * Contains text data information
+ * Text data information
  */
-public class AFPTextDataInfo {
+public class TextDataInfo {
+
     private int fontReference;
+    
     private int x;
+    
     private int y;
+    
     private Color color;
+    
     private int variableSpaceCharacterIncrement;
+    
     private int interCharacterAdjustment;
+    
     private byte[] data;
+    
     private int orientation;
     
     /**
+     * Returns the font reference
+     * 
      * @return the font reference
      */
     public int getFontReference() {
@@ -43,6 +53,7 @@
     
     /**
      * Sets the font reference
+     * 
      * @param fontReference the font reference
      */
     protected void setFontReference(int fontReference) {
@@ -50,6 +61,8 @@
     }
     
     /**
+     * Returns the x coordinate
+     * 
      * @return the x coordinate
      */
     public int getX() {
@@ -58,6 +71,7 @@
     
     /**
      * Sets the X coordinate
+     * 
      * @param x the X coordinate
      */
     protected void setX(int x) {
@@ -65,6 +79,8 @@
     }
     
     /**
+     * Returns the y coordinate
+     * 
      * @return the y coordinate
      */
     public int getY() {
@@ -73,6 +89,7 @@
     
     /**
      * Sets the Y coordinate
+     * 
      * @param y the Y coordinate
      */
     protected void setY(int y) {
@@ -80,6 +97,8 @@
     }
     
     /**
+     * Returns the color
+     * 
      * @return the color
      */
     public Color getColor() {
@@ -88,6 +107,7 @@
     
     /**
      * Sets the color
+     * 
      * @param color the color
      */
     protected void setColor(Color color) {
@@ -95,6 +115,8 @@
     }
     
     /**
+     * Return the variable space character increment
+     * 
      * @return the variable space character increment
      */
     public int getVariableSpaceCharacterIncrement() {
@@ -103,6 +125,7 @@
     
     /**
      * Sets the variable space character increment
+     * 
      * @param variableSpaceCharacterIncrement the variable space character 
increment
      */
     protected void setVariableSpaceCharacterIncrement(
@@ -111,6 +134,8 @@
     }
     
     /**
+     * Return the inter character adjustment
+     * 
      * @return the inter character adjustment
      */
     public int getInterCharacterAdjustment() {
@@ -119,6 +144,7 @@
     
     /**
      * Sets the inter character adjustment
+     * 
      * @param interCharacterAdjustment the inter character adjustment
      */
     protected void setInterCharacterAdjustment(int interCharacterAdjustment) {
@@ -126,6 +152,8 @@
     }
     
     /**
+     * Return the text data
+     * 
      * @return the text data
      */
     public byte[] getData() {
@@ -134,6 +162,7 @@
     
     /**
      * Sets the text data
+     * 
      * @param data the text orientation
      */
     protected void setData(byte[] data) {
@@ -142,6 +171,7 @@
 
     /**
      * Sets the text orientation
+     * 
      * @param orientation the text orientation
      */
     public void setOrientation(int orientation) {
@@ -149,6 +179,8 @@
     }
     
     /**
+     * Returns the text orientation
+     * 
      * @return the text orientation
      */
     public int getOrientation() {
@@ -157,7 +189,7 @@
     
     /** [EMAIL PROTECTED] */
     public String toString() {
-        return "AFPTextDataInfo{fontReference=" + fontReference
+        return "TextDataInfo{fontReference=" + fontReference
         + ", x=" + x
         + ", y=" + y
         + ", color=" + color

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/fonts/CharacterSet.java
 Tue Jul 22 10:25:27 2008
@@ -281,7 +281,6 @@
      * in 99.9% of cases the font metrics will be the same as the 0 degrees
      * therefore the implementation currently will always use 0 degrees.
      * 
-     * 
      * @return characterSetOrentation The current orientation metrics.
      */
     private CharacterSetOrientation getCharacterSetOrientation() {

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AFPDataStream.java
 Tue Jul 22 10:25:27 2008
@@ -29,7 +29,8 @@
 import org.apache.commons.logging.LogFactory;
 
 import org.apache.fop.render.afp.AFPFontAttributes;
-import org.apache.fop.render.afp.AFPTextDataInfo;
+import org.apache.fop.render.afp.LineDataInfo;
+import org.apache.fop.render.afp.TextDataInfo;
 import org.apache.fop.render.afp.DataObjectInfo;
 import org.apache.fop.render.afp.ExternalResourceGroupManager;
 import org.apache.fop.render.afp.ObjectAreaInfo;
@@ -390,7 +391,7 @@
      * @param textDataInfo
      *            the afp text data
      */
-    public void createText(AFPTextDataInfo textDataInfo) {
+    public void createText(TextDataInfo textDataInfo) {
         textDataInfo.setOrientation(orientation);
         getCurrentPage().createText(textDataInfo);
     }
@@ -537,22 +538,11 @@
     /**
      * Method to create a line on the current page.
      *
-     * @param x1
-     *            the first x coordinate of the line
-     * @param y1
-     *            the first y coordinate of the line
-     * @param x2
-     *            the second x coordinate of the line
-     * @param y2
-     *            the second y coordinate of the line
-     * @param thickness
-     *            the thickness of the line
-     * @param col
-     *            The text color.
+     * @param lineDataInfo the line data information.
      */
-    public void createLine(int x1, int y1, int x2, int y2, int thickness,
-            Color col) {
-        getCurrentPage().createLine(x1, y1, x2, y2, thickness, orientation, 
col);
+    public void createLine(LineDataInfo lineDataInfo) {
+        lineDataInfo.setOrientation(orientation);
+        getCurrentPage().createLine(lineDataInfo);
     }
 
     /**

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/AbstractPageObject.java
 Tue Jul 22 10:25:27 2008
@@ -25,7 +25,8 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.fop.render.afp.AFPTextDataInfo;
+import org.apache.fop.render.afp.LineDataInfo;
+import org.apache.fop.render.afp.TextDataInfo;
 import org.apache.fop.render.afp.DataObjectCache;
 import org.apache.fop.render.afp.ResourceInfo;
 import org.apache.fop.render.afp.fonts.AFPFont;
@@ -169,25 +170,11 @@
     /**
      * Helper method to create a line on the current page, this method 
delegates
      * to the presentation text object in order to construct the line.
-     *
-     * @param x1
-     *            the first x coordinate of the line
-     * @param y1
-     *            the first y coordinate of the line
-     * @param x2
-     *            the second x coordinate of the line
-     * @param y2
-     *            the second y coordinate of the line
-     * @param thickness
-     *            the thickness of the line
-     * @param lineRotation
-     *            the rotation of the line
-     * @param col
-     *            The text color.
-     */
-    public void createLine(int x1, int y1, int x2, int y2, int thickness,
-            int lineRotation, Color col) {
-        getPresentationTextObject().createLineData(x1, y1, x2, y2, thickness, 
lineRotation, col);
+     * 
+     * @param lineDataInfo the line data information.
+     */
+    public void createLine(LineDataInfo lineDataInfo) {
+        getPresentationTextObject().createLineData(lineDataInfo);
     }
 
     /**
@@ -197,7 +184,7 @@
      * @param textDataInfo
      *            the afp text data
      */
-    public void createText(AFPTextDataInfo textDataInfo) {
+    public void createText(TextDataInfo textDataInfo) {
         getPresentationTextObject().createTextData(textDataInfo);
     }
 

Modified: 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java?rev=678812&r1=678811&r2=678812&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/modca/PresentationTextData.java
 Tue Jul 22 10:25:27 2008
@@ -24,7 +24,8 @@
 import java.io.IOException;
 import java.io.OutputStream;
 
-import org.apache.fop.render.afp.AFPTextDataInfo;
+import org.apache.fop.render.afp.LineDataInfo;
+import org.apache.fop.render.afp.TextDataInfo;
 import org.apache.fop.render.afp.tools.BinaryUtils;
 
 /**
@@ -271,7 +272,7 @@
      * @throws MaximumSizeExceededException
      *             thrown if the maximum number of text data is exceeded
      */
-    public void createTextData(AFPTextDataInfo textDataInfo)
+    public void createTextData(TextDataInfo textDataInfo)
             throws MaximumSizeExceededException {
 
         ByteArrayOutputStream afpdata = new ByteArrayOutputStream();
@@ -357,28 +358,22 @@
      * Drawing of lines using the starting and ending coordinates, thickness 
and
      * colour arguments.
      * 
-     * @param x1
-     *            The starting X coordinate.
-     * @param y1
-     *            The starting Y coordinate.
-     * @param x2
-     *            The ending X coordinate.
-     * @param y2
-     *            The ending Y coordinate.
-     * @param thickness
-     *            The line thickness.
-     * @param orientation
-     *            The orientation of the text data.
-     * @param col
-     *            The text color.
+     * @param lineDataInfo the line data information.
      * @throws MaximumSizeExceededException
      *            thrown if the maximum number of line data has been exceeded
      */
-    public void createLineData(int x1, int y1, int x2, int y2, int thickness,
-            int orientation, Color col) throws MaximumSizeExceededException {
+    public void createLineData(LineDataInfo lineDataInfo) throws 
MaximumSizeExceededException {
 
         ByteArrayOutputStream afpdata = new ByteArrayOutputStream();
 
+        int thickness = lineDataInfo.getThickness();
+        int orientation = lineDataInfo.getOrientation();
+        int x1 = lineDataInfo.getX1();
+        int y1 = lineDataInfo.getY1();
+        int x2 = lineDataInfo.getX2();
+        int y2 = lineDataInfo.getY2();
+        Color col = lineDataInfo.getColor();
+        
         if (currentOrientation != orientation) {
             setTextOrientation(orientation, afpdata);
             currentOrientation = orientation;
@@ -407,9 +402,9 @@
             return;
         }
 
-        int s = afpdata.size();
+        int dataSize = afpdata.size();
 
-        if (baos.size() + s > MAX_SIZE) {
+        if (baos.size() + dataSize > MAX_SIZE) {
             currentXCoordinate = -1;
             currentYCoordinate = -1;
             throw new MaximumSizeExceededException();
@@ -533,9 +528,7 @@
                 }, 0, 5);
     }
 
-    /**
-     * [EMAIL PROTECTED]
-     */
+    /** [EMAIL PROTECTED] */
     public void write(OutputStream os) throws IOException {
         byte[] data = baos.toByteArray();
         byte[] size = BinaryUtils.convert(data.length - 1, 2);

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=678812&r1=678811&r2=678812&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
 Tue Jul 22 10:25:27 2008
@@ -24,7 +24,8 @@
 import java.io.OutputStream;
 import java.util.List;
 
-import org.apache.fop.render.afp.AFPTextDataInfo;
+import org.apache.fop.render.afp.LineDataInfo;
+import org.apache.fop.render.afp.TextDataInfo;
 
 /**
  * The Presentation Text object is the data object used in document processing
@@ -81,7 +82,7 @@
      * @param textDataInfo
      *            The afp text data
      */
-    public void createTextData(AFPTextDataInfo textDataInfo) {
+    public void createTextData(TextDataInfo textDataInfo) {
         if (currentPresentationTextData == null) {
             startPresentationTextData();
         }
@@ -94,56 +95,20 @@
     }
 
     /**
-     * Drawing of lines using the starting and ending coordinates, thickness.
-     *
-     * @param x1
-     *            The first x coordinate of the line.
-     * @param y1
-     *            The first y coordinate of the line.
-     * @param x2
-     *            The second x coordinate of the line.
-     * @param y2
-     *            The second y coordinate of the line.
-     * @param thickness
-     *            The thickness of the line.
-     * @param col
-     *            The text color.
-     */
-    public void createLineData(int x1, int y1, int x2, int y2, int thickness, 
Color col) {
-        // Default orientation
-        createLineData(x1, y1, x2, y2, thickness, 0, col);
-    }
-
-    /**
      * Drawing of lines using the starting and ending coordinates, thickness 
and
      * orientation arguments.
      *
-     * @param x1
-     *            The first x coordinate of the line.
-     * @param y1
-     *            The first y coordinate of the line.
-     * @param x2
-     *            The second x coordinate of the line.
-     * @param y2
-     *            The second y coordinate of the line.
-     * @param thickness
-     *            The thickness of the line.
-     * @param orientation
-     *            The orientation of the line.
-     * @param col
-     *            The text color.
+     * @param lineDataInfo the line data information.
      */
-    public void createLineData(int x1, int y1, int x2, int y2, int thickness,
-        int orientation, Color col) {
+    public void createLineData(LineDataInfo lineDataInfo) {
         if (currentPresentationTextData == null) {
             startPresentationTextData();
         }
         try {
-            currentPresentationTextData.createLineData(x1, y1, x2, y2,
-                thickness, orientation, col);
+            currentPresentationTextData.createLineData(lineDataInfo);
         } catch (MaximumSizeExceededException msee) {
             endPresentationTextData();
-            createLineData(x1, y1, x2, y2, thickness, orientation, col);
+            createLineData(lineDataInfo);
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to