propManager = pm;
abProps = pm.getAbsolutePositionProps();
- if(abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
+ if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
Rectangle2D rect = new Rectangle2D.Double(abProps.left,
abProps.top, abProps.right - abProps.left,
abProps.bottom - abProps.top);
public BreakPoss getNextBreakPoss(LayoutContext context) {
- if(abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
+ if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
return getAbsoluteBreakPoss(context);
}
MinOptMax stackLimit;
int ipd = context.getRefIPD();
boolean rotated = vals[0] == 0.0;
- if(rotated) {
+ if (rotated) {
// rotated 90 degrees
stackLimit = new MinOptMax(1000000);
ipd = getRotatedIPD();
absoluteCTM = new CTM(vals[0], vals[1], vals[2], vals[3], 0, 0);
} else {
- if(vals[0] == -1.0) {
+ if (vals[0] == -1.0) {
absoluteCTM = new CTM(vals[0], vals[1], vals[2], vals[3], 0, 0);
}
stackLimit = context.getStackLimit();
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stackSize.add(bp.getStackingSize());
- if (stackSize.min > stackLimit.max) {
+ if (stackSize.opt > stackLimit.max) {
// reset to last break
if (lastPos != null) {
reset(lastPos.getPosition());
stackLimit, stackSize));
}
}
- if(!rotated) {
+ if (!rotated) {
BreakPoss breakPoss;
breakPoss = new BreakPoss(new LeafPosition(this,
childBreaks.size() - 1));
}
}
setFinished(true);
- if(rotated) {
+ if (rotated) {
BreakPoss breakPoss;
breakPoss = new BreakPoss(new LeafPosition(this,
childBreaks.size() - 1));
// to the normal stacking
breakPoss.setStackingSize(new MinOptMax(0));
- if(stackSize.min > relDims.bpd) {
- if(overflow == Overflow.HIDDEN) {
+ if (stackSize.opt > relDims.bpd) {
+ if (overflow == Overflow.HIDDEN) {
clip = true;
- } else if(overflow == Overflow.ERROR_IF_OVERFLOW) {
+ } else if (overflow == Overflow.ERROR_IF_OVERFLOW) {
//log.error("contents overflows block-container viewport: clipping");
clip = true;
}
public Area getParentArea(Area childArea) {
if (curBlockArea == null) {
viewportBlockArea = new BlockViewport();
- if(abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
+ if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
viewportBlockArea.setXOffset(abProps.left);
viewportBlockArea.setYOffset(abProps.top);
viewportBlockArea.setWidth(abProps.right - abProps.left);
} else {
double[] vals = absoluteCTM.toArray();
boolean rotated = vals[0] == 0.0;
- if(rotated) {
+ if (rotated) {
viewportBlockArea.setWidth(relDims.bpd);
viewportBlockArea.setHeight(getRotatedIPD());
viewportBlockArea.setCTM(absoluteCTM);
viewportBlockArea.setClip(clip);
- } else if(vals[0] == -1.0) {
+ } else if (vals[0] == -1.0) {
// need to set bpd to actual size for rotation
// and stacking
viewportBlockArea.setWidth(relDims.ipd);
curBlockArea = new Block();
viewportBlockArea.addBlock(curBlockArea);
- if(abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
+ if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
viewportBlockArea.setPositioning(Block.ABSOLUTE);
}
private ArrayList childBreaks = new ArrayList();
private int xoffset;
- private int yoffset;
private int itemIPD;
/**
itemIPD = context.getRefIPD();
while ((curLM = getChildLM()) != null) {
- if(curLM.generatesInlineAreas()) {
+ if (curLM.generatesInlineAreas()) {
// error
curLM.setFinished(true);
continue;
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stackSize.add(bp.getStackingSize());
- if (stackSize.min > context.getStackLimit().max) {
+ if (stackSize.opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
reset(lastPos.getPosition());
}
/**
- * Set the y offset of this cell.
- * This offset is used to set the absolute position of the cell.
- *
- * @param off the y direction offset
- */
- public void setYOffset(int off) {
- yoffset = off;
- }
-
- /**
- * Set the x offset of this cell.
- * This offset is used to set the absolute position of the cell.
+ * Set the x offset of this list item.
+ * This offset is used to set the absolute position
+ * of the list item within the parent block area.
*
* @param off the x offset
*/
/**
* Add the areas for the break points.
- * The cell contains block stacking layout managers
+ * The list item contains block stacking layout managers
* that add block areas.
*
* @param parentIter the iterator of the break positions
}
}
- if(borderProps != null) {
+ if (borderProps != null) {
addBorders(curBlockArea, borderProps);
}
- if(backgroundProps != null) {
+ if (backgroundProps != null) {
addBackground(curBlockArea, backgroundProps);
}
curBlockArea.setPositioning(Block.ABSOLUTE);
// set position
curBlockArea.setXOffset(xoffset);
- curBlockArea.setYOffset(yoffset);
curBlockArea.setWidth(itemIPD);
//curBlockArea.setHeight();
}
/**
- * Add the child to the cell block area.
+ * Add the child to the list item area.
*
* @param childArea the child to add to the cell
* @return unused
getParentArea(null);
addID();
- // add column, body then row areas
+ // the list block contains areas stacked from each list item
- // add table header areas
-
- int tableHeight = 0;
+ int listHeight = 0;
ListItemLayoutManager childLM;
int iStartPos = 0;
iStartPos = lfp.getLeafPos() + 1;
while ((childLM = (ListItemLayoutManager)breakPosIter.getNextChildLM()) != null) {
childLM.addAreas(breakPosIter, lc);
- tableHeight += childLM.getListItemHeight();
+ listHeight += childLM.getListItemHeight();
}
}
// add footer areas
- curBlockArea.setHeight(tableHeight);
+ curBlockArea.setHeight(listHeight);
if(borderProps != null) {
addBorders(curBlockArea, borderProps);
private List cellList = null;
private List columns = null;
private int listItemHeight;
- private int yoffset;
private BorderAndPadding borderProps = null;
private BackgroundProps backgroundProps;
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stackSize.add(bp.getStackingSize());
- if (stackSize.min > context.getStackLimit().max) {
+ if (stackSize.opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
curLM.resetPosition(lastPos.getPosition());
curLM.resetPosition(null);
}
break;
+ } else {
+ lastPos = bp;
}
- lastPos = bp;
childBreaks.add(bp);
childLC.setStackLimit(MinOptMax.subtract(
return breakPoss;
}
- /**
- * Set the y position offset of this list item.
- * This is used to set the position of the areas returned by this list item.
- *
- * @param off the y offset
- */
- public void setYOffset(int off) {
- yoffset = off;
- }
-
/**
* Add the areas for the break points.
* This sets the offset of each cell as it is added.
addID();
Item childLM;
- int iStartPos = 0;
LayoutContext lc = new LayoutContext(0);
while (parentIter.hasNext()) {
ItemPosition lfp = (ItemPosition) parentIter.next();
// Add the block areas to Area
- int xoffset = 0;
for (Iterator iter = lfp.cellBreaks.iterator(); iter.hasNext();) {
List cellsbr = (List)iter.next();
PositionIterator breakPosIter;
breakPosIter = new BreakPossPosIter(cellsbr, 0, cellsbr.size());
- iStartPos = lfp.getLeafPos() + 1;
while ((childLM = (Item)breakPosIter.getNextChildLM()) != null) {
if(childLM == body) {
}
childLM.addAreas(breakPosIter, lc);
}
- xoffset += 100000;
}
}
super(fobj);
}
+ /**
+ * Initialize properties for this layout manager.
+ *
+ * @param propMgr the property manager from the fo object
+ */
protected void initProperties(PropertyManager propMgr) {
borderProps = propMgr.getBorderAndPadding();
backgroundProps = propMgr.getBackgroundProps();
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stackSize.add(bp.getStackingSize());
- if (stackSize.min > context.getStackLimit().max) {
+ if (stackSize.opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
reset(lastPos.getPosition());
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stackSize.add(bp.getStackingSize());
- if (stackSize.min > context.getStackLimit().max) {
+ if (stackSize.opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
reset(lastPos.getPosition());
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stackSize.add(bp.getStackingSize());
- if (stackSize.min > context.getStackLimit().max) {
+ if (stackSize.opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
reset(lastPos.getPosition());
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stackSize.add(bp.getStackingSize());
- if (stackSize.min > context.getStackLimit().max) {
+ if (stackSize.opt > context.getStackLimit().max) {
// reset to last break
if (lastPos != null) {
reset(lastPos.getPosition());