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 je...@apache.org on 2005/05/23 10:40:36 UTC

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/table TableRowIterator.java TableContentLayoutManager.java

jeremias    2005/05/23 01:40:36

  Modified:    src/java/org/apache/fop/layoutmgr/table
                        TableRowIterator.java
                        TableContentLayoutManager.java
  Log:
  Code cleanup and some javadocs.
  
  Revision  Changes    Path
  1.3       +38 -10    xml-fop/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java
  
  Index: TableRowIterator.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/TableRowIterator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TableRowIterator.java	13 May 2005 19:16:54 -0000	1.2
  +++ TableRowIterator.java	23 May 2005 08:40:36 -0000	1.3
  @@ -72,6 +72,12 @@
       private ListIterator bodyIterator = null;
       private ListIterator childInBodyIterator = null;
       
  +    /**
  +     * Creates a new TableRowIterator.
  +     * @param table the table to iterate over
  +     * @param columns the column setup for the table
  +     * @param what indicates what part of the table to iterate over (HEADER, FOOTER, BODY)
  +     */
       public TableRowIterator(Table table, ColumnSetup columns, int what) {
           this.table = table;
           this.columns = columns;
  @@ -95,6 +101,12 @@
           }
       }
       
  +    /**
  +     * <p>Preloads the whole table. 
  +     * </p>
  +     * <p>Note:This is inefficient for large tables.
  +     * </p>
  +     */
       public void prefetchAll() {
           while (prefetchNext()) {
               log.trace("found row...");
  @@ -139,6 +151,10 @@
           return rowGroup;
       }
       
  +    /**
  +     * Retuns the next effective row.
  +     * @return the requested effective row.
  +     */
       public EffRow getNextRow() {
           currentIndex++;
           boolean moreRows = true;
  @@ -152,10 +168,17 @@
           }
       }
       
  -    public void backToPreviewRow() {
  +    /**
  +     * Sets the iterator to the previous row.
  +     */
  +    public void backToPreviousRow() {
           currentIndex--;
       }
       
  +    /**
  +     * Returns the first effective row.
  +     * @return the requested effective row.
  +     */
       public EffRow getFirstRow() {
           if (rows.size() == 0) {
               prefetchNext();
  @@ -163,6 +186,14 @@
           return getCachedRow(0);
       }
       
  +    /**
  +     * <p>Returns the last effective row.
  +     * </p>
  +     * <p>Note:This is inefficient for large tables because the whole table
  +     * if preloaded.
  +     * </p>
  +     * @return the requested effective row.
  +     */
       public EffRow getLastRow() {
           while (prefetchNext()) {
               //nop
  @@ -170,6 +201,11 @@
           return getCachedRow(rows.size() - 1);
       }
       
  +    /**
  +     * Returns a cached effective row.
  +     * @param index index of the row (zero-based)
  +     * @return the requested effective row
  +     */
       public EffRow getCachedRow(int index) {
           if (index < 0 || index >= rows.size()) {
               return null;
  @@ -419,19 +455,11 @@
                       }
                       find++;
                   }
  -                //CommonBorderPaddingBackground borders = new CommonBorderPaddingBackground();
                   starting.resolveBorder(start, 
                           CommonBorderPaddingBackground.START);
  -                //starting.setBorders(borders);
  -                /*
  -                if (starting != ending) {
  -                    borders = new CommonBorderPaddingBackground();
  -                }*/
                   ending.resolveBorder(end, 
                           CommonBorderPaddingBackground.END);
  -                //ending.setBorders(borders);
                   //Only start and end borders here, before and after during layout
  -                //TODO resolve before and after borders during layout
               }
           }
       }
  
  
  
  1.7       +2 -2      xml-fop/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
  
  Index: TableContentLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TableContentLayoutManager.java	23 May 2005 07:43:05 -0000	1.6
  +++ TableContentLayoutManager.java	23 May 2005 08:40:36 -0000	1.7
  @@ -219,7 +219,7 @@
               if (next == null) {
                   //It wasn't read, yet, or we are at the last row
                   next = iter.getNextRow();
  -                iter.backToPreviewRow();
  +                iter.backToPreviousRow();
               }
               if ((prev == null) && (iter == this.trIter) && (this.headerIter != null)) {
                   prev = this.headerIter.getLastRow();
  
  
  

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