From 66e799c10bce09ccf2ced5962854da3fc92226f5 Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Mon, 6 Jun 2005 05:46:00 +0000 Subject: [PATCH] Minor PSLM simplifications. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198718 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/area/PageViewport.java | 2 +- .../layoutmgr/PageSequenceLayoutManager.java | 31 +++++-------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/java/org/apache/fop/area/PageViewport.java b/src/java/org/apache/fop/area/PageViewport.java index 783461cb4..2f1f7786d 100644 --- a/src/java/org/apache/fop/area/PageViewport.java +++ b/src/java/org/apache/fop/area/PageViewport.java @@ -33,7 +33,6 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.fo.Constants; import org.apache.fop.fo.pagination.SimplePageMaster; -import org.apache.fop.layoutmgr.StaticContentLayoutManager; /** * Page viewport that specifies the viewport area and holds the page contents. @@ -85,6 +84,7 @@ public class PageViewport implements Resolvable, Cloneable { pageNumberString = pageStr; viewArea = new Rectangle(0, 0, pageWidth, pageHeight); page = new Page(spm); + createSpan(false); } /** diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java index 04038e011..7ce12edab 100644 --- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java @@ -75,12 +75,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { */ private FlowLayoutManager childFLM = null; - /** - * The collection of StaticContentLayoutManager objects that - * are associated with this Page Sequence, keyed by flow-name. - */ - //private HashMap staticContentLMs = new HashMap(4); - private int startPageNum = 0; private int currentPageNum = 0; @@ -107,9 +101,10 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { } /** - * 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. + * Activate the layout of this page sequence. + * PageViewports corresponding to each page generated by this + * page sequence will be created and sent to the AreaTreeModel + * for rendering. */ public void activateLayout() { startPageNum = pageSeq.getStartingPageNumber(); @@ -457,17 +452,10 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { throw new IllegalArgumentException("Cannot create page: " + fopex.getMessage()); } - if (log.isDebugEnabled()) { - log.debug("[" + curPV.getPageNumberString() + (bIsBlank ? "*" : "") + "]"); - } - - curPV.createSpan(false); + log.debug("[" + curPV.getPageNumberString() + (bIsBlank ? "*" : "") + "]"); return curPV; } - /* TODO: See if can initialize the SCLM's just once for - * the page sequence, instead of after every page. - */ private void layoutSideRegion(int regionID) { SideRegion reg = (SideRegion)curPV.getSPM().getRegion(regionID); if (reg == null) { @@ -482,7 +470,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { getLayoutManagerMaker().makeStaticContentLayoutManager( this, sc, reg); lm.doLayout(); - lm.reset(null); } private void finishPage() { @@ -528,12 +515,8 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { } /** - * If we have already started to layout content on a page, - * and there is a forced break, see if we need to generate - * an empty page. - * Note that if not all content is placed, we aren't sure whether - * it will flow onto another page or not, so we'd probably better - * block until the queue of layoutable stuff is empty! + * Check if a blank page is needed to accomodate + * desired even or odd page number. * @param breakVal - value of break-before or break-after trait. */ private boolean needBlankPageBeforeNew(int breakVal) { -- 2.39.5