]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Add a facility for the PageSequenceLayoutManager to notify about a new page being...
authorJeremias Maerki <jeremias@apache.org>
Thu, 3 Feb 2005 20:44:44 +0000 (20:44 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 3 Feb 2005 20:44:44 +0000 (20:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198371 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/AreaTreeHandler.java

index 36bc691a1dd613c179330e0f0780be45b4c53d2d..e7fcf678bf3d6457582c7f470aaee351a4671a24 100644 (file)
@@ -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 @@ public class AreaTreeHandler extends FOEventHandler {
      * @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 @@ public class AreaTreeHandler extends FOEventHandler {
      * @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 @@ public class AreaTreeHandler extends FOEventHandler {
                 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 @@ public class AreaTreeHandler extends FOEventHandler {
             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++;
+    }
 }