} 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();
/**
* 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);
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;
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
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());
}
}
/*
- * @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) {
}
/*
- * @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) {
}
}
- 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;
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;
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();
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) {