public class BaseTableModel
extends javax.swing.table.DefaultTableModel
implements javax.swing.event.TableModelListener
DefaultTableModel
Implements TableModelListener
which require the method tableChanged(TableModelEvent)
This class supports a special first row, which does not contain data, and is used for filtering the contents.
Also supports a basic summary row with aggregate figures for floating points values.Constructor and Description |
---|
BaseTableModel() |
BaseTableModel(java.lang.Object[][] data,
java.lang.Object[] colnames)
Initializes the data model with the data array and column names given as arguments.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isCellEditable(int i,
int j) |
boolean |
isEditable() |
boolean |
isFiltered() |
boolean |
isFilterRowEnabled() |
boolean |
isFilterRowInserted() |
boolean |
isSummaryRowEnabled() |
boolean |
isSummaryRowInserted() |
void |
restoreData() |
void |
saveData() |
void |
setEditable(boolean editable) |
void |
setFiltered(boolean filtered)
When the property changes, the filter row is created or removed.
|
void |
setFilterRowEnabled(boolean filterRowEnabled) |
void |
setSummary(boolean withSummary)
When the property changes, the summary row is created or removed.
|
void |
setSummaryRowEnabled(boolean summaryRowEnabled) |
void |
tableChanged(javax.swing.event.TableModelEvent e) |
addColumn, addColumn, addColumn, addRow, addRow, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
public BaseTableModel(java.lang.Object[][] data, java.lang.Object[] colnames)
data
- is the data to fill in the tablecolnames
- is the names of the columnspublic BaseTableModel()
public boolean isFilterRowInserted()
public boolean isSummaryRowInserted()
public boolean isEditable()
public void setEditable(boolean editable)
public boolean isFiltered()
public void setFiltered(boolean filtered)
filtered
- public boolean isCellEditable(int i, int j)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.DefaultTableModel
public void saveData()
public void restoreData()
public void tableChanged(javax.swing.event.TableModelEvent e)
tableChanged
in interface javax.swing.event.TableModelListener
public void setSummary(boolean withSummary)
withSummary
- public boolean isFilterRowEnabled()
public void setFilterRowEnabled(boolean filterRowEnabled)
public boolean isSummaryRowEnabled()
public void setSummaryRowEnabled(boolean summaryRowEnabled)