gmazza      2004/12/15 17:03:04

  Modified:    src/java/org/apache/fop/area AreaTreeHandler.java
               src/java/org/apache/fop/layoutmgr
                        PageSequenceLayoutManager.java
  Log:
  Removed Runnable interface from PSLM; new method "activateLayout()" combines
  former run() and doLayout() methods in PSLM.
  
  Revision  Changes    Path
  1.25      +2 -2      xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java
  
  Index: AreaTreeHandler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- AreaTreeHandler.java      14 Dec 2004 23:16:43 -0000      1.24
  +++ AreaTreeHandler.java      16 Dec 2004 01:03:04 -0000      1.25
  @@ -236,7 +236,7 @@
           if (pageSequence.getMainFlow() != null) {
               PageSequenceLayoutManager pageSLM 
                   = new PageSequenceLayoutManager(this, pageSequence);
  -            pageSLM.run();
  +            pageSLM.activateLayout();
               pageSequence.setCurrentPageNumber(pageSLM.getPageCount());
           }
       }
  
  
  
  1.17      +15 -28    
xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
  
  Index: PageSequenceLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- PageSequenceLayoutManager.java    7 Dec 2004 20:11:21 -0000       1.16
  +++ PageSequenceLayoutManager.java    16 Dec 2004 01:03:04 -0000      1.17
  @@ -66,7 +66,7 @@
    * LayoutManager for a PageSequence and its flow.
    * It manages all page-related layout.
    */
  -public class PageSequenceLayoutManager extends AbstractLayoutManager 
implements Runnable {
  +public class PageSequenceLayoutManager extends AbstractLayoutManager {
       private PageSequence fobj;
   
       private static class BlockBreakPosition extends LeafPosition {
  @@ -155,30 +155,6 @@
       }
   
       /**
  -     * The layout process is designed to be able to be run in a thread.
  -     * In theory it can run at the same
  -     * time as FO tree generation, once the layout-master-set has been read.
  -     * We can arrange it so that the iterator over the fobj children waits
  -     * until the next child is available.
  -     * As it produces pages, it adds them to the AreaTree, where the
  -     * rendering process can also run in a parallel thread.
  -     */
  -    public void run() {
  -        fobj.initPageNumber();
  -        setPageCounting(fobj.getCurrentPageNumber(),
  -                fobj.getPageNumberGenerator());
  -
  -        LineArea title = null;
  -        if (fobj.getTitleFO() != null) {
  -            title = getTitleArea(fobj.getTitleFO());
  -        }
  -
  -        areaTreeModel.startPageSequence(title);
  -        doLayout();
  -        flush();
  -    }
  -
  -    /**
        * Get the page count.
        * Used to get the last page number for reference for
        * the next page sequence.
  @@ -211,13 +187,23 @@
       }
   
       /**
  -     * Do the layout of this page sequence.
  +     * Start the layout of this page sequence.
        * This completes the layout of the page sequence
        * which creates and adds all the pages to the area tree.
        */
  -    protected void doLayout() {
  +    public void activateLayout() {
  +        fobj.initPageNumber();
  +        setPageCounting(fobj.getCurrentPageNumber(),
  +                fobj.getPageNumberGenerator());
   
  +        LineArea title = null;
  +        if (fobj.getTitleFO() != null) {
  +            title = getTitleArea(fobj.getTitleFO());
  +        }
  +
  +        areaTreeModel.startPageSequence(title);
           log.debug("Starting layout");
  +
           // this should be done another way
           makeNewPage(false, false);
           createBodyMainReferenceArea();
  @@ -239,6 +225,7 @@
           }
           pageCount--;
           log.debug("Ending layout");
  +        flush();
       }
   
       /**
  
  
  

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

Reply via email to