From 987d0265dfea3a2bba8a30ae0931925e4791e76c Mon Sep 17 00:00:00 2001 From: Karen Lease Date: Sun, 11 Nov 2001 14:11:46 +0000 Subject: [PATCH] Add some more LayoutManagers and start to actually do something git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194556 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/layoutmgr/AbstractLayoutManager.java | 8 +++----- .../apache/fop/layoutmgr/BlockStackingLayoutManager.java | 2 +- src/org/apache/fop/layoutmgr/LayoutManager.java | 1 + src/org/apache/fop/layoutmgr/PageLayoutManager.java | 7 ++++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 696e5bd65..4c7c67f14 100644 --- a/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -10,7 +10,7 @@ package org.apache.fop.layoutmgr; import org.apache.fop.fo.FObj; import org.apache.fop.area.Area; -import java.util.Iterator; +import java.util.ListIterator; /** * The base class for all LayoutManagers. @@ -36,7 +36,7 @@ public abstract class AbstractLayoutManager implements LayoutManager { * its generateAreas method. */ public void generateAreas() { - Iterator children = fobj.getChildren(); + ListIterator children = fobj.getChildren(); while (children.hasNext()) { LayoutManager lm = ((FObj)children.next()).getLayoutManager(); if (lm != null) { @@ -84,15 +84,13 @@ public abstract class AbstractLayoutManager implements LayoutManager { * BPD. */ abstract public Area getParentArea(Area childArea); + public boolean generatesInlineAreas() { return false; } - public boolean generatesLineAreas() { - return false; - } /** * Add a child area to the current area. If this causes the maximum diff --git a/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java index 8a550b96c..65474c4ed 100644 --- a/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java @@ -184,7 +184,7 @@ public abstract class BlockStackingLayoutManager * @param childArea the area to add: will be some block-stacked Area. */ public void addChild(Area childArea) { - addChildToArea((Block)childArea, getCurrentArea()); + addChildToArea(childArea, getCurrentArea()); } /** diff --git a/src/org/apache/fop/layoutmgr/LayoutManager.java b/src/org/apache/fop/layoutmgr/LayoutManager.java index 078e11899..e7a3130e4 100644 --- a/src/org/apache/fop/layoutmgr/LayoutManager.java +++ b/src/org/apache/fop/layoutmgr/LayoutManager.java @@ -15,6 +15,7 @@ import org.apache.fop.area.Area; */ public interface LayoutManager { public void generateAreas(); + public boolean generatesInlineAreas(); public Area getParentArea (Area childArea); public void addChild (Area childArea); public boolean splitArea(Area areaToSplit, SplitContext context); diff --git a/src/org/apache/fop/layoutmgr/PageLayoutManager.java b/src/org/apache/fop/layoutmgr/PageLayoutManager.java index 0ca1a8fe0..9e7bb9642 100644 --- a/src/org/apache/fop/layoutmgr/PageLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/PageLayoutManager.java @@ -19,7 +19,6 @@ import org.apache.fop.fo.properties.Constants; public class PageLayoutManager extends AbstractLayoutManager implements Runnable{ - private PageSequence pageseq; /** True if haven't yet laid out any pages.*/ private boolean bFirstPage; /** Current page being worked on. */ @@ -136,7 +135,7 @@ public class PageLayoutManager extends AbstractLayoutManager private PageViewport makeNewPage(boolean bIsBlank, boolean bIsLast) { finishPage(); try { - curPage = pageseq.createPage(bIsBlank, bIsLast); + curPage = ((PageSequence)fobj).createPage(bIsBlank, bIsLast); } catch (FOPException fopex) { /* ???? */ } curBody = (BodyRegion) curPage.getPage(). getRegion(RegionReference.BODY).getRegion(); @@ -339,6 +338,8 @@ public class PageLayoutManager extends AbstractLayoutManager } // See finishPage... - protected void flush() {} + protected void flush() { + finishPage(); + } } -- 2.39.5