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 2008/04/25 11:30:15 UTC

svn commit: r651551 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java

Author: adelmelle
Date: Fri Apr 25 02:30:09 2008
New Revision: 651551

URL: http://svn.apache.org/viewvc?rev=651551&view=rev
Log:
Cleanup: removal of commented block/methods + some javadoc updates


Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java?rev=651551&r1=651550&r2=651551&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java Fri Apr 25 02:30:09 2008
@@ -30,7 +30,8 @@
 import org.apache.fop.fo.ValidationException;
 
 /**
- * Abstract base implementation for page sequences.
+ * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_page-sequence">
+ * <code>fo:page-sequence</code></a> object.
  */
 public class PageSequence extends AbstractPageSequence {
     
@@ -70,9 +71,10 @@
     private Flow mainFlow = null;
 
     /**
-     * Create a page sequence FO node.
+     * Create a PageSequence instance that is a child of the
+     * given {@link FONode}.
      *
-     * @param parent the parent FO node
+     * @param parent the parent {@link FONode}
      */
     public PageSequence(FONode parent) {
         super(parent);
@@ -172,6 +174,9 @@
      * The flow-name is used to associate the flow with a region on a page,
      * based on the region-names given to the regions in the page-master
      * used to generate that page.
+     * @param flow  the {@link Flow} instance to be added
+     * @throws org.apache.fop.fo.ValidationException if the fo:flow maps
+     * to an invalid page-region
      */
      private void addFlow(Flow flow) throws ValidationException {
         String flowName = flow.getFlowName();
@@ -189,133 +194,6 @@
         }
     }
 
-//     /**
-//      * Returns true when there is more flow elements left to lay out.
-//      */
-//     private boolean flowsAreIncomplete() {
-//         boolean isIncomplete = false;
-
-//         for (Iterator e = flowMap.values().iterator(); e.hasNext(); ) {
-//             Flow flow = (Flow)e.next();
-//             if (flow instanceof StaticContent) {
-//                 continue;
-//             }
-
-//             Status status = flow.getStatus();
-//             isIncomplete |= status.isIncomplete();
-//         }
-//         return isIncomplete;
-//     }
-
-//     /**
-//      * Returns the flow that maps to the given region class for the current
-//      * page master.
-//      */
-//     private Flow getCurrentFlow(String regionClass) {
-//         Region region = getCurrentSimplePageMaster().getRegion(regionClass);
-//         if (region != null) {
-//             Flow flow = (Flow)flowMap.get(region.getRegionName());
-//             return flow;
-
-//         } else {
-
-//             getLogger().error("flow is null. regionClass = '" + regionClass
-//                                + "' currentSPM = "
-//                                + getCurrentSimplePageMaster());
-
-//             return null;
-//         }
-
-//     }
-
-//      private boolean isFlowForMasterNameDone(String masterName) {
-//          // parameter is master-name of PMR; we need to locate PM
-//          // referenced by this, and determine whether flow(s) are OK
-//          if (isForcing)
-//              return false;
-//          if (masterName != null) {
-
-//              SimplePageMaster spm =
-//                  root.getLayoutMasterSet().getSimplePageMaster(masterName);
-//              Region region = spm.getRegion(FO_REGION_BODY);
-
-
-//              Flow flow = (Flow)flowMap.get(region.getRegionName());
-//              /*if ((null == flow) || flow.getStatus().isIncomplete())
-//                  return false;
-//              else
-//                  return true;*/
-//          }
-//          return false;
-//      }
-
-//     private void forcePage(AreaTree areaTree, int firstAvailPageNumber) {
-//         boolean makePage = false;
-//         if (this.forcePageCount == ForcePageCount.AUTO) {
-//             PageSequence nextSequence =
-//                 this.root.getSucceedingPageSequence(this);
-//             if (nextSequence != null) {
-//                 if (nextSequence.getIpnValue().equals("auto")) {
-//                     // do nothing special
-//                 }
-//                 else if (nextSequence.getIpnValue().equals("auto-odd")) {
-//                     if (firstAvailPageNumber % 2 == 0) {
-//                         makePage = true;
-//                     }
-//                 } else if (nextSequence.getIpnValue().equals("auto-even")) {
-//                     if (firstAvailPageNumber % 2 != 0) {
-//                         makePage = true;
-//                     }
-//                 } else {
-//                     int nextSequenceStartPageNumber =
-//                         nextSequence.getCurrentPageNumber();
-//                     if ((nextSequenceStartPageNumber % 2 == 0)
-//                             && (firstAvailPageNumber % 2 == 0)) {
-//                         makePage = true;
-//                     } else if ((nextSequenceStartPageNumber % 2 != 0)
-//                                && (firstAvailPageNumber % 2 != 0)) {
-//                         makePage = true;
-//                     }
-//                 }
-//             }
-//         } else if ((this.forcePageCount == ForcePageCount.EVEN)
-//                    && (this.pageCount % 2 != 0)) {
-//             makePage = true;
-//         } else if ((this.forcePageCount == ForcePageCount.ODD)
-//                    && (this.pageCount % 2 == 0)) {
-//             makePage = true;
-//         } else if ((this.forcePageCount == ForcePageCount.END_ON_EVEN)
-//                    && (firstAvailPageNumber % 2 == 0)) {
-//             makePage = true;
-//         } else if ((this.forcePageCount == ForcePageCount.END_ON_ODD)
-//                    && (firstAvailPageNumber % 2 != 0)) {
-//             makePage = true;
-//         } else if (this.forcePageCount == ForcePageCount.NO_FORCE) {
-//             // do nothing
-//         }
-
-//         if (makePage) {
-//             try {
-//                 this.isForcing = true;
-//                 this.currentPageNumber++;
-//                 firstAvailPageNumber = this.currentPageNumber;
-//                 currentPage = makePage(areaTree, firstAvailPageNumber, false,
-//                                        true);
-//                 String formattedPageNumber =
-//                     pageNumberGenerator.makeFormattedPageNumber(this.currentPageNumber);
-//                 currentPage.setFormattedNumber(formattedPageNumber);
-//                 currentPage.setPageSequence(this);
-//                 formatStaticContent(areaTree);
-//                 log.debug("[forced-" + firstAvailPageNumber + "]");
-//                 areaTree.addPage(currentPage);
-//                 this.root.setRunningPageNumberCounter(this.currentPageNumber);
-//                 this.isForcing = false;
-//             } catch (FOPException fopex) {
-//                 log.debug("'force-page-count' failure");
-//             }
-//         }
-//     }
-
     /**
      * Get the static content FO node from the flow map.
      * This gets the static content flow for the given flow name.
@@ -328,7 +206,7 @@
     }
 
     /**
-     * Accessor method for titleFO
+     * Accessor method for the fo:title associated with this fo:page-sequence
      * @return titleFO for this object
      */
     public Title getTitleFO() {
@@ -425,7 +303,10 @@
         }
     }
     
-    /** @return the "master-reference" property. */
+    /**
+     * Get the value of the <code>master-reference</code> property.
+     * @return the "master-reference" property
+     */
     public String getMasterReference() {
         return masterReference;
     }
@@ -435,17 +316,26 @@
         return "page-sequence";
     }
 
-    /** {@inheritDoc} */
+    /**
+     * {@inheritDoc}
+     * @return {@link org.apache.fop.fo.Constants#FO_PAGE_SEQUENCE}
+     */
     public int getNameId() {
         return FO_PAGE_SEQUENCE;
     }
     
-    /** @return the country property value */
+    /**
+     * Get the value of the <code>country</code> property.
+     * @return the country property value
+     */
     public String getCountry() {
         return this.country;
     }
     
-    /** @return the language property value */
+    /**
+     * Get the value of the <code>language</code> property.
+     * @return the language property value
+     */
     public String getLanguage() {
         return this.language;
     }



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


Re: svn commit: r651551 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java

Posted by Adrian Cumiskey <ad...@gmail.com>.
Looks fine to me.

Andreas Delmelle wrote:
> On Apr 25, 2008, at 11:30, adelmelle@apache.org wrote:
>> Author: adelmelle
>> Date: Fri Apr 25 02:30:09 2008
>> New Revision: 651551
>>
>> URL: http://svn.apache.org/viewvc?rev=651551&view=rev
>> Log:
>> Cleanup: removal of commented block/methods + some javadoc updates
> <snip />
>>
>>  /**
>> - * Abstract base implementation for page sequences.
>> + * Class modelling the <a 
>> href="http://www.w3.org/TR/xsl/#fo_page-sequence">
>> + * <code>fo:page-sequence</code></a> object.
>>   */
> 
> If anybody is not OK with those changes, now is the time to speak up. 
> I've just about finished going over the fo.flow and fo.pagination 
> packages, making similar changes in an attempt at enhancing the 
> interactivity of the fotree-javadocs.
> 
> If nobody objects, I'll commit the whole bunch later this weekend.
> 
> 
> Cheers
> 
> Andreas
> 


Re: svn commit: r651551 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
No objections for me. Thanks for doing that!

On 25.04.2008 11:33:22 Andreas Delmelle wrote:
> On Apr 25, 2008, at 11:30, adelmelle@apache.org wrote:
> > Author: adelmelle
> > Date: Fri Apr 25 02:30:09 2008
> > New Revision: 651551
> >
> > URL: http://svn.apache.org/viewvc?rev=651551&view=rev
> > Log:
> > Cleanup: removal of commented block/methods + some javadoc updates
> <snip />
> >
> >  /**
> > - * Abstract base implementation for page sequences.
> > + * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_page- 
> > sequence">
> > + * <code>fo:page-sequence</code></a> object.
> >   */
> 
> If anybody is not OK with those changes, now is the time to speak up.  
> I've just about finished going over the fo.flow and fo.pagination  
> packages, making similar changes in an attempt at enhancing the  
> interactivity of the fotree-javadocs.
> 
> If nobody objects, I'll commit the whole bunch later this weekend.
> 
> 
> Cheers
> 
> Andreas




Jeremias Maerki


Re: svn commit: r651551 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/PageSequence.java

Posted by Andreas Delmelle <an...@telenet.be>.
On Apr 25, 2008, at 11:30, adelmelle@apache.org wrote:
> Author: adelmelle
> Date: Fri Apr 25 02:30:09 2008
> New Revision: 651551
>
> URL: http://svn.apache.org/viewvc?rev=651551&view=rev
> Log:
> Cleanup: removal of commented block/methods + some javadoc updates
<snip />
>
>  /**
> - * Abstract base implementation for page sequences.
> + * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_page- 
> sequence">
> + * <code>fo:page-sequence</code></a> object.
>   */

If anybody is not OK with those changes, now is the time to speak up.  
I've just about finished going over the fo.flow and fo.pagination  
packages, making similar changes in an attempt at enhancing the  
interactivity of the fotree-javadocs.

If nobody objects, I'll commit the whole bunch later this weekend.


Cheers

Andreas