// prepare row interval
if (m_rowIntervals[row] == null) {
Object trElement = dom.getParent(td);
Rectangle trBounds = state.getAbsoluteBounds(trElement);
absoluteToRelative(trBounds);
Interval trInterval = new Interval(trBounds.y, trBounds.height);
if (rowSpan == 1) {
m_rowIntervals[row] = trInterval;
} else {
Rectangle tdBounds = state.getAbsoluteBounds(td);
Interval spannedInterval = new Interval(trBounds.y, tdBounds.height);
spannedRowIntervals.put(new Interval(row, rowSpan), spannedInterval);
}
}
// prepare column interval
if (m_columnIntervals[column] == null) {
Rectangle tdBounds = state.getAbsoluteBounds(td);
absoluteToRelative(tdBounds);
Interval columnInterval = new Interval(tdBounds.x, tdBounds.width);
if (colSpan == 1) {
m_columnIntervals[column] = columnInterval;
} else {
spannedColumnIntervals.put(new Interval(column, colSpan), columnInterval);
}
}
// next column
column += colSpan;
}
}
// fix spanned columns/rows
fetchCells_fixSpannedColumns(spannedColumnIntervals);
fetchCells_fixSpannedRows(spannedRowIntervals);
// if no rows, fill column intervals
if (m_rowIntervals.length == 0) {
for (int i = 0; i < m_columnIntervals.length; i++) {
m_columnIntervals[i] = new Interval();
}
}
// if no columns, fill row intervals
if (m_columnIntervals.length == 0) {
for (int i = 0; i < m_rowIntervals.length; i++) {
m_rowIntervals[i] = new Interval();
}
}
// ensure that widget has at least some cells
for (WidgetInfo widget : getChildrenWidgets()) {
Rectangle cells = m_widgetToCells.get(widget);