You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ad...@apache.org on 2005/09/19 23:11:24 UTC

svn commit: r290268 - in /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo: flow/TableFObj.java properties/ColumnNumberPropertyMaker.java

Author: adelmelle
Date: Mon Sep 19 14:11:20 2005
New Revision: 290268

URL: http://svn.apache.org/viewcvs?rev=290268&view=rev
Log:
Correction of style violations

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java?rev=290268&r1=290267&r2=290268&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableFObj.java Mon Sep 19 14:11:20 2005
@@ -1,3 +1,21 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
 package org.apache.fop.fo.flow;
 
 import org.apache.fop.apps.FOPException;
@@ -7,6 +25,10 @@
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
 
+/**
+ * Superclass for table-related FOs
+ *
+ */
 
 public abstract class TableFObj extends FObj {
 
@@ -14,25 +36,39 @@
     private Numeric borderBeforePrecedence;
     private Numeric borderEndPrecedence;
     private Numeric borderStartPrecedence;
-        
+    
+    /**
+     * Used for determining initial values for column-numbers
+     * in case of row-spanning cells
+     * (for clarity)
+     *
+     */
     protected static class PendingSpan {
+        
         protected int rowsLeft;
         
-        public PendingSpan( int rows ) {
+        /**
+         * Constructor
+         * 
+         * @param rows  number of rows spanned
+         */
+        public PendingSpan(int rows) {
             rowsLeft = rows;
-        }
-        
-        public String toString() {
-            StringBuffer sb = new StringBuffer();
-            sb.append("pending span: rowsLeft=").append(rowsLeft);
-            return sb.toString();
-        }
+        }        
     }
     
+    /**
+     * Main constructor
+     * 
+     * @param parent    the parent node
+     */
     public TableFObj(FONode parent) {
         super(parent);
     }
-    
+
+    /**
+     * @see FObj#bind(PropertyList)
+     */
     public void bind(PropertyList pList) throws FOPException {
         borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE).getNumeric();
         borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE).getNumeric();
@@ -59,20 +95,7 @@
             return null;
         }
     }
-    
-    protected void setBorderPrecedence(int side, Numeric newPrecedence) {
-        switch( side ) {
-        case CommonBorderPaddingBackground.BEFORE:
-            borderBeforePrecedence = newPrecedence;
-        case CommonBorderPaddingBackground.AFTER:
-            borderAfterPrecedence = newPrecedence;
-        case CommonBorderPaddingBackground.START:
-            borderStartPrecedence = newPrecedence;
-        case CommonBorderPaddingBackground.END:
-            borderEndPrecedence = newPrecedence;
-        }
-    }
-    
+        
     /**
      * Returns the current column index of the given TableFObj
      * (overridden for Table, TableBody, TableRow)
@@ -85,7 +108,11 @@
     
     /**
      * Sets the current column index of the given TableFObj
+     * used when a value for column-number is explicitly
+     * specified on the child FO (TableCell or TableColumn)
      * (overridden for Table, TableBody, TableRow)
+     * 
+     * @param   newIndex    new value for column index
      */
     protected void setCurrentColumnIndex(int newIndex) {
         //do nothing by default

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java?rev=290268&r1=290267&r2=290268&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/ColumnNumberPropertyMaker.java Mon Sep 19 14:11:20 2005
@@ -30,29 +30,31 @@
     public ColumnNumberPropertyMaker(int propId) {
         super(propId);
     }
-    
+
     /**
-     * Set default column-number from parent's currentColumnIndex
-     * 
+     * Set default column-number from parent's currentColumnIndex.
+     *
+     * @param   propertyList
      * @return  the default value for column-number
+     * @throws  PropertyException
      */
     public Property make(PropertyList propertyList) throws PropertyException {
         FObj fo = propertyList.getFObj();
-        
-        if( fo.getNameId() == Constants.FO_TABLE_CELL 
-                || fo.getNameId() == Constants.FO_TABLE_COLUMN ) {
+
+        if (fo.getNameId() == Constants.FO_TABLE_CELL
+                || fo.getNameId() == Constants.FO_TABLE_COLUMN) {
             TableFObj parent = (TableFObj) propertyList.getParentFObj();
             int columnIndex = parent.getCurrentColumnIndex();
-            if( fo.getNameId() == Constants.FO_TABLE_CELL 
-                    && parent.getNameId() == Constants.FO_TABLE_BODY ) {
+            if (fo.getNameId() == Constants.FO_TABLE_CELL
+                    && parent.getNameId() == Constants.FO_TABLE_BODY) {
                 boolean startsRow = propertyList.get(Constants.PR_STARTS_ROW)
                     .getEnum() == Constants.EN_TRUE;
-                
-                //cell w/ starts-row="true", but previous cell 
+
+                //cell w/ starts-row="true", but previous cell
                 //didn't have ends-row="true", so index has still has
                 //to be reset (for other cases this already happened in
                 //body.addChildNode())
-                if( startsRow && !((TableBody) parent).lastCellEndedRow() ) {
+                if (startsRow && !((TableBody) parent).lastCellEndedRow()) {
                     //reset column index, and reassign...
                     ((TableBody) parent).resetColumnIndex();
                     columnIndex = parent.getCurrentColumnIndex();
@@ -60,8 +62,9 @@
             }
             return new NumberProperty(columnIndex);
         } else {
-            throw new PropertyException("column-number property is only allowed on " 
-                    + "fo:table-cell or fo:table-column, not on " + fo.getName());
+            throw new PropertyException("column-number property is only allowed"
+                    + " on fo:table-cell or fo:table-column, not on "
+                    + fo.getName());
         }
     }
 }



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