Package jmri.jmrix.pricom.pockettester
Class PacketDataModel
java.lang.Object
javax.swing.table.AbstractTableModel
jmri.jmrix.pricom.pockettester.PacketDataModel
- All Implemented Interfaces:
Serializable,TableModel
Table data model for display of DCC packet contents
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int(package private) static final Booleanstatic final intstatic final int(package private) DataSource(package private) static final Booleanstatic 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()Class<?>getColumnClass(int col) intgetColumnName(int col) (package private) StringgetDetails(String s) Find the message arguments (3rd column) from the current input line.(package private) StringFind the display key from the current input line.intgetPreferredWidth(int col) (package private) StringFind the address (1st column) from the current input lineintReturns the number of rows to be displayed.(package private) StringFind the message type (2nd column) from the current input line.getValueAt(int row, int col) booleanisCellEditable(int row, int col) voidreset()(package private) voidsetColumnToHoldButton(JTable slotTable, int column) voidvoidsetValueAt(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
-
ADDRESSCOLUMN
- See Also:
-
TYPECOLUMN
- See Also:
-
DETAILCOLUMN
- See Also:
-
MONITORBUTTONCOLUMN
- See Also:
-
NUMCOLUMN
- See Also:
-
True
-
False
-
source
-
keys
-
addresses
-
types
-
details
-
-
Constructor Details
-
PacketDataModel
public PacketDataModel()
-
-
Method Details
-
getRowCount
Returns the number of rows to be displayed. This can vary depending on what has been seen- Returns:
- number of rows
-
getColumnCount
-
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
-
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 table to configure.
-
setColumnToHoldButton
-
dispose
-
asciiFormattedMessage
-
setSource
-
reset
-
getKey
Find the display key from the current input line. A later input line that maps to the same key will overwrite the earlier line.The current implementation is address+type, so that separate lines will be used for each type sent to the same address.
- Parameters:
s- Current line of input- Returns:
- null if not to be displayed, e.g. no address
-
getPrefix
Find the address (1st column) from the current input line- Parameters:
s- Current line of input- Returns:
- address
-
getType
Find the message type (2nd column) from the current input line. Should not be called if getPrefix has returned null.- Parameters:
s- Current line of input- Returns:
- null if not to be displayed, e.g. too short
-
getDetails
Find the message arguments (3rd column) from the current input line. Should not be called if getPrefix has returned null.- Parameters:
s- Current line of input- Returns:
- null if not to be displayed, e.g. too short
-