Class 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 all TableModelListeners 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • listeners

        protected java.util.List<javax.swing.event.TableModelListener> listeners
    • Constructor Detail

      • DataFrameTableModel

        public DataFrameTableModel​(com.macrofocus.molap.dataframe.DataFrame<R,​C,​V> dataFrame)
    • Method Detail

      • getColumnName

        public java.lang.String getColumnName​(int column)
        Specified by:
        getColumnName in interface javax.swing.table.TableModel
      • getColumnClass

        public java.lang.Class<?> getColumnClass​(int columnIndex)
        Specified by:
        getColumnClass in interface javax.swing.table.TableModel
      • getRowCount

        public int getRowCount()
        Specified by:
        getRowCount in interface javax.swing.table.TableModel
      • getColumnCount

        public int getColumnCount()
        Specified by:
        getColumnCount in interface javax.swing.table.TableModel
      • getValueAt

        public java.lang.Object getValueAt​(int rowIndex,
                                           int columnIndex)
        Specified by:
        getValueAt in interface javax.swing.table.TableModel
      • isCellEditable

        public boolean isCellEditable​(int rowIndex,
                                      int columnIndex)
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
      • setValueAt

        public void setValueAt​(java.lang.Object aValue,
                               int rowIndex,
                               int columnIndex)
        Specified by:
        setValueAt in interface javax.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 interface javax.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 interface javax.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 the JTable 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 the JTable receives this event and its autoCreateColumnsFromModel 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 calling setModel(TableModel) on the JTable.
        See Also:
        TableModelEvent, EventListenerList
      • fireTableChanged

        public void fireTableChanged​(javax.swing.event.TableModelEvent e)
        Forwards the given notification event to all TableModelListeners 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