112113114115116117118119120121122123124125126
i, row.length ); for ( int cellNum = 0; cellNum < row.length; cellNum++ ) { Cell cell = row[cellNum]; Range merged = getRangeIfMerged( cell, mergedRanges ); if ( merged != null ) { Cell topLeft = merged.getTopLeft(); newCell( listeners, i, cellNum, topLeft.getContents(), topLeft.getColumn() );
137138139140141142143144145146147148149
} Range getRangeIfMerged(Cell cell, Range[] mergedRanges) { for ( int i = 0; i < mergedRanges.length; i++ ) { Range r = mergedRanges[i]; Cell topLeft = r.getTopLeft(); Cell bottomRight = r.getBottomRight(); if ( cell.getRow() >= topLeft.getRow() && cell.getRow() <= bottomRight.getRow() && cell.getColumn() >= topLeft.getColumn() && cell.getColumn() <= bottomRight.getColumn() ) { return r; } } return null;
row.length ); for ( int cellNum = 0; cellNum < row.length; cellNum++ ) { Cell cell = row[cellNum]; double num = 0; Range merged = getRangeIfMerged( cell, mergedRanges ); if ( merged != null ) { Cell topLeft = merged.getTopLeft(); newCell( listeners, i, cellNum, topLeft.getContents(), topLeft.getColumn() );
145146147148149150151152153154155156157
117118119120121122123124125126127128129130131
150151152153154155156157158159160161162
10951096109710981099110011011102110311041105
s1.mergeCells(5, 35, 8, 37); s1.addCell(l); l = new Label(5, 38, "More merged cells"); s1.addCell(l); Range r = s1.mergeCells(5, 38, 8, 41); s1.insertRow(40); s1.removeRow(39); s1.unmergeCells(r); // Merge cells and centre across them
109110111112113114115116117118119120121122123
134135136137138139140141142143144145146
108109110111112113114115116117118119120121122