assertEquals(heightCell00, heightCell01 + heightCell11);
}
public static Band createTable(final int[][] layout, final int headerRows)
{
final Band table = new Band();
table.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE);
table.getStyle().setStyleProperty(BandStyleKeys.TABLE_LAYOUT, TableLayout.fixed);
if (headerRows > 0)
{
final Band tableHeader = new Band();
tableHeader.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_HEADER);
for (int r = 0; r < headerRows; r += 1)
{
final Band row = new Band();
row.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_ROW);
row.setName("r-" + r);
final int[] rowDefinition = layout[r];
for (int cellNumber = 0; cellNumber < rowDefinition.length; cellNumber++)
{
final int cellWidth = rowDefinition[cellNumber];
final Band cell = TableTestUtil.createCell(r, cellNumber, cellWidth, 10);
cell.setName("c-" + r + "-" + cellNumber);
row.addElement(cell);
}
tableHeader.addElement(row);
}
table.addElement(tableHeader);
}
final Band tableBody = new Band();
tableBody.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_BODY);
for (int r = headerRows; r < layout.length; r += 1)
{
final Band row = new Band();
row.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_ROW);
row.setName("r-" + r);
final int[] rowDefinition = layout[r];
for (int cellNumber = 0; cellNumber < rowDefinition.length; cellNumber++)
{
final int cellWidth = rowDefinition[cellNumber];
final Band cell = TableTestUtil.createCell(r, cellNumber, cellWidth, 10);
cell.setName("c-" + r + "-" + cellNumber);
row.addElement(cell);
}
tableBody.addElement(row);
}
table.addElement(tableBody);