Package jmri.jmrix.loconet.slotmon
Class SlotMonDataModel
java.lang.Object
javax.swing.table.AbstractTableModel
jmri.jmrix.loconet.slotmon.SlotMonDataModel
- All Implemented Interfaces:
Serializable,EventListener,TableModel,SlotListener
Table data model for display of slot manager contents.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic 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 TypeMethodDescriptionvoidvoidconfigureTable(JTable slotTable) Configure a table to have our standard rows and columns.voiddispose()voidestopAll()This is a convenience method that makes it easier for classes using this model to set all in-use slots to emergency stopClass<?>getColumnClass(int col) intgetColumnName(int col) intgetPreferredWidth(int col) intReturn the number of rows to be displayed.protected LocoNetSlotgetSlot(int row) getValueAt(int row, int col) booleanisCellEditable(int row, int col) voidvoidForces a refresh of the slotsprotected voidsendExpFunctionGroup1(LocoNetSlot slot, int col, int row) Send the Expanded LocoNet message to set the state of locomotive direction and functions F0, F1, F2, F3, F4, F5, F6protected voidsendExpFunctionGroup2(LocoNetSlot slot, int col, int row) Send the Expanded LocoNet message to set the state of functions F7, F8, F8, F9, F10, F11, F12, F13protected voidsendExpFunctionGroup3(LocoNetSlot slot, int col, int row) Sends expanded loconet message F14 thru F20 Message.protected voidsendExpFunctionGroup4(LocoNetSlot slot, int col, int row) Sends Expanded loconet message F21 thru F28 Message.protected voidsendFunctionGroup1(LocoNetSlot slot, int col, int row) Send the LocoNet message to set the state of locomotive direction and functions F0, F1, F2, F3, F4protected voidsendFunctionGroup2(LocoNetSlot slot, int col, int row) Send the LocoNet message to set the state of functions F5, F6, F7, F8protected voidsendFunctionGroup3(LocoNetSlot slot, int col, int row) Sends Function Group 3 values - F9 thru F12, using an "OPC_IMM_PACKET" LocoNet Message.protected voidsendFunctionGroup4(LocoNetSlot slot, int col, int row) Sends Function Group 4 values - F13 thru F20, using an "OPC_IMM_PACKET" LocoNet Message.protected voidsendFunctionGroup5(LocoNetSlot slot, int col, int row) Sends Function Group 5 values - F21 thru F28, using an "OPC_IMM_PACKET" LocoNet Message.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
-
SLOTCOLUMN
- See Also:
-
ESTOPCOLUMN
- See Also:
-
ADDRCOLUMN
- See Also:
-
SPDCOLUMN
- See Also:
-
TYPECOLUMN
- See Also:
-
STATCOLUMN
- See Also:
-
DISPCOLUMN
- See Also:
-
CONSCOLUMN
- See Also:
-
CONSISTADDRESS
- See Also:
-
THROTCOLUMN
- See Also:
-
DIRCOLUMN
- See Also:
-
F0COLUMN
- See Also:
-
F1COLUMN
- See Also:
-
F2COLUMN
- See Also:
-
F3COLUMN
- See Also:
-
F4COLUMN
- See Also:
-
F5COLUMN
- See Also:
-
F6COLUMN
- See Also:
-
F7COLUMN
- See Also:
-
F8COLUMN
- See Also:
-
F9COLUMN
- See Also:
-
F10COLUMN
- See Also:
-
F11COLUMN
- See Also:
-
F12COLUMN
- See Also:
-
F13COLUMN
- See Also:
-
F14COLUMN
- See Also:
-
F15COLUMN
- See Also:
-
F16COLUMN
- See Also:
-
F17COLUMN
- See Also:
-
F18COLUMN
- See Also:
-
F19COLUMN
- See Also:
-
F20COLUMN
- See Also:
-
F21COLUMN
- See Also:
-
F22COLUMN
- See Also:
-
F23COLUMN
- See Also:
-
F24COLUMN
- See Also:
-
F25COLUMN
- See Also:
-
F26COLUMN
- See Also:
-
F27COLUMN
- See Also:
-
F28COLUMN
- See Also:
-
-
Constructor Details
-
SlotMonDataModel
SlotMonDataModel(int row, int column, LocoNetSystemConnectionMemo memo)
-
-
Method Details
-
refreshSlots
Forces a refresh of the slots -
getRowCount
Return the number of rows to be displayed. This can vary depending on whether only active rows are displayed, and whether the system slots should be displayed.This should probably use a local cache instead of counting/searching each time.
- Specified by:
getRowCountin interfaceTableModel- Returns:
- the number of rows
-
getColumnCount
- Specified by:
getColumnCountin interfaceTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
isCellEditable
- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
getPreferredWidth
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
clearAllSlots
-
configureTable
Configure a table to have our standard rows and columns. This is optional, in that other table formats can use this table model. But we put it here to help keep it consistent.- Parameters:
slotTable- the table to configure
-
notifyChangedSlot
- Specified by:
notifyChangedSlotin interfaceSlotListener
-
getSlot
-
estopAll
This is a convenience method that makes it easier for classes using this model to set all in-use slots to emergency stop -
sendFunctionGroup1
Send the LocoNet message to set the state of locomotive direction and functions F0, F1, F2, F3, F4- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendFunctionGroup2
Send the LocoNet message to set the state of functions F5, F6, F7, F8- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendFunctionGroup3
Sends Function Group 3 values - F9 thru F12, using an "OPC_IMM_PACKET" LocoNet Message.- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendFunctionGroup4
Sends Function Group 4 values - F13 thru F20, using an "OPC_IMM_PACKET" LocoNet Message.- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendFunctionGroup5
Sends Function Group 5 values - F21 thru F28, using an "OPC_IMM_PACKET" LocoNet Message.- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendExpFunctionGroup1
Send the Expanded LocoNet message to set the state of locomotive direction and functions F0, F1, F2, F3, F4, F5, F6- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendExpFunctionGroup2
Send the Expanded LocoNet message to set the state of functions F7, F8, F8, F9, F10, F11, F12, F13- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendExpFunctionGroup3
Sends expanded loconet message F14 thru F20 Message.- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
sendExpFunctionGroup4
Sends Expanded loconet message F21 thru F28 Message.- Parameters:
slot- loconet slotcol- grid colrow- grid row
-
dispose
-