1 12 13 package org.objectweb.mobilitools.util.gui; 14 15 import javax.swing.table.*; 16 import javax.swing.event.TableModelListener ; 17 import javax.swing.event.TableModelEvent ; 18 19 public class TableMap extends AbstractTableModel 20 implements TableModelListener { 21 protected TableModel model; 22 23 public TableModel getModel() { 24 return model; 25 } 26 27 public void setModel(TableModel model) { 28 this.model = model; 29 model.addTableModelListener(this); 30 } 31 32 35 public Object getValueAt(int aRow, int aColumn) { 36 return model.getValueAt(aRow, aColumn); 37 } 38 39 public void setValueAt(Object aValue, int aRow, int aColumn) { 40 model.setValueAt(aValue, aRow, aColumn); 41 } 42 43 public int getRowCount() { 44 return (model == null) ? 0 : model.getRowCount(); 45 } 46 47 public int getColumnCount() { 48 return (model == null) ? 0 : model.getColumnCount(); 49 } 50 51 public String getColumnName(int aColumn) { 52 return model.getColumnName(aColumn); 53 } 54 55 public Class getColumnClass(int aColumn) { 56 return model.getColumnClass(aColumn); 57 } 58 59 public boolean isCellEditable(int row, int column) { 60 return model.isCellEditable(row, column); 61 } 62 public void tableChanged(TableModelEvent e) { 67 fireTableChanged(e); 68 } 69 } 70 | Popular Tags |