final TableRowModel rowModel = section.getRowModel();
final TableRowInfoStructure rowInfoStructure = box.getRowInfoStructure();
final int rowNumber = currentTable.getRowNumber();
rowInfoStructure.setRowNumber(rowNumber);
final TableRow row = rowModel.getRow(rowNumber);
final BoxDefinition boxDefinition = box.getBoxDefinition();
final RenderLength preferredHeight = boxDefinition.getPreferredHeight();
final ComputedLayoutProperties rowNlp = box.getComputedLayoutProperties();
final RenderLength rowComputedWidth = rowNlp.getComputedWidth();
row.clearSizes();
row.setPreferredSize(preferredHeight.resolve(rowComputedWidth.resolve(0)));
final int cellCount = rowInfoStructure.getCellCount();
for (int i = 0; i < cellCount; i++)
{
final TableCell cellAt = rowInfoStructure.getCellAt(i);
if (cellAt instanceof DataCell == false)
{
continue;
}
// We dont handle spanned cells here; thats done indirectly by the
// column model itself.
final DataCell dataCell = (DataCell) cellAt;
final RenderNode cell = findCellInRow(box, dataCell.getCellRenderBox());
if (cell == null)
{
throw new IllegalStateException
("No such cell: " + dataCell.getCellRenderBox());
}
final TableColumn column = columnModel.getColumn(i);
final int colSpan = dataCell.getColSpan();
column.updateMinimumChunkSize(colSpan, cell.getMinimumChunkWidth());
column.updateMaxBoxSize(colSpan, cell.getMaximumBoxWidth());
final RenderLength computedWidth =
cell.getComputedLayoutProperties().getComputedWidth();
if (computedWidth == RenderLength.AUTO == false)
{
// if we have a computed width, set it. If the user explicitly specified
// a width, then that one is returned as computed width.
column.updatePreferredSize(colSpan, computedWidth.getValue());
}
final RenderLength definedHeight =
box.getBoxDefinition().getPreferredHeight();
row.updateDefinedSize(dataCell.getRowSpan(),
definedHeight.resolve(computedWidth.resolve(0)));
}
currentTable.increaseRowNumber();
}