public class KenwoodMessageListTableModel extends java.lang.Object implements javax.swing.table.TableModel, ColumnSizingTableModel, DuplicateCheckedAX25Listener, java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected static java.text.DecimalFormat |
fmtMonitorFreq
Format string for APRS-standard frequency format.
|
Constructor and Description |
---|
KenwoodMessageListTableModel(MainGui gui)
Create a KenwoodMessageListTableModel.
|
Modifier and Type | Method and Description |
---|---|
void |
addTableModelListener(javax.swing.event.TableModelListener l)
Adds a listener to the list that is notified each time a change
to the data model occurs.
|
void |
consumeAX25Frame(AX25Message msg,
AX25Frame frame,
Connector connector,
boolean isDuplicate)
Called when a AX.25 frame is received.
|
java.lang.Class<?> |
getColumnClass(int columnIndex)
Returns the data Class for the specified column.
|
int |
getColumnCount()
Returns the number of columns in the model.
|
java.lang.String |
getColumnName(int column)
Returns an empty name for the column (because the Kenwood D710 control head
doesn't display column headers).
|
int |
getColumnWidth(int columnIndex)
Specifies the default initial width of a column from this model.
|
int |
getRowCount()
Returns the number of rows in the model.
|
AX25Message |
getSortedRow(int rowIndex)
Return the object state record for the specified index into the sorted
list of objects that is backing the table model.
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value for the cell at
columnIndex and
rowIndex . |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns true if the cell at
rowIndex and
columnIndex
is editable. |
boolean |
isSizeToFit(int columnIndex)
Specifies whether setWidthToFit() should be enabled on this column
|
void |
removeTableModelListener(javax.swing.event.TableModelListener l)
Removes a listener from the list that is notified each time a
change to the data model occurs.
|
void |
run()
DO NOT CALL.
|
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
Sets the value in the cell at
columnIndex and
rowIndex to aValue . |
protected static final java.text.DecimalFormat fmtMonitorFreq
public KenwoodMessageListTableModel(MainGui gui)
gui
- MainGui object parenting this modelpublic int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
getColumnCount()
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
getRowCount()
public AX25Message getSortedRow(int rowIndex)
rowIndex
- zero-based row indexpublic java.lang.Object getValueAt(int rowIndex, int columnIndex)
columnIndex
and
rowIndex
.getValueAt
in interface javax.swing.table.TableModel
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queriedpublic java.lang.Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface javax.swing.table.TableModel
columnIndex
- the column being queriedpublic java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
column
- the column being queriedcolumn
public int getColumnWidth(int columnIndex)
getColumnWidth
in interface ColumnSizingTableModel
columnIndex
- int index of the model's column whose width should be obtainedpublic boolean isSizeToFit(int columnIndex)
isSizeToFit
in interface ColumnSizingTableModel
columnIndex
- int index of the model's column whose width should be obtainedpublic void consumeAX25Frame(AX25Message msg, AX25Frame frame, Connector connector, boolean isDuplicate)
consumeAX25Frame
in interface DuplicateCheckedAX25Listener
msg
- decoded APRS message if the AX.25 frame contains an APRS packet, or null if the frame is not a recognized protocolframe
- received AX25Frameconnector
- the PortConnector over which the frame was receivedisDuplicate
- boolean true if this is a duplicate message (possibly received over a different digipeater path)public final void run()
run
in interface java.lang.Runnable
public boolean isCellEditable(int rowIndex, int columnIndex)
rowIndex
and
columnIndex
is editable. Otherwise, setValueAt
on the cell will not
change the value of that cell.isCellEditable
in interface javax.swing.table.TableModel
rowIndex
- the row whose value to be queriedcolumnIndex
- the column whose value to be queriedsetValueAt(java.lang.Object, int, int)
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
columnIndex
and
rowIndex
to aValue
.setValueAt
in interface javax.swing.table.TableModel
aValue
- the new valuerowIndex
- the row whose value is to be changedcolumnIndex
- the column whose value is to be changedgetValueAt(int, int)
,
isCellEditable(int, int)
public void addTableModelListener(javax.swing.event.TableModelListener l)
addTableModelListener
in interface javax.swing.table.TableModel
l
- the TableModelListenerpublic void removeTableModelListener(javax.swing.event.TableModelListener l)
removeTableModelListener
in interface javax.swing.table.TableModel
l
- the TableModelListener