// First the cells don't span multiple rows.
cells = _tableInfo.getCells();
for (int i = 0, size = cells.size(); i < size; i++) {
TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
IFigure figure = cellinfo.getFigure();
int rowspan = cellinfo.getRowSpan();
if (rowspan == 1) {
int cellWidth = getCellWidth(cellinfo, _columnWidths);
Dimension d = figure.getPreferredSize(cellWidth, cellinfo
.getHeight());
if (d.height > _rowHeights[cellinfo.getRowIndex()]) {
_rowHeights[cellinfo.getRowIndex()] = d.height;
}
}
}
// Next those cells span multiple rows.
cells = _tableInfo.getCells();
for (int i = 0, size = cells.size(); i < size; i++) {
TableCellInfo cellinfo = (TableCellInfo) cells.get(i);
IFigure figure = cellinfo.getFigure();
int rowspan = cellinfo.getRowSpan();
if (rowspan > 1) {
int cellWidth = getCellWidth(cellinfo, _columnWidths);
Dimension d = figure.getPreferredSize(cellWidth, cellinfo
.getHeight());
if (d.height > getCellHeight(cellinfo, _rowHeights)) {
adjustHeight(cellinfo.getRowIndex(), rowspan, d.height,
_rowHeights);
}