Class StandardPirolTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.openjump.core.apitools.tables.StandardPirolTableModel
- All Implemented Interfaces:
Serializable, TableModel
- Direct Known Subclasses:
StatisticOverViewTableModel
standard implementation for a table model.
- Version:
- $Rev: 2451 $
- Author:
- Ole Rahn
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement - See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]array that holds information on the names for the table columnsprotected Vectoreach element of this vector represents a single row of the table.Fields inherited from class AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsimple method to add a row to the table.voiddeletes all data from the table (also imforms the GUI)intfindColumn(String columnName) String[]abstract ClassgetColumnClass(int columnIndex) intgetColumnName(int column) intgetValueAt(int rowIndex, int columnIndex) abstract booleanisCellEditable(int rowIndex, int columnIndex) protected voidsetColNames(String[] colNames) Setting new column names will flush the table, if the new array has not the same length as the old one!voidsetValueAt(Object aValue, int rowIndex, int columnIndex)
-
Field Details
-
rows
each element of this vector represents a single row of the table. Internally, a row is represented by a Object[]. -
colNames
array that holds information on the names for the table columns
-
-
Constructor Details
-
StandardPirolTableModel
-
-
Method Details
-
getColumnCount
public int getColumnCount() -
getRowCount
public int getRowCount() -
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
clearTable
public void clearTable()deletes all data from the table (also imforms the GUI) -
findColumn
- Overrides:
findColumnin classAbstractTableModel- Parameters:
columnName- name of column to get the index for- Returns:
- the index of the column with the given name
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getValueAt
-
isCellEditable
public abstract boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
addRow
simple method to add a row to the table. (It better matches the given column nummer and column types!!)- Parameters:
newRow- row of objects to add to the TableModel
-
getColNames
- Returns:
- array containing the names of the columns
-
setColNames
Setting new column names will flush the table, if the new array has not the same length as the old one!- Parameters:
colNames- array containing new column names
-