Class LocoDataModel
java.lang.Object
javax.swing.table.AbstractTableModel
jmri.jmrix.tams.swing.locodatabase.LocoDataModel
- All Implemented Interfaces:
Serializable,EventListener,TableModel,AbstractMRListener,TamsListener
Table data model for display the loco database of the Tams MC.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int(package private) TamsSystemConnectionMemostatic final intstatic final intstatic final intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidconfigureTable(JTable slotTable) Configure a table to have our standard rows and columns.(package private) voiddeleteLoco(int row) voiddispose()Class<?>getColumnClass(int col) intgetColumnName(int col) intgetPreferredWidth(int col) intReturns the number of rows to be displayed.getValueAt(int row, int col) booleanisCellEditable(int row, int col) voidvoid(package private) voidsetColumnToHoldButton(JTable slotTable, int column) (package private) voidsetColumnToHoldEStopButton(JTable slotTable, int column) 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
-
ADDRCOLUMN
- See Also:
-
SPDCOLUMN
- See Also:
-
FMTCOLUMN
- See Also:
-
NAMECOLUMN
- See Also:
-
DELCOLUMN
- See Also:
-
NUMCOLUMN
- See Also:
-
memo
-
locolist
-
-
Constructor Details
-
LocoDataModel
LocoDataModel(int row, int column, TamsSystemConnectionMemo memo)
-
-
Method Details
-
getRowCount
Returns 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
-
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
-
deleteLoco
-
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
-
setColumnToHoldButton
-
setColumnToHoldEStopButton
-
dispose
-
message
- Specified by:
messagein interfaceTamsListener
-
reply
- Specified by:
replyin interfaceTamsListener
-
addLoco
-