/** * Initialization function */ private void initialize() { enclosingRange = new Range(); enclosingRange.firstRow = IntegerHelper.getInt(data[4], data[5]); enclosingRange.lastRow = IntegerHelper.getInt(data[6], data[7]); enclosingRange.firstColumn = IntegerHelper.getInt(data[8], data[9]); enclosingRange.lastColumn = IntegerHelper.getInt(data[10], data[11]); numRanges = IntegerHelper.getInt(data[12], data[13]); ranges = new Range[numRanges]; int pos = 14; for (int i = 0; i < numRanges; i++) { ranges[i] = new Range(); ranges[i].firstRow = IntegerHelper.getInt(data[pos], data[pos+1]); ranges[i].lastRow = IntegerHelper.getInt(data[pos+2], data[pos+3]); ranges[i].firstColumn = IntegerHelper.getInt(data[pos+4], data[pos+5]); ranges[i].lastColumn = IntegerHelper.getInt(data[pos+6], data[pos+7]); pos += 8; } initialized = true; }
/** * Inserts a blank column into this spreadsheet. If the column is out of * range of the columns in the sheet, then no action is taken * * @param col the column to insert */ public void insertColumn(int col) { if (!initialized) { initialize(); } enclosingRange.insertColumn(col); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].insertColumn(col); if (ranges[i].modified) { modified = true; } } return; }
/** * Inserts a blank row into this spreadsheet. If the row is out of range * of the rows in the sheet, then no action is taken * * @param row the row to insert */ public void insertRow(int row) { if (!initialized) { initialize(); } enclosingRange.insertRow(row); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].insertRow(row); if (ranges[i].modified) { modified = true; } } return; }
/** * Inserts a blank column into this spreadsheet. If the column is out of * range of the columns in the sheet, then no action is taken * * @param col the column to insert */ public void insertColumn(int col) { if (!initialized) { initialize(); } enclosingRange.insertColumn(col); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].insertColumn(col); if (ranges[i].modified) { modified = true; } } return; }
/** * Inserts a blank row into this spreadsheet. If the row is out of range * of the rows in the sheet, then no action is taken * * @param row the row to insert */ public void insertRow(int row) { if (!initialized) { initialize(); } enclosingRange.insertRow(row); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].insertRow(row); if (ranges[i].modified) { modified = true; } } return; }
/** * Inserts a blank column into this spreadsheet. If the column is out of * range of the columns in the sheet, then no action is taken * * @param col the column to insert */ public void removeColumn(int col) { if (!initialized) { initialize(); } enclosingRange.removeColumn(col); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].removeColumn(col); if (ranges[i].modified) { modified = true; } } return; }
/** * Removes a row from this spreadsheet. If the row is out of * range of the columns in the sheet, then no action is taken * * @param row the row to remove */ public void removeRow(int row) { if (!initialized) { initialize(); } enclosingRange.removeRow(row); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].removeRow(row); if (ranges[i].modified) { modified = true; } } return; }
/** * Inserts a blank column into this spreadsheet. If the column is out of * range of the columns in the sheet, then no action is taken * * @param col the column to insert */ public void removeColumn(int col) { if (!initialized) { initialize(); } enclosingRange.removeColumn(col); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].removeColumn(col); if (ranges[i].modified) { modified = true; } } return; }
/** * Initialization function */ private void initialize() { enclosingRange = new Range(); enclosingRange.firstRow = IntegerHelper.getInt(data[4], data[5]); enclosingRange.lastRow = IntegerHelper.getInt(data[6], data[7]); enclosingRange.firstColumn = IntegerHelper.getInt(data[8], data[9]); enclosingRange.lastColumn = IntegerHelper.getInt(data[10], data[11]); numRanges = IntegerHelper.getInt(data[12], data[13]); ranges = new Range[numRanges]; int pos = 14; for (int i = 0; i < numRanges; i++) { ranges[i] = new Range(); ranges[i].firstRow = IntegerHelper.getInt(data[pos], data[pos+1]); ranges[i].lastRow = IntegerHelper.getInt(data[pos+2], data[pos+3]); ranges[i].firstColumn = IntegerHelper.getInt(data[pos+4], data[pos+5]); ranges[i].lastColumn = IntegerHelper.getInt(data[pos+6], data[pos+7]); pos += 8; } initialized = true; }
/** * Removes a row from this spreadsheet. If the row is out of * range of the columns in the sheet, then no action is taken * * @param row the row to remove */ public void removeRow(int row) { if (!initialized) { initialize(); } enclosingRange.removeRow(row); if (enclosingRange.modified) { modified = true; } for (int i = 0 ; i < ranges.length ; i++) { ranges[i].removeRow(row); if (ranges[i].modified) { modified = true; } } return; }