public class TableMap extends AbstractTableModel implements TableModelListener
Modifier and Type | Field and Description |
---|---|
protected TableModel |
mModel
Reference to the original table model.
|
listenerList
Constructor and Description |
---|
TableMap() |
Modifier and Type | Method and Description |
---|---|
Class |
getColumnClass(int pColumn)
Returns the most specific superclass for all the cell values
in the column.
|
int |
getColumnCount()
Returns the number of columns in the model.
|
String |
getColumnName(int pColumn)
Returns the name of the column at
aColumn . |
TableModel |
getModel()
Get the original table model.
|
int |
getRowCount()
Returns the number of rows in the model.
|
Object |
getValueAt(int pRow,
int pColumn)
Returns the value for the cell at
aColumn and
aRow . |
boolean |
isCellEditable(int pRow,
int pColumn)
Returns true if the cell at
row and
column
is editable. |
void |
setModel(TableModel pModel)
Set a new TableModel.
|
void |
setValueAt(Object pValue,
int pRow,
int pColumn)
Sets the value in the cell at
aColumn and
aRow to aValue . |
void |
tableChanged(TableModelEvent pEvent)
This fine grain notification tells listeners the exact range
of cells, rows, or columns that changed.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
protected TableModel mModel
public TableModel getModel()
public void setModel(TableModel pModel)
pModel
- the new TableModelpublic Object getValueAt(int pRow, int pColumn)
aColumn
and
aRow
.getValueAt
in interface TableModel
pRow
- the row whose value is to be queriedpColumn
- the column whose value is to be queriedpublic void setValueAt(Object pValue, int pRow, int pColumn)
aColumn
and
aRow
to aValue
.setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
pValue
- the new valuepRow
- the row whose value is to be changedpColumn
- the column whose value is to be changedpublic int getRowCount()
JTable
uses this method to determine how many rows it
should display. This method should be quick, as it
is called frequently during rendering.getRowCount
in interface TableModel
public int getColumnCount()
JTable
uses this method to determine how many columns it
should create and display by default.getColumnCount
in interface TableModel
public String getColumnName(int pColumn)
aColumn
. This is used
to initialize the table's column header name. Note: this name does
not need to be unique; two columns in a table can have the same name.getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
pColumn
- the index of the columnpublic Class getColumnClass(int pColumn)
JTable
to set up a
default renderer and editor for the column.getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
pColumn
- the index of the columnpublic boolean isCellEditable(int pRow, int pColumn)
row
and
column
is editable. Otherwise, setValueAt
on the cell will not
change the value of that cell.isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
pRow
- the row whose value to be queriedpColumn
- the column whose value to be queriedpublic void tableChanged(TableModelEvent pEvent)
tableChanged
in interface TableModelListener
pEvent
- the TableModelEvent containing notificationCopyright © 2017 Jürgen Zeller (privat). All rights reserved.