Package jmri.jmrix.sprog.sprogslotmon
Class SprogSlotMonDataModel
java.lang.Object
javax.swing.table.AbstractTableModel
jmri.jmrix.sprog.sprogslotmon.SprogSlotMonDataModel
- All Implemented Interfaces:
Serializable,EventListener,TableModel,SprogSlotListener
Table data model for display of slot manager contents.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int(package private) static final Booleanstatic final intstatic final intstatic final intstatic final int(package private) static final BooleanFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureTable(JTable slotTable) Configure a table to have our standard rows and columns.voiddispose()Class<?>getColumnClass(int col) intgetColumnName(int col) intgetPreferredWidth(int col) intReturn the number of rows to be displayed.getValueAt(int row, int col) booleanisCellEditable(int row, int col) voidvoidsetValueAt(Object value, int row, int col) voidshowAllSlots(boolean val) protected intslotNum(int row) Return slot number for a specific row.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:
-
ADDRCOLUMN
- See Also:
-
SPDCOLUMN
- See Also:
-
STATCOLUMN
- See Also:
-
DIRCOLUMN
- See Also:
-
NUMCOLUMN
- See Also:
-
True
-
False
-
-
Constructor Details
-
SprogSlotMonDataModel
SprogSlotMonDataModel(int row, int column, SprogSystemConnectionMemo memo)
-
-
Method Details
-
getRowCount
Return the number of rows to be displayed. This can vary depending on whether only active rows are 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
-
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 slot table to configure.
-
notifyChangedSlot
- Specified by:
notifyChangedSlotin interfaceSprogSlotListener
-
showAllSlots
-
slotNum
Return slot number for a specific row.This should probably use a local cache instead of counting/searching each time.
- Parameters:
row- Row number in the displayed table- Returns:
- Matching slot number
-
dispose
-