public void setCellAttribute(CellAttribute newCellAtt) { int numColumns = getColumnCount(); int numRows = getRowCount(); if ((newCellAtt.getSize().width != numColumns) || (newCellAtt.getSize().height != numRows)) { newCellAtt.setSize(new Dimension(numRows, numColumns)); } cellAtt = newCellAtt; fireTableDataChanged(); }
public void insertRow(int row, Vector rowData) { if (rowData == null) { rowData = new Vector(getColumnCount()); } else { rowData.setSize(getColumnCount()); } dataVector.insertElementAt(rowData, row); // cellAtt.insertRow(row); newRowsAdded( new TableModelEvent(this, row, row, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT)); }
public void addColumn(Object columnName, Vector columnData) { if (columnName == null) throw new IllegalArgumentException("addColumn() - null parameter"); columnIdentifiers.addElement(columnName); int index = 0; Enumeration enumeration = dataVector.elements(); while (enumeration.hasMoreElements()) { Object value; if ((columnData != null) && (index < columnData.size())) value = columnData.elementAt(index); else value = null; ((Vector) enumeration.nextElement()).addElement(value); index++; } // cellAtt.addColumn(); fireTableStructureChanged(); }
public void addRow(Vector rowData) { Vector newData = null; if (rowData == null) { newData = new Vector(getColumnCount()); } else { rowData.setSize(getColumnCount()); } dataVector.addElement(newData); // cellAtt.addRow(); newRowsAdded( new TableModelEvent( this, getRowCount() - 1, getRowCount() - 1, TableModelEvent.ALL_COLUMNS, TableModelEvent.INSERT)); }