public final class RawPacketTableModel extends javax.swing.table.AbstractTableModel implements ColumnSizingTableModel, SnifferDataListener, FastComparableTableModel, ClearableTableModel
ClearableTableModel.ClearType
Constructor and Description |
---|
RawPacketTableModel(SnifferDataModel snifferDataModel)
Create a table model for displaying the recent raw packets.
|
Modifier and Type | Method and Description |
---|---|
void |
addTableModelListener(javax.swing.event.TableModelListener l)
Adds a listener to the list that's notified each time a change
to the data model occurs.
|
int |
compareRows(int rowIndex1,
int rowIndex2,
int columnIndex)
Compare the selected column of the two rows.
|
int |
deleteAllRows(ClearableTableModel.ClearType clearType)
Delete all rows from this table.
|
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 the localized name for the column.
|
int |
getColumnWidth(int columnIndex)
Specifies the default initial width of a column from this model.
|
AX25Frame |
getMessage(int rowIndex)
Get the AX.25 frame associated with a particular row in the RawPacketTableModel.
|
RawPacketDisplayMode |
getMode()
Get the current message body rendering mode.
|
java.lang.String |
getRecordTypeTag()
Get a tag that can be given to the
Localizer to return the
term for the records to be or that have been deleted. |
int |
getRowCount()
Returns the number of rows in the 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)
Indicate whether tabel cell is editable.
|
boolean |
isSizeToFit(int columnIndex)
Specifies whether setWidthToFit() should be enabled on this column.
|
boolean |
isSortByRcvTime()
Indicate whether packets are sorted by time of local receipt, or any timestamp
embedded in the packet (if any).
|
void |
messagesDeleted(int firstRow,
int lastRow)
Report that a block of messages has been deleted at the following range
of indexes.
|
void |
messagesInserted(int firstRow,
int lastRow)
Report that a block of messages has been inserted at the following range
of indexes.
|
void |
removeTableModelListener(javax.swing.event.TableModelListener l)
Removes a listener from the list that's notified each time a
change to the data model occurs.
|
void |
scheduleToGuiThread(java.lang.Runnable r)
Schedule a short-running operation that should only occur on the GUI dispatch
thread (however the implementing GUI chooses to do it).
|
void |
setMode(RawPacketDisplayMode mode)
Set the current message body rendering mode.
|
void |
setSortByRcvTime(boolean sortByRcvTime)
Specify whether packets are sorted by time of local receipt, or any timestamp
embedded in the packet (if any).
|
boolean |
tableCanContainPlayback()
Identifies whether this table can contain playback (historical) data.
|
boolean |
tableCanContainRealtime()
Identifies whether this table can contain realtime data.
|
findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, setValueAt
public RawPacketTableModel(SnifferDataModel snifferDataModel)
snifferDataModel
- SnifferDataModel that contains the packet historypublic boolean isSortByRcvTime()
public void setSortByRcvTime(boolean sortByRcvTime)
sortByRcvTime
- boolean true if receive time should be usedpublic java.lang.Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
columnIndex
- the column being queriedpublic java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
column
- the column being queriedcolumn
public int compareRows(int rowIndex1, int rowIndex2, int columnIndex)
compareRows
in interface FastComparableTableModel
rowIndex1
- zero-based model row index of first row to comparerowIndex2
- zero-based model row index of second row to comparecolumnIndex
- zero-based model column index of column to comparepublic boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
rowIndex
- zero-based row index of the cellcolumnIndex
- zero-based column index of the cellpublic int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
getRowCount()
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 int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
getColumnCount()
public 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 AX25Frame getMessage(int rowIndex)
rowIndex
- zero-based row indexjava.lang.IndexOutOfBoundsException
- if rowIndex not between 0 and the number of
messages in the tablepublic RawPacketDisplayMode getMode()
public void setMode(RawPacketDisplayMode mode)
mode
- the RawPacketDisplayMode to use for future renderingpublic void addTableModelListener(javax.swing.event.TableModelListener l)
addTableModelListener
in interface javax.swing.table.TableModel
addTableModelListener
in class javax.swing.table.AbstractTableModel
l
- the TableModelListenerpublic void removeTableModelListener(javax.swing.event.TableModelListener l)
removeTableModelListener
in interface javax.swing.table.TableModel
removeTableModelListener
in class javax.swing.table.AbstractTableModel
l
- the TableModelListenerpublic void messagesDeleted(int firstRow, int lastRow)
messagesDeleted
in interface SnifferDataListener
firstRow
- zero-based index of first messagelastRow
- zero-based index of last messagepublic void messagesInserted(int firstRow, int lastRow)
messagesInserted
in interface SnifferDataListener
firstRow
- zero-based index of first messagelastRow
- zero-based index of last messagepublic void scheduleToGuiThread(java.lang.Runnable r)
scheduleToGuiThread
in interface SnifferDataListener
r
- Runnable to be scheduled as soon as possible on the GUI threadpublic int deleteAllRows(ClearableTableModel.ClearType clearType)
deleteAllRows
in interface ClearableTableModel
clearType
- type of rows to deletepublic boolean tableCanContainPlayback()
tableCanContainPlayback
in interface ClearableTableModel
public boolean tableCanContainRealtime()
tableCanContainRealtime
in interface ClearableTableModel
public java.lang.String getRecordTypeTag()
Localizer
to return the
term for the records to be or that have been deleted. Should translate
to a plural term, i.e., "messages" rather than "message".getRecordTypeTag
in interface ClearableTableModel