for (int p = 0; p < knuthParagraphs.size(); p++) {
// penalty between paragraphs
if (p > 0) {
Keep keep = getKeepTogether();
returnList.add(new BreakElement(
new Position(this),
keep.getPenalty(),
keep.getContext(),
context));
}
LineLayoutPossibilities llPoss = lineLayoutsList[p];
KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(p);
if (!seq.isInlineSequence()) {
List targetList = new LinkedList();
ListIterator listIter = seq.listIterator();
while (listIter.hasNext()) {
ListElement tempElement;
tempElement = (ListElement) listIter.next();
if (tempElement.getLayoutManager() != this) {
tempElement.setPosition(notifyPos(new NonLeafPosition(this,
tempElement.getPosition())));
}
targetList.add(tempElement);
}
returnList.addAll(targetList);
} else if (seq.isInlineSequence() && alignment == EN_JUSTIFY) {
/* justified vertical alignment (not in the XSL FO recommendation):
create a multi-layout sequence whose elements will contain
a conventional Position */
Position returnPosition = new LeafPosition(this, p);
createElements(returnList, llPoss, returnPosition);
} else {
/* "normal" vertical alignment: create a sequence whose boxes
represent effective lines, and contain LineBreakPositions */
int startIndex = 0;