diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-02-03 20:44:44 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-02-03 20:44:44 +0000 |
commit | 2af04b96242e6f25327c88aa6635627cb4845dac (patch) | |
tree | 159745a1cde843e8afb64c6205d5dae2889e3886 | |
parent | a9d6dc70259aa7a1f006f097e32e37cfc8d4234a (diff) | |
download | xmlgraphics-fop-2af04b96242e6f25327c88aa6635627cb4845dac.tar.gz xmlgraphics-fop-2af04b96242e6f25327c88aa6635627cb4845dac.zip |
Add a facility for the PageSequenceLayoutManager to notify about a new page being added so the rendering statistics work again.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198371 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/area/AreaTreeHandler.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java index 36bc691a1..e7fcf678b 100644 --- a/src/java/org/apache/fop/area/AreaTreeHandler.java +++ b/src/java/org/apache/fop/area/AreaTreeHandler.java @@ -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++; + } } |