Package jmri.jmrix.can.cbus.node
Class CbusNodeNVTableDataModel
java.lang.Object
javax.swing.table.AbstractTableModel
jmri.jmrix.can.cbus.node.CbusNodeNVTableDataModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
Table data model for display of CBUS Node Variables.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()De-registers the NV Table from receiving updates from the CbusNode.Get a backup node containing the edited NVs.Class<?>getColumnClass(int col) Returns column class type.intgetColumnName(int col) Returns String of column name from column int used in table headerintGet count of changed NVs.getNode()Get the Node being used in table.intReturn the number of rows to be displayed.getValueAt(int row, int col) Return table valuesbooleanisCellEditable(int row, int col) boolean return to edit table cell or notbooleanisSingleNvDirty(int nvToCheck) Checks if a single NV has been edited to a new valuebooleanChecks if any NV has been edited to a new valuevoidvoidResets the edit NV value to match the actual NV value.voidresetSingleNv(int row) Resets a single edit NV value to match the actual NV value.voidSet the Node to be used in table.voidsetValueAt(Object value, int row, int col) Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
NV_NUMBER_COLUMN
- See Also:
-
NV_NAME_COLUMN
- See Also:
-
NV_CURRENT_VAL_COLUMN
- See Also:
-
NV_CURRENT_HEX_COLUMN
- See Also:
-
NV_CURRENT_BIT_COLUMN
- See Also:
-
NV_SELECT_COLUMN
- See Also:
-
NV_SELECT_HEX_COLUMN
- See Also:
-
NV_SELECT_BIT_COLUMN
- See Also:
-
MAX_COLUMN
- See Also:
-
-
Constructor Details
-
CbusNodeNVTableDataModel
-
-
Method Details
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
getRowCount
Return the number of rows to be displayed.- Specified by:
getRowCountin interfaceTableModel
-
getColumnCount
- Specified by:
getColumnCountin interfaceTableModel
-
getColumnName
Returns String of column name from column int used in table header- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel- Parameters:
col- int col number
-
getColumnClass
Returns column class type.- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
isCellEditable
boolean return to edit table cell or not- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel- Returns:
- boolean
-
getValueAt
Return table values- Specified by:
getValueAtin interfaceTableModel- Parameters:
row- int row numbercol- int col number
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
setNode
Set the Node to be used in table.- Parameters:
node- the CbusNode of Interest to the NV Table
-
getNode
Get the Node being used in table.- Returns:
- the CbusNode of Interest
-
isSingleNvDirty
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
Checks if any NV has been edited to a new value- Returns:
- true if any NV has been edited, else false
-
getCountDirty
Get count of changed NVs.- Returns:
- number of changed NVs
-
resetNewNvs
Resets the edit NV value to match the actual NV value. -
resetSingleNv
Resets a single edit NV value to match the actual NV value.- Parameters:
row- row to reset
-
getChangedNode
Get a backup node containing the edited NVs.- Returns:
- a node which has the new NV's
-
dispose
De-registers the NV Table from receiving updates from the CbusNode.
-