/** * Inserts the specified column at the specified position. Shifts components * that intersect the new column to the right hand side and readjusts * column groups.<p> * * The component shift works as follows: components that were located on * the right hand side of the inserted column are shifted one column to * the right; component column span is increased by one if it intersects * the new column.<p> * * Column group indices that are greater or equal than the given column * index will be increased by one. * * @param columnIndex index of the column to be inserted * @param columnSpec specification of the column to be inserted * @throws IndexOutOfBoundsException if the column index is out of range */ public void insertColumn(int columnIndex, ColumnSpec columnSpec) { if (columnIndex < 1 || columnIndex > getColumnCount()) { throw new IndexOutOfBoundsException( "The column index " + columnIndex + "must be in the range [1, " + getColumnCount() + "]."); } colSpecs.add(columnIndex - 1, columnSpec); shiftComponentsHorizontally(columnIndex, false); adjustGroupIndices(colGroupIndices, columnIndex, false); }
/** * Inserts the specified column at the specified position. Shifts components * that intersect the new column to the right hand side and readjusts * column groups.<p> * * The component shift works as follows: components that were located on * the right hand side of the inserted column are shifted one column to * the right; component column span is increased by one if it intersects * the new column.<p> * * Column group indices that are greater or equal than the given column * index will be increased by one. * * @param columnIndex index of the column to be inserted * @param columnSpec specification of the column to be inserted * @throws IndexOutOfBoundsException if the column index is out of range */ public void insertColumn(int columnIndex, ColumnSpec columnSpec) { if (columnIndex < 1 || columnIndex > getColumnCount()) { throw new IndexOutOfBoundsException( "The column index " + columnIndex + "must be in the range [1, " + getColumnCount() + "]."); } colSpecs.add(columnIndex - 1, columnSpec); shiftComponentsHorizontally(columnIndex, false); adjustGroupIndices(colGroupIndices, columnIndex, false); }
/** * Inserts the specified column at the specified position. Shifts * components that intersect the new column to the right and readjusts * column groups.<p> * * The component shift works as follows: components that were located on * the right hand side of the inserted column are shifted one column to * the right; component column span is increased by one if it intersects * the new column.<p> * * Column group indices that are greater or equal than the given column * index will be increased by one. * * @param rowIndex index of the row to be inserted * @param rowSpec specification of the row to be inserted * @throws IndexOutOfBoundsException if the row index is out of range */ public void insertRow(int rowIndex, RowSpec rowSpec) { if (rowIndex < 1 || rowIndex > getRowCount()) { throw new IndexOutOfBoundsException( "The row index " + rowIndex + " must be in the range [1, " + getRowCount() + "]."); } rowSpecs.add(rowIndex - 1, rowSpec); shiftComponentsVertically(rowIndex, false); adjustGroupIndices(rowGroupIndices, rowIndex, false); }
/** * Inserts the specified column at the specified position. Shifts components * that intersect the new column to the right and readjusts column groups. * <p> * * The component shift works as follows: components that were located on the * right hand side of the inserted column are shifted one column to the * right; component column span is increased by one if it intersects the new * column. * <p> * * Column group indices that are greater or equal than the given column * index will be increased by one. * * @param rowIndex * index of the row to be inserted * @param rowSpec * specification of the row to be inserted * @throws IndexOutOfBoundsException * if the row index is out of range */ public void insertRow(int rowIndex, RowSpec rowSpec) { if (rowIndex < 1 || rowIndex > getRowCount()) { throw new IndexOutOfBoundsException("The row index " + rowIndex + " must be in the range [1, " + getRowCount() + "]."); } rowSpecs.add(rowIndex - 1, rowSpec); shiftComponentsVertically(rowIndex, false); adjustGroupIndices(rowGroupIndices, rowIndex, false); }
/** * Inserts the specified column at the specified position. Shifts * components that intersect the new column to the right and readjusts * column groups.<p> * * The component shift works as follows: components that were located on * the right hand side of the inserted column are shifted one column to * the right; component column span is increased by one if it intersects * the new column.<p> * * Column group indices that are greater or equal than the given column * index will be increased by one. * * @param rowIndex index of the row to be inserted * @param rowSpec specification of the row to be inserted * @throws IndexOutOfBoundsException if the row index is out of range */ public void insertRow(int rowIndex, RowSpec rowSpec) { if (rowIndex < 1 || rowIndex > getRowCount()) { throw new IndexOutOfBoundsException( "The row index " + rowIndex + " must be in the range [1, " + getRowCount() + "]."); } rowSpecs.add(rowIndex - 1, rowSpec); shiftComponentsVertically(rowIndex, false); adjustGroupIndices(rowGroupIndices, rowIndex, false); }
/** * Inserts the specified column at the specified position. Shifts components * that intersect the new column to the right hand side and readjusts column * groups. * <p> * * The component shift works as follows: components that were located on the * right hand side of the inserted column are shifted one column to the * right; component column span is increased by one if it intersects the new * column. * <p> * * Column group indices that are greater or equal than the given column * index will be increased by one. * * @param columnIndex * index of the column to be inserted * @param columnSpec * specification of the column to be inserted * @throws IndexOutOfBoundsException * if the column index is out of range */ public void insertColumn(int columnIndex, ColumnSpec columnSpec) { if (columnIndex < 1 || columnIndex > getColumnCount()) { throw new IndexOutOfBoundsException("The column index " + columnIndex + "must be in the range [1, " + getColumnCount() + "]."); } colSpecs.add(columnIndex - 1, columnSpec); shiftComponentsHorizontally(columnIndex, false); adjustGroupIndices(colGroupIndices, columnIndex, false); }
adjustGroupIndices(colGroupIndices, columnIndex, true);
adjustGroupIndices(rowGroupIndices, rowIndex, true);
adjustGroupIndices(colGroupIndices, columnIndex, true);
adjustGroupIndices(rowGroupIndices, rowIndex, true);
adjustGroupIndices(rowGroupIndices, rowIndex, true);
adjustGroupIndices(colGroupIndices, columnIndex, true);