/**
* The base class for all LayoutManagers.
*/
-public abstract class AbstractLayoutManager implements LayoutManager {
+public abstract class AbstractLayoutManager implements LayoutProcessor {
protected FOUserAgent userAgent;
- protected LayoutManager parentLM = null;
+ protected LayoutProcessor parentLM = null;
protected FObj fobj;
protected String foID = null;
protected Map markers = null;
/** True if this LayoutManager has handled all of its content. */
private boolean bFinished = false;
- protected LayoutManager curChildLM = null;
+ protected LayoutProcessor curChildLM = null;
protected ListIterator childLMiter;
protected boolean bInited = false;
return userAgent.getLogger();
}
- public void setParentLM(LayoutManager lm) {
+ public void setParent(LayoutProcessor lm) {
this.parentLM = lm;
}
* Note: child must implement LayoutManager! If it doesn't, skip it
* and print a warning.
*/
- protected LayoutManager getChildLM() {
+ protected LayoutProcessor getChildLM() {
if (curChildLM != null && !curChildLM.isFinished()) {
return curChildLM;
}
while (childLMiter.hasNext()) {
- curChildLM = (LayoutManager) childLMiter.next();
+ curChildLM = (LayoutProcessor) childLMiter.next();
curChildLM.setUserAgent(getUserAgent());
- curChildLM.setParentLM(this);
+ curChildLM.setParent(this);
curChildLM.init();
return curChildLM;
}
}
while (curChildLM != lm && childLMiter.hasPrevious()) {
curChildLM.resetPosition(null);
- curChildLM = (LayoutManager) childLMiter.previous();
+ curChildLM = (LayoutProcessor) childLMiter.previous();
}
// Otherwise next returns same object
childLMiter.next();
stackLimit = context.getStackLimit();
}
- LayoutManager curLM ; // currently active LM
+ LayoutProcessor curLM ; // currently active LM
MinOptMax stackSize = new MinOptMax();
// if starting add space before
public BreakPoss getAbsoluteBreakPoss(LayoutContext context) {
- LayoutManager curLM ; // currently active LM
+ LayoutProcessor curLM ; // currently active LM
MinOptMax stackSize = new MinOptMax();
addID();
addMarkers(true, true);
- LayoutManager childLM ;
+ LayoutProcessor childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
protected boolean preLoadNext() {
while (proxy.hasNext()) {
- LayoutManager lm = (LayoutManager) proxy.next();
- lm.setParentLM(BlockLayoutManager.this);
+ LayoutProcessor lm = (LayoutProcessor) proxy.next();
+ lm.setParent(BlockLayoutManager.this);
if(lm.generatesInlineAreas()) {
LineLayoutManager lineLM = createLineManager(lm);
listLMs.add(lineLM);
protected LineLayoutManager createLineManager(
LayoutManager firstlm) {
- LayoutManager lm;
+ LayoutProcessor lm;
List inlines = new ArrayList();
inlines.add(firstlm);
while (proxy.hasNext()) {
- lm = (LayoutManager) proxy.next();
- lm.setParentLM(BlockLayoutManager.this);
+ lm = (LayoutProcessor) proxy.next();
+ lm.setParent(BlockLayoutManager.this);
if (lm.generatesInlineAreas()) {
inlines.add(lm);
} else {
}
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM; // currently active LM
+ LayoutProcessor curLM; // currently active LM
int ipd = context.getRefIPD();
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
addID();
addMarkers(true, true);
- LayoutManager childLM ;
+ LayoutProcessor childLM;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
LeafPosition lfp = (LeafPosition) parentIter.next();
* Reference to FO whose areas it's managing or to the traits
* of the FO.
*/
- protected LayoutManager curChildLM = null;
+ protected LayoutProcessor curChildLM = null;
protected BlockParent parentArea = null;
public BlockStackingLayoutManager() {
/**
* The top-level layout manager responsible for this break
*/
- public LayoutManager getLayoutManager() {
+ public LayoutProcessor getLayoutManager() {
return m_position.getLM();
}
return (BreakPoss) peekNext();
}
- protected LayoutManager getLM(Object nextObj) {
+ protected LayoutProcessor getLM(Object nextObj) {
return ((BreakPoss) nextObj).getLayoutManager();
}
* For use with objects that contain inline areas such as
* leader use-content and title.
*/
-public class ContentLayoutManager implements LayoutManager {
+public class ContentLayoutManager implements LayoutProcessor {
private FOUserAgent userAgent;
private Area holder;
private int stackSize;
- private LayoutManager parentLM;
+ private LayoutProcessor parentLM;
/**
* Constructs a new ContentLayoutManager
public void setFObj(FObj fo) {
}
- public void fillArea(LayoutManager curLM) {
+ public void fillArea(LayoutProcessor curLM) {
List childBreaks = new ArrayList();
MinOptMax stack = new MinOptMax();
}
/** @see org.apache.fop.layoutmgr.LayoutManager */
- public void setParentLM(LayoutManager lm) {
+ public void setParent(LayoutProcessor lm) {
parentLM = lm;
}
public BreakPoss getNextBreakPoss(LayoutContext context) {
// currently active LM
- LayoutManager curLM;
+ LayoutProcessor curLM;
MinOptMax stackSize = new MinOptMax();
while ((curLM = getChildLM()) != null) {
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
- LayoutManager childLM;
+ LayoutProcessor childLM;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
LeafPosition lfp = (LeafPosition) parentIter.next();
super(parentIter);
}
- protected LayoutManager getLM(Object nextObj) {
+ protected LayoutProcessor getLM(Object nextObj) {
return ((Position) nextObj).getPosition().getLM();
}
hasLeadingFence(false)) {
return true;
}
- LayoutManager lm = getChildLM();
+ LayoutProcessor lm = getChildLM();
if (lm != null) {
return lm.canBreakBefore(context);
} else {
public BreakPoss getNextBreakPoss(LayoutContext lc) {
// Get a break from currently active child LM
BreakPoss bp = null;
- LayoutManager curLM ;
+ LayoutProcessor curLM;
SpaceSpecifier leadingSpace = lc.getLeadingSpace();
if (lc.startsNewArea()) {
// posIter iterates over positions returned by this LM
StackingIter childPosIter = new StackingIter(parentIter);
- LayoutManager prevLM = null;
- LayoutManager childLM ;
+ LayoutProcessor prevLM = null;
+ LayoutProcessor childLM ;
while ((childLM = childPosIter.getNextChildLM()) != null) {
//getContext().setTrailingSpace(new SpaceSpecifier(false));
childLM.addAreas(childPosIter, getContext());
import org.apache.fop.fo.FOUserAgent;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.flow.Marker;
-
-import org.apache.fop.area.Area;
-import org.apache.fop.area.Resolveable;
-import org.apache.fop.area.PageViewport;
-
-import java.util.Map;
-
/**
* The interface for all LayoutManagers.
*/
*/
public FOUserAgent getUserAgent();
- /**
- * Set the parent layout manager.
- * The parent layout manager is required for adding areas.
- *
- * @param lm the parent layout manager
- */
- public void setParentLM(LayoutManager lm);
-
- /**
- * Initialise this layout manager.
- */
- public void init();
-
- /**
- * Generates inline areas.
- * This is used to check if the layout manager generates inline
- * areas.
- *
- * @return true if the layout manager generates inline areas
- */
- public boolean generatesInlineAreas();
-
- /**
- * Return true if the next area which would be generated by this
- * LayoutManager could start a new line (or flow for block-level FO).
- *
- * @param lc the layout context
- * @return true if can break before
- */
- public boolean canBreakBefore(LayoutContext lc);
-
- /**
- * Generate and return the next break possibility.
- *
- * @param context The layout context contains information about pending
- * space specifiers from ancestor areas or previous areas, reference
- * area inline-progression-dimension and various other layout-related
- * information.
- * @return the next break position
- */
- public BreakPoss getNextBreakPoss(LayoutContext context);
-
- /**
- * Reset to the position.
- *
- * @param position
- */
- public void resetPosition(Position position);
-
- /**
- * Get the word chars between two positions and
- * append to the string buffer. The positions could
- * span multiple layout managers.
- *
- * @param sbChars the string buffer to append the word chars
- * @param bp1 the start position
- * @param bp2 the end position
- */
- public void getWordChars(StringBuffer sbChars, Position bp1,
- Position bp2);
-
- /**
- * Return a value indicating whether this LayoutManager has laid out
- * all its content (or generated BreakPossibilities for all content.)
- *
- * @return true if this layout manager is finished
- */
- public boolean isFinished();
-
- /**
- * Set a flag indicating whether the LayoutManager has laid out all
- * its content. This is generally called by the LM itself, but can
- * be called by a parentLM when backtracking.
- *
- * @param isFinished the value to set the finished flag to
- */
- public void setFinished(boolean isFinished);
-
- /**
- * Get the parent area for an area.
- * This should get the parent depending on the class of the
- * area passed in.
- *
- * @param childArea the child area to get the parent for
- * @return the parent Area
- */
- public Area getParentArea(Area childArea);
-
- /**
- * Add the area as a child of the current area.
- * This is called by child layout managers to add their
- * areas as children of the current area.
- *
- * @param childArea the child area to add
- */
- public void addChild(Area childArea);
-
- /**
- * Tell the layout manager to add all the child areas implied
- * by Position objects which will be returned by the
- * Iterator.
- *
- * @param posIter the position iterator
- * @param context the context
- */
- public void addAreas(PositionIterator posIter, LayoutContext context);
-
- /**
- * Get the string of the current page number.
- *
- * @return the string for the current page number
- */
- public String getCurrentPageNumber();
-
- /**
- * Resolve the id reference.
- * This is called by an area looking for an id reference.
- * If the id reference is not found then it should add a resolveable object.
- *
- * @param ref the id reference
- * @return the page containing the id reference or null if not found
- */
- public PageViewport resolveRefID(String ref);
-
- /**
- * Add an id to the page.
- * @todo add the location of the area on the page
- *
- * @param id the id reference to add.
- */
- public void addIDToPage(String id);
-
- /**
- * Add an unresolved area.
- * The is used to add a resolveable object to the page for a given id.
- *
- * @param id the id reference this object needs for resolving
- * @param res the resolveable object
- */
- public void addUnresolvedArea(String id, Resolveable res);
-
- /**
- * Add the marker.
- * A number of formatting objects may contain markers. This
- * method is used to add those markers to the page.
- *
- * @param name the marker class name
- * @param start true if the formatting object is starting false is finishing
- * @param isfirst a flag for is first
- */
- public void addMarkerMap(Map marks, boolean start, boolean isfirst);
-
- /**
- * Retrieve a marker.
- * This method is used when retrieve a marker.
- *
- * @param name the class name of the marker
- * @param pos the retrieve position
- * @param boundary the boundary for retrieving the marker
- * @return the layout manaager of the retrieved marker if any
- */
- public Marker retrieveMarker(String name, int pos, int boundary);
}
--- /dev/null
+/*
+ * $Id$
+ * Copyright (C) 2003 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
+ */
+
+package org.apache.fop.layoutmgr;
+
+import org.apache.fop.fo.flow.Marker;
+
+import org.apache.fop.area.Area;
+import org.apache.fop.area.Resolveable;
+import org.apache.fop.area.PageViewport;
+
+import java.util.Map;
+
+/**
+ * The interface for all LayoutProcessors.
+ * This interface is used by the layout implementation to
+ * do the layout and add the areas.
+ */
+public interface LayoutProcessor extends LayoutManager {
+
+ /**
+ * Set the parent layout manager.
+ * The parent layout manager is required for adding areas.
+ *
+ * @param lm the parent layout manager
+ */
+ public void setParent(LayoutProcessor lm);
+
+ /**
+ * Initialise this layout manager.
+ */
+ public void init();
+
+ /**
+ * Generates inline areas.
+ * This is used to check if the layout manager generates inline
+ * areas.
+ *
+ * @return true if the layout manager generates inline areas
+ */
+ public boolean generatesInlineAreas();
+
+ /**
+ * Return true if the next area which would be generated by this
+ * LayoutManager could start a new line (or flow for block-level FO).
+ *
+ * @param lc the layout context
+ * @return true if can break before
+ */
+ public boolean canBreakBefore(LayoutContext lc);
+
+ /**
+ * Generate and return the next break possibility.
+ *
+ * @param context The layout context contains information about pending
+ * space specifiers from ancestor areas or previous areas, reference
+ * area inline-progression-dimension and various other layout-related
+ * information.
+ * @return the next break position
+ */
+ public BreakPoss getNextBreakPoss(LayoutContext context);
+
+ /**
+ * Reset to the position.
+ *
+ * @param position
+ */
+ public void resetPosition(Position position);
+
+ /**
+ * Get the word chars between two positions and
+ * append to the string buffer. The positions could
+ * span multiple layout managers.
+ *
+ * @param sbChars the string buffer to append the word chars
+ * @param bp1 the start position
+ * @param bp2 the end position
+ */
+ public void getWordChars(StringBuffer sbChars, Position bp1,
+ Position bp2);
+
+ /**
+ * Return a value indicating whether this LayoutManager has laid out
+ * all its content (or generated BreakPossibilities for all content.)
+ *
+ * @return true if this layout manager is finished
+ */
+ public boolean isFinished();
+
+ /**
+ * Set a flag indicating whether the LayoutManager has laid out all
+ * its content. This is generally called by the LM itself, but can
+ * be called by a parentLM when backtracking.
+ *
+ * @param isFinished the value to set the finished flag to
+ */
+ public void setFinished(boolean isFinished);
+
+ /**
+ * Get the parent area for an area.
+ * This should get the parent depending on the class of the
+ * area passed in.
+ *
+ * @param childArea the child area to get the parent for
+ * @return the parent Area
+ */
+ public Area getParentArea(Area childArea);
+
+ /**
+ * Add the area as a child of the current area.
+ * This is called by child layout managers to add their
+ * areas as children of the current area.
+ *
+ * @param childArea the child area to add
+ */
+ public void addChild(Area childArea);
+
+ /**
+ * Tell the layout manager to add all the child areas implied
+ * by Position objects which will be returned by the
+ * Iterator.
+ *
+ * @param posIter the position iterator
+ * @param context the context
+ */
+ public void addAreas(PositionIterator posIter, LayoutContext context);
+
+ /**
+ * Get the string of the current page number.
+ *
+ * @return the string for the current page number
+ */
+ public String getCurrentPageNumber();
+
+ /**
+ * Resolve the id reference.
+ * This is called by an area looking for an id reference.
+ * If the id reference is not found then it should add a resolveable object.
+ *
+ * @param ref the id reference
+ * @return the page containing the id reference or null if not found
+ */
+ public PageViewport resolveRefID(String ref);
+
+ /**
+ * Add an id to the page.
+ * @todo add the location of the area on the page
+ *
+ * @param id the id reference to add.
+ */
+ public void addIDToPage(String id);
+
+ /**
+ * Add an unresolved area.
+ * The is used to add a resolveable object to the page for a given id.
+ *
+ * @param id the id reference this object needs for resolving
+ * @param res the resolveable object
+ */
+ public void addUnresolvedArea(String id, Resolveable res);
+
+ /**
+ * Add the marker.
+ * A number of formatting objects may contain markers. This
+ * method is used to add those markers to the page.
+ *
+ * @param name the marker class name
+ * @param start true if the formatting object is starting false is finishing
+ * @param isfirst a flag for is first
+ */
+ public void addMarkerMap(Map marks, boolean start, boolean isfirst);
+
+ /**
+ * Retrieve a marker.
+ * This method is used when retrieve a marker.
+ *
+ * @param name the class name of the marker
+ * @param pos the retrieve position
+ * @param boundary the boundary for retrieving the marker
+ * @return the layout manaager of the retrieved marker if any
+ */
+ public Marker retrieveMarker(String name, int pos, int boundary);
+
+}
+
private int iLeafPos;
- public LeafPosition(LayoutManager lm, int pos) {
+ public LeafPosition(LayoutProcessor lm, int pos) {
super(lm);
iLeafPos = pos;
}
int lineHeight;
int baseline;
- LineBreakPosition(LayoutManager lm, int iBreakIndex,
+ LineBreakPosition(LayoutProcessor lm, int iBreakIndex,
double ipdA, double adjust, int ind, int lh, int bl) {
super(lm, iBreakIndex);
// iPos = iBreakIndex;
// Get a break from currently active child LM
// Set up constraints for inline level managers
- LayoutManager curLM ; // currently active LM
+ LayoutProcessor curLM ; // currently active LM
BreakPoss prev = null;
BreakPoss bp = null; // proposed BreakPoss
// See if could break before next area
// TODO: do we need to set anything on the layout context?
LayoutContext lc = new LayoutContext(0);
- LayoutManager nextLM = getChildLM();
+ LayoutProcessor nextLM = getChildLM();
return (nextLM == null || nextLM.canBreakBefore(lc));
}
}
* @param dSpaceAdjust the space adjustment
*/
public void addAreas(PositionIterator parentIter, double dSpaceAdjust) {
- LayoutManager childLM;
+ LayoutProcessor childLM;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
LineBreakPosition lbp = (LineBreakPosition) parentIter.next();
private Position subPos;
- public NonLeafPosition(LayoutManager lm, Position sub) {
+ public NonLeafPosition(LayoutProcessor lm, Position sub) {
super(lm);
subPos = sub;
}
private static class BlockBreakPosition extends LeafPosition {
protected BreakPoss breakps;
- protected BlockBreakPosition(LayoutManager lm, BreakPoss bp) {
+ protected BlockBreakPosition(LayoutProcessor lm, BreakPoss bp) {
super(lm, 0);
breakps = bp;
}
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM ; // currently active LM
+ LayoutProcessor curLM ; // currently active LM
while ((curLM = getChildLM()) != null) {
BreakPoss bp = null;
lm.setUserAgent(getUserAgent());
lm.init();
lm.setRegionReference(reg.getRegion());
- lm.setParentLM(this);
+ lm.setParent(this);
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimit(new MinOptMax((int)curPage.getViewArea().getHeight()));
childLC.setRefIPD((int)reg.getViewArea().getWidth());
package org.apache.fop.layoutmgr;
public class Position {
- private LayoutManager layoutManager;
+ private LayoutProcessor layoutManager;
- public Position(LayoutManager lm) {
+ public Position(LayoutProcessor lm) {
layoutManager = lm;
}
- public LayoutManager getLM() {
+ public LayoutProcessor getLM() {
return layoutManager;
}
public abstract class PositionIterator implements Iterator {
Iterator parentIter;
Object nextObj;
- LayoutManager childLM;
+ LayoutProcessor childLM;
boolean bHasNext;
PositionIterator(Iterator pIter) {
//checkNext();
}
- public LayoutManager getNextChildLM() {
+ public LayoutProcessor getNextChildLM() {
// Move to next "segment" of iterator, ie: new childLM
if (childLM == null && nextObj != null) {
childLM = getLM(nextObj);
return childLM;
}
- protected abstract LayoutManager getLM(Object nextObj);
+ protected abstract LayoutProcessor getLM(Object nextObj);
protected abstract Position getPos(Object nextObj);
}
protected boolean checkNext() {
- LayoutManager lm = getLM(nextObj);
+ LayoutProcessor lm = getLM(nextObj);
if (childLM == null) {
childLM = lm;
} else if (childLM != lm) {
* LayoutManager for a block FO.
*/
public class RetrieveMarkerLayoutManager extends AbstractLayoutManager {
- private LayoutManager replaceLM = null;
+ private LayoutProcessor replaceLM = null;
private boolean loaded = false;
private String name;
private int position;
if (marker != null) {
marker.addLayoutManager(list);
if (list.size() > 0) {
- replaceLM = (LayoutManager)list.get(0);
- replaceLM.setParentLM(this);
+ replaceLM = (LayoutProcessor)list.get(0);
+ replaceLM.setParent(this);
replaceLM.init();
getLogger().debug("retrieved: " + replaceLM + ":" + list.size());
} else {
reset(null);
}
if (replaceLM != null) {
- replaceLM.resetPosition(resetPos);
+ replaceLM.resetPosition(null);
}
loaded = false;
replaceLM = null;
public BreakPoss getNextBreakPoss(LayoutContext context) {
// currently active LM
- LayoutManager curLM;
+ LayoutProcessor curLM;
while ((curLM = getChildLM()) != null) {
// Make break positions and return page break
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
- LayoutManager childLM;
+ LayoutProcessor childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
* @return the next break possibility
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM; // currently active LM
+ LayoutProcessor curLM; // currently active LM
MinOptMax stackSize = new MinOptMax();
// if starting add space before
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
getParentArea(null);
addID();
- LayoutManager childLM;
+ LayoutProcessor childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
private class SectionPosition extends LeafPosition {
protected List list;
- protected SectionPosition(LayoutManager lm, int pos, List l) {
+ protected SectionPosition(LayoutProcessor lm, int pos, List l) {
super(lm, pos);
list = l;
}
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
// currently active LM
- LayoutManager curLM;
+ LayoutProcessor curLM;
MinOptMax stackSize = new MinOptMax();
// if starting add space before
// stackSize.add(spaceBefore);
BreakPoss lastPos = null;
- while ((curLM = (LayoutManager)getChildLM()) != null) {
+ while ((curLM = (LayoutProcessor)getChildLM()) != null) {
// Make break positions
// Set up a LayoutContext
int ipd = context.getRefIPD();
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
int listHeight = 0;
- LayoutManager childLM;
+ LayoutProcessor childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
new BreakPossPosIter(bodyBreaks, iStartPos,
lfp.getLeafPos() + 1);
iStartPos = lfp.getLeafPos() + 1;
- while ((childLM = (LayoutManager)breakPosIter.getNextChildLM()) != null) {
+ while ((childLM = (LayoutProcessor)breakPosIter.getNextChildLM()) != null) {
childLM.addAreas(breakPosIter, lc);
}
}
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
private class ItemPosition extends LeafPosition {
protected List cellBreaks;
- protected ItemPosition(LayoutManager lm, int pos, List l) {
+ protected ItemPosition(LayoutProcessor lm, int pos, List l) {
super(lm, pos);
cellBreaks = l;
}
public void setLabel(Item item) {
label = item;
- label.setParentLM(this);
+ label.setParent(this);
}
public void setBody(Item item) {
body = item;
- body.setParentLM(this);
+ body.setParent(this);
}
/**
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
package org.apache.fop.layoutmgr.table;
import org.apache.fop.fo.PropertyManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
package org.apache.fop.layoutmgr.table;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
* @return the next break possibility
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM; // currently active LM
+ LayoutProcessor curLM; // currently active LM
MinOptMax stackSize = new MinOptMax();
// if starting add space before
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
getParentArea(null);
addID();
- LayoutManager childLM;
+ LayoutProcessor childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
* @return the next break possibility
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM; // currently active LM
+ LayoutProcessor curLM; // currently active LM
MinOptMax stackSize = new MinOptMax();
// if starting add space before
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
getParentArea(null);
addID();
- LayoutManager childLM;
+ LayoutProcessor childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
private class RowPosition extends LeafPosition {
protected List cellBreaks;
- protected RowPosition(LayoutManager lm, int pos, List l) {
+ protected RowPosition(LayoutProcessor lm, int pos, List l) {
super(lm, pos);
cellBreaks = l;
}
cellList = new ArrayList();
// add cells to list
while (childLMiter.hasNext()) {
- curChildLM = (LayoutManager) childLMiter.next();
+ curChildLM = (LayoutProcessor) childLMiter.next();
curChildLM.setUserAgent(getUserAgent());
- curChildLM.setParentLM(this);
+ curChildLM.setParent(this);
curChildLM.init();
cellList.add(curChildLM);
}
* @return the next break possibility
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM; // currently active LM
+ LayoutProcessor curLM; // currently active LM
BreakPoss lastPos = null;
List breakList = new ArrayList();
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
* If pos is null, then back up to the first child LM.
*/
protected void reset(Position pos) {
- LayoutManager curLM; // currently active LM
+ LayoutProcessor curLM; // currently active LM
int cellcount = 0;
if (pos == null) {
package org.apache.fop.layoutmgr.table;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
* @return the next break possibility
*/
public BreakPoss getNextBreakPoss(LayoutContext context) {
- LayoutManager curLM; // currently active LM
+ LayoutProcessor curLM; // currently active LM
MinOptMax stackSize = new MinOptMax();
// if starting add space before
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);
getParentArea(null);
addID();
- LayoutManager childLM;
+ LayoutProcessor childLM;
int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.layoutmgr.BlockStackingLayoutManager;
-import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.BreakPoss;
import org.apache.fop.layoutmgr.LayoutContext;
private class SectionPosition extends LeafPosition {
protected List list;
- protected SectionPosition(LayoutManager lm, int pos, List l) {
+ protected SectionPosition(LayoutProcessor lm, int pos, List l) {
super(lm, pos);
list = l;
}
*/
public void setTableHeader(Body th) {
tableHeader = th;
- tableHeader.setParentLM(this);
+ tableHeader.setParent(this);
}
/**
*/
public void setTableFooter(Body tf) {
tableFooter = tf;
- tableFooter.setParentLM(this);
+ tableFooter.setParent(this);
}
/**
if (stackSize.opt + bp.getStackingSize().opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
- LayoutManager lm = lastPos.getLayoutManager();
+ LayoutProcessor lm = lastPos.getLayoutManager();
lm.resetPosition(lastPos.getPosition());
if (lm != curLM) {
curLM.resetPosition(null);