Class DataFrameTableModel<R,C,V>
- java.lang.Object
-
- com.macrofocus.high_d.table.swing.DataFrameTableModel<R,C,V>
-
- All Implemented Interfaces:
javax.swing.table.TableModel
public class DataFrameTableModel<R,C,V> extends java.lang.Object implements javax.swing.table.TableModel
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<javax.swing.event.TableModelListener>
listeners
-
Constructor Summary
Constructors Constructor Description DataFrameTableModel(com.macrofocus.molap.dataframe.DataFrame<R,C,V> dataFrame)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTableModelListener(javax.swing.event.TableModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.void
fireTableChanged(javax.swing.event.TableModelEvent e)
Forwards the given notification event to allTableModelListeners
that registered themselves as listeners for this table model.protected void
fireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed.protected void
fireTableStructureChanged()
Notifies all listeners that the table's structure has changed.java.lang.Class<?>
getColumnClass(int columnIndex)
int
getColumnCount()
java.lang.String
getColumnName(int column)
int
getRowCount()
java.lang.Object
getValueAt(int rowIndex, int columnIndex)
boolean
isCellEditable(int rowIndex, int columnIndex)
void
removeTableModelListener(javax.swing.event.TableModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.void
setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
-
-
-
Method Detail
-
getColumnName
public java.lang.String getColumnName(int column)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
-
getColumnClass
public java.lang.Class<?> getColumnClass(int columnIndex)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
-
setValueAt
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
-
addTableModelListener
public void addTableModelListener(javax.swing.event.TableModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.- Specified by:
addTableModelListener
in interfacejavax.swing.table.TableModel
- Parameters:
l
- the TableModelListener
-
removeTableModelListener
public void removeTableModelListener(javax.swing.event.TableModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.- Specified by:
removeTableModelListener
in interfacejavax.swing.table.TableModel
- Parameters:
l
- the TableModelListener
-
fireTableDataChanged
protected void fireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and theJTable
should redraw the table from scratch. The structure of the table (as in the order of the columns) is assumed to be the same.- See Also:
TableModelEvent
,EventListenerList
,JTable.tableChanged(TableModelEvent)
-
fireTableStructureChanged
protected void fireTableStructureChanged()
Notifies all listeners that the table's structure has changed. The number of columns in the table, and the names and types of the new columns may be different from the previous state. If theJTable
receives this event and itsautoCreateColumnsFromModel
flag is set it discards any table columns that it had and reallocates default columns in the order they appear in the model. This is the same as callingsetModel(TableModel)
on theJTable
.- See Also:
TableModelEvent
,EventListenerList
-
fireTableChanged
public void fireTableChanged(javax.swing.event.TableModelEvent e)
Forwards the given notification event to allTableModelListeners
that registered themselves as listeners for this table model.- Parameters:
e
- the event to be forwarded- See Also:
addTableModelListener(javax.swing.event.TableModelListener)
,TableModelEvent
,EventListenerList
-
-