1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| @Override
public void insertRow(int row) {
int[][][] oldSpan = span;
Color[][] oldBackground = background;
Color[][] oldForeground = foreground;
int numRows = oldSpan.length;
setSize(new Dimension(columnSize, numRows + 1));
if (row > 0) {
System.arraycopy(oldSpan, 0, span, 0, row);
System.arraycopy(oldBackground, 0, background, 0, row);
System.arraycopy(oldForeground, 0, foreground, 0, row);
}
System.arraycopy(oldSpan, row, span, row + 1, numRows - row);
System.arraycopy(oldBackground, row, background, row + 1, numRows - row);
System.arraycopy(oldForeground, row, foreground, row + 1, numRows - row);
for (int i = 0; i < columnSize; i++) {
span[row][i][CellSpan.COLUMN] = 1;
span[row][i][CellSpan.ROW] = 1;
}
} |
Partager