jeremias    2005/02/03 12:44:45

  Modified:    src/java/org/apache/fop/area AreaTreeHandler.java
  Log:
  Add a facility for the PageSequenceLayoutManager to notify about a new page 
being added so the rendering statistics work again.
  
  Revision  Changes    Path
  1.31      +18 -4     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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- AreaTreeHandler.java      2 Jan 2005 20:42:50 -0000       1.30
  +++ AreaTreeHandler.java      3 Feb 2005 20:44:44 -0000       1.31
  @@ -1,5 +1,5 @@
   /*
  - * Copyright 1999-2004 The Apache Software Foundation.
  + * Copyright 1999-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.
  @@ -103,9 +103,10 @@
        * @param renderType Desired fo.Constants output type (RENDER_PDF, 
        *   RENDER_PS, etc.)
        * @param stream OutputStream
  +     * @throws FOPException if the RenderPagesModel cannot be created
        */
       public AreaTreeHandler (FOUserAgent userAgent, int renderType, 
  -        OutputStream stream) throws FOPException {
  +                OutputStream stream) throws FOPException {
           super(userAgent);
   
           model = new RenderPagesModel(userAgent, renderType, fontInfo,
  @@ -149,6 +150,9 @@
        * @param pv a page viewport that contains the area with this ID
        */
       public void associateIDWithPageViewport(String id, PageViewport pv) {
  +        if (log.isDebugEnabled()) {
  +            log.debug("associateIDWithPageViewport(" + id + ", " + pv + ")");
  +        }
           List pvList = (List) idLocations.get(id);
           if (pvList == null) { // first time ID located
               pvList = new ArrayList();
  @@ -234,7 +238,8 @@
                   pageSLM = (PageSequenceLayoutManager)
                   getLayoutManagerMaker().makeLayoutManager(pageSequence);
               } catch (FOPException e) {
  -                log.error("Failed to create a PageSequenceLayoutManager; no 
pages will be laid out:");
  +                log.error("Failed to create a PageSequenceLayoutManager; "
  +                        + "no pages will be laid out:");
                   log.error(e.getMessage());
                   return;
               }
  @@ -301,5 +306,14 @@
               model.handleOffDocumentItem(odi);
           }
       }
  +
  +    /**
  +     * Called by the PageSequenceLayoutManager to notify the AreaTreeHandler
  +     * of a new page being started.
  +     * @param pageNumber page number
  +     */
  +    public void notifyNewPage(String pageNumber) {
  +        pageCount++;
  +    }
   }
   
  
  
  

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

Reply via email to