Class StandardPirolTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.openjump.core.apitools.tables.StandardPirolTableModel
-
- All Implemented Interfaces:
Serializable,TableModel
- Direct Known Subclasses:
StatisticOverViewTableModel
public abstract class StandardPirolTableModel extends AbstractTableModel
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]colNamesarray that holds information on the names for the table columnsprotected Vectorrowseach element of this vector represents a single row of the table.-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description StandardPirolTableModel(String[] colNames)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddRow(Object[] newRow)simple method to add a row to the table.voidclearTable()deletes all data from the table (also imforms the GUI)intfindColumn(String columnName)String[]getColNames()abstract ClassgetColumnClass(int columnIndex)intgetColumnCount()StringgetColumnName(int column)intgetRowCount()ObjectgetValueAt(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)-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Constructor Detail
-
StandardPirolTableModel
public StandardPirolTableModel(String[] colNames)
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
getColumnName
public String getColumnName(int column)
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
clearTable
public void clearTable()
deletes all data from the table (also imforms the GUI)
-
findColumn
public int findColumn(String columnName)
- Overrides:
findColumnin classAbstractTableModel- Parameters:
columnName- name of column to get the index for- Returns:
- the index of the column with the given name
-
setValueAt
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getValueAt
public Object getValueAt(int rowIndex, int columnIndex)
-
isCellEditable
public abstract boolean isCellEditable(int rowIndex, int columnIndex)- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getColumnClass
public abstract Class getColumnClass(int columnIndex)
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
addRow
public void addRow(Object[] newRow)
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
public String[] getColNames()
- Returns:
- array containing the names of the columns
-
setColNames
protected void setColNames(String[] colNames)
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
-
-