super(node);
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager#initialize() */
public void initialize() {
abProps = getBlockContainerFO().getCommonAbsolutePosition();
foBlockSpaceBefore = new SpaceVal(getBlockContainerFO().getCommonMarginBlock()
contentRectOffsetX += getBlockContainerFO()
.getCommonMarginBlock().startIndent.getValue(this);
double contentRectOffsetY = offset.getY();
- contentRectOffsetY += getSpaceBefore();
+ contentRectOffsetY += getSpaceBefore(); //TODO Uhm, is that necessary?
contentRectOffsetY += getBlockContainerFO()
.getCommonBorderPaddingBackground().getBorderBeforeWidth(false);
contentRectOffsetY += getBlockContainerFO()
return new Point(x, y);
}
- /**
- * @see org.apache.fop.layoutmgr.LayoutManager#addAreas(org.apache.fop.layoutmgr.PositionIterator, org.apache.fop.layoutmgr.LayoutContext)
- */
+ /** @see org.apache.fop.layoutmgr.LayoutManager */
public void addAreas(PositionIterator parentIter,
LayoutContext layoutContext) {
getParentArea(null);
//}
}
- // if adjusted space before
-// if (bSpaceBefore) {
-// addBlockSpacing(0, new MinOptMax(adjustedSpaceBefore));
-// }
- //addBlockSpacing(0, effSpaceBefore);
-
while ((childLM = childPosIter.getNextChildLM()) != null) {
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
childLM.addAreas(childPosIter, lc);
}
} else {
- // if adjusted space before
-// if (bSpaceBefore) {
-// addBlockSpacing(0, new MinOptMax(adjustedSpaceBefore));
-// }
- //addBlockSpacing(0, effSpaceBefore);
//Add child areas inside the reference area
bcpos.getBreaker().addContainedAreas();
}
- //int bIndents = getBlockContainerFO().getCommonBorderPaddingBackground()
- // .getBPPaddingAndBorder(false);
-
if (markers != null) {
getCurrentPV().addMarkers(markers, false, isFirst(firstPos), isLast(lastPos));
}
effSpaceBefore, effSpaceAfter);
flush();
- // if adjusted space after
-// if (bSpaceAfter) {
-// addBlockSpacing(0, new MinOptMax(adjustedSpaceAfter));
-// }
- //addBlockSpacing(0, effSpaceAfter);
-
viewportBlockArea = null;
referenceArea = null;
resetSpaces();
}
}
- /**
- * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#negotiateBPDAdjustment(int, org.apache.fop.layoutmgr.KnuthElement)
- */
+ /** @see org.apache.fop.layoutmgr.BlockLevelLayoutManager */
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
// TODO Auto-generated method stub
return 0;
}
- /**
- * @see org.apache.fop.layoutmgr.BlockLevelLayoutManager#discardSpace(org.apache.fop.layoutmgr.KnuthGlue)
- */
+ /** @see org.apache.fop.layoutmgr.BlockLevelLayoutManager */
public void discardSpace(KnuthGlue spaceGlue) {
// TODO Auto-generated method stub
}
getPSLM().addIDToPage(getBlockFO().getId());
- /* TODO remove when markers are really ok
- log.debug("Checking on " + this);
- log.debug("Checking first=" + firstPos);
- log.debug("Checking last=" + lastPos);
- log.debug("->" + isFirst(firstPos) + "/" + isLast(lastPos));
- */
if (markers != null) {
getCurrentPV().addMarkers(markers, true, isFirst(firstPos), isLast(lastPos));
}
//}
}
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, foSpaceBefore);
- //addBlockSpacing(adjust, effSpaceBefore);
- foSpaceBefore = null;
- //if (bSpaceBefore) {
- // addBlockSpacing(0, new MinOptMax(adjustedSpaceBefore));
- //}
-
while ((childLM = childPosIter.getNextChildLM()) != null) {
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
childLM.addAreas(childPosIter, lc);
}
- //int bIndents = getBlockFO().getCommonBorderPaddingBackground()
- // .getBPPaddingAndBorder(false);
-
if (markers != null) {
getCurrentPV().addMarkers(markers, false, isFirst(firstPos), isLast(lastPos));
}
effSpaceBefore, effSpaceAfter);
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, foSpaceAfter);
- //addBlockSpacing(adjust, effSpaceAfter);
- //if (bSpaceAfter) {
- // addBlockSpacing(0, new MinOptMax(adjustedSpaceAfter));
- //}
-
curBlockArea = null;
resetSpaces();
}
getBlockFO().getCommonMarginBlock(),
this);
- // Set up dimensions
- // Get reference IPD from parentArea
- //int referenceIPD = parentArea.getIPD();
- //curBlockArea.setIPD(referenceIPD);
-
- // Set the width of the block based on the parent block
- // Need to be careful though, if parent is BC then width may not be set
- /* TODO remove if really not used anymore
- int parentwidth = 0;
- if (parentArea instanceof BlockParent) {
- parentwidth = ((BlockParent) parentArea).getIPD();
- }
- if (parentwidth == 0) {
- parentwidth = referenceIPD;
- }
- parentwidth -= getIPIndents();
- */
-
setCurrentArea(curBlockArea); // ??? for generic operations
}
return curBlockArea;
protected int adjustedSpaceAfter = 0;
/** Only used to store the original list when createUnitElements is called */
protected LinkedList storedList = null;
- /** FO node */
- protected FObj fobj;
/** Indicates whether break before has been served or not */
protected boolean bBreakBeforeServed = false;
/** Indicates whether space before has been served or not */
public BlockStackingLayoutManager(FObj node) {
super(node);
setGeneratesBlockArea(true);
- fobj = node;
}
/**
this.parentArea = parentArea;
}
- protected MinOptMax resolveSpaceSpecifier(Area nextArea) {
- SpaceSpecifier spaceSpec = new SpaceSpecifier(false);
- // Area prevArea = getCurrentArea().getLast();
- // if (prevArea != null) {
- // spaceSpec.addSpace(prevArea.getSpaceAfter());
- // }
- // spaceSpec.addSpace(nextArea.getSpaceBefore());
- return spaceSpec.resolve(false);
- }
-
/**
* Add a block spacer for space before and space after a block.
* This adds an empty Block area that acts as a block space.
//log.error("Child not a Block in BlockStackingLM!");
}
- MinOptMax spaceBefore = resolveSpaceSpecifier(childArea);
parentArea.addBlock((Block) childArea);
flush(); // hand off current area to parent
}
*/
public class FlowLayoutManager extends BlockStackingLayoutManager
implements BlockLevelLayoutManager {
- private Flow fobj;
/** Array of areas currently being filled stored by area class */
private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
*/
public FlowLayoutManager(PageSequenceLayoutManager pslm, Flow node) {
super(node);
- fobj = node;
setParent(pslm);
}
import java.util.LinkedList;
+/**
+ * Layout manager for footnote bodies.
+ */
public class FootnoteBodyLayoutManager extends BlockStackingLayoutManager {
+ /**
+ * Creates a new FootnoteBodyLayoutManager.
+ * @param body the footnote-body element
+ */
public FootnoteBodyLayoutManager(FootnoteBody body) {
super(body);
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager */
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
LayoutManager childLM = null;
LayoutManager lastLM = null;
// and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
- boolean bSpaceBefore = false;
- boolean bSpaceAfter = false;
while (parentIter.hasNext()) {
pos = (Position) parentIter.next();
//log.trace("pos = " + pos.getClass().getName() + "; " + pos);
}
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager#addChildArea(org.apache.fop.area.Area) */
public void addChildArea(Area childArea) {
childArea.setAreaClass(Area.CLASS_FOOTNOTE);
parentLM.addChildArea(childArea);
}
- /**
- * convenience method that returns the FootnoteBody node
- */
+ /** @return the FootnoteBody node */
protected FootnoteBody getFootnodeBodyFO() {
return (FootnoteBody) fobj;
}
addBlockSpacing(0.0, new MinOptMax(layoutContext.getSpaceBefore()));
}
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, foSpaceBefore);
- foSpaceBefore = null;
-
getPSLM().addIDToPage(getListBlockFO().getId());
// the list block contains areas stacked from each list item
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, foSpaceAfter);
-
curBlockArea = null;
resetSpaces();
}
LayoutContext layoutContext) {
getParentArea(null);
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, foSpaceBefore);
- //addBlockSpacing(adjust, effSpaceBefore);
- //foSpaceBefore = null;
-
getPSLM().addIDToPage(getListItemFO().getId());
LayoutContext lc = new LayoutContext(0);
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, foSpaceAfter);
- //addBlockSpacing(adjust, effSpaceAfter);
-
curBlockArea = null;
resetSpaces();
}
private double tableUnits;
private boolean autoLayout = true;
- //TODO space-before|after: handle space-resolution rules
- private MinOptMax spaceBefore;
- private MinOptMax spaceAfter;
-
private boolean discardBorderBefore;
private boolean discardBorderAfter;
private boolean discardPaddingBefore;
/** @see org.apache.fop.layoutmgr.LayoutManager#initialize() */
public void initialize() {
- spaceBefore = new SpaceVal(fobj.getCommonMarginBlock().spaceBefore, this).getSpace();
- spaceAfter = new SpaceVal(fobj.getCommonMarginBlock().spaceAfter, this).getSpace();
+ foSpaceBefore = new SpaceVal(fobj.getCommonMarginBlock().spaceBefore, this).getSpace();
+ foSpaceAfter = new SpaceVal(fobj.getCommonMarginBlock().spaceAfter, this).getSpace();
if (!fobj.isAutoLayout()
&& fobj.getInlineProgressionDimension().getOptimum(this).getEnum() != EN_AUTO) {
log.warn("Allocated IPD exceeds available reference IPD");
}
- //MinOptMax stackSize = new MinOptMax();
- //Add spacing
- /*
- if (spaceAfter != null) {
- stackSize.add(spaceAfter);
- }
- if (spaceBefore != null) {
- stackSize.add(spaceBefore);
- }*/
-
// either works out table of column widths or if proportional-column-width function
// is used works out total factor, so that value of single unit can be computed.
int sumCols = 0;
getParentArea(null);
getPSLM().addIDToPage(fobj.getId());
- // if adjusted space before
- //double adjust = layoutContext.getSpaceAdjust();
- //addBlockSpacing(adjust, spaceBefore);
- //spaceBefore = null;
-
int startXOffset = fobj.getCommonMarginBlock().startIndent.getValue(this);
// add column, body then row areas
flush();
- // if adjusted space after
- //addBlockSpacing(adjust, spaceAfter);
-
- //bodyBreaks.clear();
resetSpaces();
curBlockArea = null;
}