also setting of Reference Area dimensions moved to FLM. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198713 13f79535-47bb-0310-9956-ffa450edef68tags/fop-0_90-alpha1
@@ -200,7 +200,6 @@ public class PageSequence extends FObj { | |||
} else if (childId == FO_FLOW) { | |||
this.mainFlow = (Flow) child; | |||
addFlow(mainFlow); | |||
super.addChildNode(child); // For getChildren | |||
} else if (childId == FO_STATIC_CONTENT) { | |||
addFlow((StaticContent) child); | |||
String flowName = ((StaticContent) child).getFlowName(); |
@@ -50,16 +50,23 @@ public class FlowLayoutManager extends BlockStackingLayoutManager | |||
/** | |||
* This is the top level layout manager. | |||
* It is created by the PageSequence FO. | |||
* @param pslm parent PageSequenceLayoutManager object | |||
* @param node Flow object | |||
*/ | |||
public FlowLayoutManager(Flow node) { | |||
public FlowLayoutManager(PageSequenceLayoutManager pslm, Flow node) { | |||
super(node); | |||
fobj = node; | |||
setParent(pslm); | |||
} | |||
/** @see org.apache.fop.layoutmgr.LayoutManager */ | |||
public LinkedList getNextKnuthElements(LayoutContext context, int alignment) { | |||
// set layout dimensions | |||
int flowIPD = getCurrentPV().getCurrentSpan().getColumnWidth(); | |||
int flowBPD = (int) getCurrentPV().getBodyRegion().getBPD(); | |||
fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, flowIPD); | |||
fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, flowBPD); | |||
fobj.setLayoutDimension(PercentBase.BLOCK_IPD, context.getRefIPD()); | |||
fobj.setLayoutDimension(PercentBase.BLOCK_BPD, context.getStackLimit().opt); | |||
@@ -19,6 +19,7 @@ package org.apache.fop.layoutmgr; | |||
import java.util.List; | |||
import org.apache.fop.fo.FONode; | |||
import org.apache.fop.fo.pagination.Flow; | |||
import org.apache.fop.fo.pagination.PageSequence; | |||
import org.apache.fop.fo.pagination.SideRegion; | |||
import org.apache.fop.fo.pagination.StaticContent; | |||
@@ -57,6 +58,15 @@ public interface LayoutManagerMaker { | |||
public PageSequenceLayoutManager makePageSequenceLayoutManager( | |||
AreaTreeHandler ath, PageSequence ps); | |||
/** | |||
* Make a FlowLayoutManager object. | |||
* @param pslm the parent PageSequenceLayoutManager object | |||
* @param flow the fo:flow object this FLM will process | |||
* @return The created FlowLayoutManager object | |||
*/ | |||
public FlowLayoutManager makeFlowLayoutManager( | |||
PageSequenceLayoutManager pslm, Flow flow); | |||
/** | |||
* Make a StaticContentLayoutManager object. | |||
* @param pslm the parent PageSequenceLayoutManager object |
@@ -114,7 +114,6 @@ public class LayoutManagerMapping implements LayoutManagerMaker { | |||
makers.put(TableCell.class, new Maker()); | |||
makers.put(TableFooter.class, new Maker()); | |||
makers.put(TableHeader.class, new Maker()); | |||
makers.put(Flow.class, new FlowLayoutManagerMaker()); | |||
makers.put(Wrapper.class, new WrapperLayoutManagerMaker()); | |||
makers.put(Title.class, new InlineLayoutManagerMaker()); | |||
} | |||
@@ -155,7 +154,15 @@ public class LayoutManagerMapping implements LayoutManagerMaker { | |||
} | |||
/* | |||
* @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(org.apache.fop.layoutmgr.PageSequenceLayoutManager, org.apache.fop.fo.pagination.StaticContent, org.apache.fop.fo.pagination.Region) | |||
* @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeFlowLayoutManager(PageSequenceLayoutManager, Flow) | |||
*/ | |||
public FlowLayoutManager makeFlowLayoutManager( | |||
PageSequenceLayoutManager pslm, Flow flow) { | |||
return new FlowLayoutManager(pslm, flow); | |||
} | |||
/* | |||
* @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(PageSequenceLayoutManager, StaticContent, Region) | |||
*/ | |||
public StaticContentLayoutManager makeStaticContentLayoutManager( | |||
PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg) { | |||
@@ -163,7 +170,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker { | |||
} | |||
/* | |||
* @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(org.apache.fop.layoutmgr.PageSequenceLayoutManager, org.apache.fop.fo.pagination.StaticContent, org.apache.fop.area.Block) | |||
* @see org.apache.fop.layoutmgr.LayoutManagerMaker#makeStaticContentLayoutManager(PageSequenceLayoutManager, StaticContent, Block) | |||
*/ | |||
public StaticContentLayoutManager makeStaticContentLayoutManager( | |||
PageSequenceLayoutManager pslm, StaticContent sc, org.apache.fop.area.Block block) { | |||
@@ -323,12 +330,6 @@ public class LayoutManagerMapping implements LayoutManagerMaker { | |||
} | |||
} | |||
public static class FlowLayoutManagerMaker extends Maker { | |||
public void make(FONode node, List lms) { | |||
lms.add(new FlowLayoutManager((Flow) node)); | |||
} | |||
} | |||
public class WrapperLayoutManagerMaker extends Maker { | |||
public void make(FONode node, List lms) { | |||
Iterator baseIter; |
@@ -28,8 +28,6 @@ import org.apache.fop.area.PageViewport; | |||
import org.apache.fop.area.LineArea; | |||
import org.apache.fop.area.Resolvable; | |||
import org.apache.fop.datatypes.PercentBase; | |||
import org.apache.fop.fo.Constants; | |||
import org.apache.fop.fo.flow.Marker; | |||
import org.apache.fop.fo.flow.RetrieveMarker; | |||
@@ -131,9 +129,8 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { | |||
curPV = makeNewPage(false, true, false); | |||
Flow mainFlow = pageSeq.getMainFlow(); | |||
childFLM = (FlowLayoutManager) | |||
getLayoutManagerMaker().makeLayoutManager(mainFlow); | |||
childFLM.setParent(this); | |||
childFLM = getLayoutManagerMaker(). | |||
makeFlowLayoutManager(this, mainFlow); | |||
PageBreaker breaker = new PageBreaker(this); | |||
int flowBPD = (int) curPV.getBodyRegion().getBPD(); | |||
@@ -325,11 +322,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { | |||
LayoutContext childLC = new LayoutContext(0); | |||
childLC.setStackLimit(context.getStackLimit()); | |||
childLC.setRefIPD(context.getRefIPD()); | |||
int flowIPD = curPV.getCurrentSpan().getColumnWidth(); | |||
int flowBPD = (int) curPV.getBodyRegion().getBPD(); | |||
pageSeq.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, flowIPD); | |||
pageSeq.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, flowBPD); | |||
returnedList = childFLM.getNextKnuthElements(childLC, alignment); | |||
if (returnedList != null) { |