aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/layoutmgr/PageLayoutManager.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-08-18 13:47:13 +0000
committerKeiron Liddle <keiron@apache.org>2002-08-18 13:47:13 +0000
commit3911eb8fe4211a982e05928856caf0e46531d854 (patch)
tree3aaa0c5dc4a802acb61bf514e31df8ee417f7a3e /src/org/apache/fop/layoutmgr/PageLayoutManager.java
parent3fcefdeb4be4b7b1d204c3e9d936b0d140276e83 (diff)
downloadxmlgraphics-fop-3911eb8fe4211a982e05928856caf0e46531d854.tar.gz
xmlgraphics-fop-3911eb8fe4211a982e05928856caf0e46531d854.zip
improved block layout, adds areas to correct parent
properly resets git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195092 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/layoutmgr/PageLayoutManager.java')
-rw-r--r--src/org/apache/fop/layoutmgr/PageLayoutManager.java42
1 files changed, 20 insertions, 22 deletions
diff --git a/src/org/apache/fop/layoutmgr/PageLayoutManager.java b/src/org/apache/fop/layoutmgr/PageLayoutManager.java
index 822a40ada..4bb7c1f60 100644
--- a/src/org/apache/fop/layoutmgr/PageLayoutManager.java
+++ b/src/org/apache/fop/layoutmgr/PageLayoutManager.java
@@ -25,11 +25,11 @@ import java.util.List;
public class PageLayoutManager extends AbstractBPLayoutManager implements Runnable {
private static class BlockBreakPosition extends LeafPosition {
- List blockps;
+ BreakPoss breakps;
- BlockBreakPosition(BPLayoutManager lm, int iBreakIndex, List bps) {
- super(lm, iBreakIndex);
- blockps = bps;
+ BlockBreakPosition(BPLayoutManager lm, BreakPoss bp) {
+ super(lm, 0);
+ breakps = bp;
}
}
@@ -51,6 +51,7 @@ public class PageLayoutManager extends AbstractBPLayoutManager implements Runnab
private Flow curFlow;
private int flowBPD = 0;
+ private int flowIPD = 0;
/** Manager which handles a queue of all pages which are completely
* laid out and ready for rendering, except for resolution of ID
@@ -86,16 +87,17 @@ public class PageLayoutManager extends AbstractBPLayoutManager implements Runnab
public void doLayout() {
+ // this should be done another way
makeNewPage(false, false);
+ createBodyMainReferenceArea();
+ createSpan(1);
+ flowIPD = curFlow.getIPD();
BreakPoss bp;
LayoutContext childLC = new LayoutContext(0);
while (!isFinished()) {
- ArrayList vecBreakPoss = new ArrayList();
if ((bp = getNextBreakPoss(childLC, null)) != null) {
- vecBreakPoss.add(bp);
- addAreas( new BreakPossPosIter(vecBreakPoss, 0,
- vecBreakPoss.size()), null);
+ addAreas((BlockBreakPosition)bp.getPosition());
// add static areas and resolve any new id areas
// finish page and add to area tree
@@ -112,33 +114,29 @@ public class PageLayoutManager extends AbstractBPLayoutManager implements Runnab
BPLayoutManager curLM ; // currently active LM
while ((curLM = getChildLM()) != null) {
- ArrayList vecBreakPoss = new ArrayList();
+ BreakPoss bp = null;
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimit(new MinOptMax(flowBPD));
+ childLC.setRefIPD(flowIPD);
if (!curLM.isFinished()) {
- BreakPoss bp;
- if ((bp = curLM.getNextBreakPoss(childLC, null)) != null) {
- vecBreakPoss.add(bp);
- }
+ bp = curLM.getNextBreakPoss(childLC, null);
}
- if(vecBreakPoss.size() > 0) {
+ if(bp != null) {
return new BreakPoss(
- new BlockBreakPosition(curLM, 0, vecBreakPoss));
+ new BlockBreakPosition(curLM, bp));
}
}
setFinished(true);
return null;
}
- public void addAreas(PositionIterator parentIter, LayoutContext lc) {
-
- while (parentIter.hasNext()) {
- BlockBreakPosition bbp = (BlockBreakPosition) parentIter.next();
- bbp.getLM().addAreas( new BreakPossPosIter(bbp.blockps, 0,
- bbp.blockps.size()), null);
- }
+ public void addAreas(BlockBreakPosition bbp) {
+ List list = new ArrayList();
+ list.add(bbp.breakps);
+ bbp.getLM().addAreas( new BreakPossPosIter(list, 0,
+ 1), null);
}
/**