Class CbusNodeNVTableDataModel

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.swing.table.TableModel

    public class CbusNodeNVTableDataModel
    extends javax.swing.table.AbstractTableModel
    implements java.beans.PropertyChangeListener
    Table data model for display of CBUS Node Variables.
    See Also:
    Serialized Form
    • Method Detail

      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent ev)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
      • getRowCount

        public int getRowCount()
        Return the number of rows to be displayed.
        Specified by:
        getRowCount in interface javax.swing.table.TableModel
      • getColumnCount

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

        public java.lang.String getColumnName​(int col)
        Returns String of column name from column int used in table header
        Specified by:
        getColumnName in interface javax.swing.table.TableModel
        Overrides:
        getColumnName in class javax.swing.table.AbstractTableModel
        Parameters:
        col - int col number
      • getColumnClass

        public java.lang.Class<?> getColumnClass​(int col)
        Returns column class type.
        Specified by:
        getColumnClass in interface javax.swing.table.TableModel
        Overrides:
        getColumnClass in class javax.swing.table.AbstractTableModel
      • isCellEditable

        public boolean isCellEditable​(int row,
                                      int col)
        boolean return to edit table cell or not
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
        Returns:
        boolean
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int col)
        Return table values
        Specified by:
        getValueAt in interface javax.swing.table.TableModel
        Parameters:
        row - int row number
        col - int col number
      • setValueAt

        public void setValueAt​(java.lang.Object value,
                               int row,
                               int col)
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.AbstractTableModel
      • setNode

        public void setNode​(CbusNode node)
        Set the Node to be used in table.
        Parameters:
        node - the CbusNode of Interest to the NV Table
      • getNode

        public CbusNode getNode()
        Get the Node being used in table.
        Returns:
        the CbusNode of Interest
      • isSingleNvDirty

        public boolean isSingleNvDirty​(int nvToCheck)
        Checks if a single NV has been edited to a new value
        Parameters:
        nvToCheck - the single NV to check
        Returns:
        true if dirty, else false
      • isTableDirty

        public boolean isTableDirty()
        Checks if any NV has been edited to a new value
        Returns:
        true if any NV has been edited, else false
      • getCountDirty

        public int getCountDirty()
        Get count of changed NVs.
        Returns:
        number of changed NVs
      • resetNewNvs

        public void resetNewNvs()
        Resets the edit NV value to match the actual NV value.
      • resetSingleNv

        public void resetSingleNv​(int row)
        Resets a single edit NV value to match the actual NV value.
        Parameters:
        row - row to reset
      • dispose

        public void dispose()
        De-registers the NV Table from receiving updates from the CbusNode.