distributeHeights(contentHeight - sigmaHeight, _rowHeights);
}
// now we have calculated the width and height of all cells.
// FIXME: border?
Insets insets = (style == null ? new Insets() : style.getBorderInsets()
.getAdded(style.getPaddingInsets()));
_internalTableWidth = (_tableInfo.getColumnCount() + 1) * _hspacing;
for (int i = 0; i < _columnWidths.length; i++) {
_internalTableWidth += _columnWidths[i];
}
int minWidth = getLengthValue(style, ICSSPropertyID.ATTR_MIN_WIDTH);
_internalTableWidth = _internalTableWidth > minWidth ? _internalTableWidth
: minWidth;
_blockBox.setWidth(_internalTableWidth + insets.getWidth());
_internalTableHeight = (_tableInfo.getRowCount() + 1) * _vspacing;
for (int i = 0; i < _rowHeights.length; i++) {
_internalTableHeight += _rowHeights[i];
}
int minHeight = getLengthValue(style, ICSSPropertyID.ATTR_MIN_HEIGHT);
_internalTableHeight = _internalTableHeight > minHeight ? _internalTableHeight
: minHeight;
int captionHeight = 0;
if (_tableInfo.getCaption() != null) {
_captionSize = _tableInfo.getCaption().getFigure().getPreferredSize(
_internalTableWidth, SWT.DEFAULT);
captionHeight = _captionSize.height;
} else {
_captionSize = null;
}
_internalTableHeight += captionHeight;
_blockBox.setHeight(_internalTableHeight + insets.getHeight());
_rowwidth = _internalTableWidth - 2 * _hspacing;
_rowx = _hspacing; // XXX: table border width left?
}