import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import org.apache.fop.traits.MinOptMax;
/**
* LayoutManager for a PageSequence.
private AreaTreeModel areaTreeModel;
/**
- * The collection of StaticContentLayoutManager objects that are associated
- * with this Page Sequence, keyed by flow-name.
+ * The single FlowLayoutManager object, which processes
+ * the single fo:flow of the fo:page-sequence
*/
- //private HashMap staticContentLMs = new HashMap(4);
-
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);
+
/**
* Constructor - activated by AreaTreeHandler for each
* fo:page-sequence in the input FO stream
return curPage;
}
+ /* 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)curPage.getSPM().getRegion(regionID);
if (reg == null) {
lm = (StaticContentLayoutManager)
areaTreeHandler.getLayoutManagerMaker().makeLayoutManager(sc);
lm.initialize();
- lm.setRegionReference(rv.getRegionReference());
+ lm.setTargetRegion(rv.getRegionReference());
lm.setParent(this);
/*
LayoutContext childLC = new LayoutContext(0);
childLC.setRefIPD(rv.getRegion().getIPD());
*/
- MinOptMax range = new MinOptMax(rv.getRegionReference().getIPD());
- lm.doLayout(reg, lm, range);
+ lm.doLayout(reg);
/*
while (!lm.isFinished()) {
* and filling them with block-level areas generated by its children.
*/
public class StaticContentLayoutManager extends BlockStackingLayoutManager {
-
- private RegionReference region;
+ private RegionReference targetRegion;
private List blockBreaks = new ArrayList();
public StaticContentLayoutManager(StaticContent node) {
* Sets the region reference
* @param region region reference
*/
- public void setRegionReference(RegionReference region) {
- this.region = region;
+ public void setTargetRegion(RegionReference targetRegion) {
+ this.targetRegion = targetRegion;
}
- /** @return the region reference */
- public RegionReference getRegionReference() {
- return this.region;
+ /**
+ * @return the region-reference-area that this
+ * static content is directed to.
+ */
+ public RegionReference getTargetRegion() {
+ return targetRegion;
}
/**
blockBreaks.clear();
*/
flush();
- region = null;
+ targetRegion = null;
}
* @see org.apache.fop.layoutmgr.LayoutManager#addChildArea(Area)
*/
public void addChildArea(Area childArea) {
- region.addBlock((Block)childArea);
+ targetRegion.addBlock((Block)childArea);
}
/**
* @see org.apache.fop.layoutmgr.LayoutManager#getParentArea(Area)
*/
public Area getParentArea(Area childArea) {
- return region;
+ return targetRegion;
}
- public void doLayout(SideRegion region, StaticContentLayoutManager lm, MinOptMax ipd) {
- StaticContentBreaker breaker = new StaticContentBreaker(region, lm, ipd);
- breaker.doLayout(lm.getRegionReference().getBPD());
+ public void doLayout(SideRegion region) {
+ MinOptMax range = new MinOptMax(targetRegion.getIPD());
+ StaticContentBreaker breaker = new StaticContentBreaker(region, this, range);
+ breaker.doLayout(targetRegion.getBPD());
if (breaker.isOverflow()) {
if (region.getOverflow() == EN_ERROR_IF_OVERFLOW) {
//TODO throw layout exception