/**
* {@inheritDoc}
*/
public Status layout(final AreaNode areaNode,
final GraftingPoint graftingPoint) throws AreaTreeException {
final Fo node = getFONode();
final TableArea tableArea = (TableArea) areaNode;
final Table table = tableArea.traitGeneratedBy();
if (getProgress() == FONodePL.BREAK_AFTER) {
return Status.OK;
}
if (getProgress() == FONodePL.START) {
if (this.rowSpanMgr == null) {
this.rowSpanMgr = new RowSpanMgr(table.getTableColumns().length,
this.getLayout());
}
// if (this.isInListBody) {
// startIndent += bodyIndent + distanceBetweenStarts;
// }
setProgress(0);
}
/*
* Note: the parent FO must be a Table. The parent Area is the Block
* type area created by the Table, which is also a reference area.
* The content "width" (IPD) of the TableBody is the same as that
* of the containing table area, and its relative position is 0,0.
* Strictly speaking (CR), this FO should generate no areas!
*/
AbstractTablePartContainer areaContainer = null;
if (node instanceof TableBody) {
areaContainer = tableArea.makeTableBodyContainer(
(TableBody) node, graftingPoint);
} else if (node instanceof TableHeader) {
areaContainer = tableArea.makeTableHeaderContainer(
(TableHeader) node, graftingPoint);
} else if (node instanceof TableFooter) {
areaContainer = tableArea.makeTableFooterContainer(
(TableFooter) node, graftingPoint);
}
List<TableRow> keepWith = new ArrayList<TableRow>();
final int numChildren = node.getChildCount();
TableRow lastRow = null;
boolean endKeepGroup = true;
for (int i = getProgress(); i < numChildren; i++) {
final Fo child = node.getChildAt(i);
if (child instanceof Marker) {
final MarkerPL markerPL = (MarkerPL) getLayoutProxy(child);
markerPL.layout(tableArea, graftingPoint);
continue;
}