public class TMWeather extends javax.swing.table.AbstractTableModel implements MonitoredStationListener, HealthMonitorGui.MonitoredStationGettingModel
Modifier and Type | Class and Description |
---|---|
class |
TMWeather.StringCellRenderer
A TableCellRenderer specific to the needs of the Station Health monitoring table.
|
Modifier and Type | Field and Description |
---|---|
static javax.swing.RowFilter<TMWeather,java.lang.Integer> |
FILTER
Filter for health monitor Weather table.
|
Constructor and Description |
---|
TMWeather()
Create a new instance of the weather station monitoring table model.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Shut down the asynchronous update listeners in this table model.
|
TMWeather.StringCellRenderer |
createStringCellRenderer()
Create a StringCellRenderer for the weather data.
|
static java.lang.String |
generateWeatherValue(AX25Message msg,
int columnIndex,
boolean showRawValues)
Produce the displayable text of a weather attribute,
|
java.lang.Class<?> |
getColumnClass(int columnIndex)
Get the data type of the values for the specified column,
|
int |
getColumnCount()
Get the number of columns defined in this table model.
|
java.lang.String |
getColumnName(int column)
Get the title to be displayed for the specified column.
|
int |
getRowCount()
Get the number of rows in the table model (effectively, the number of monitored stations).
|
MonitoredStation |
getStation(int rowIndex)
Get the station associated with the specified row.
|
java.awt.Color[] |
getTableCellColoring(javax.swing.JTable table,
boolean isSelected,
int modelRow,
int column)
Get the foreground and background colors for rendering the values in the specified cell.
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Get the display value for the specified table cell.
|
AX25Message |
getWeatherMessageAt(int rowIndex,
int nthCopy)
Get the Nth historical weather message for the specified table cell.
|
void |
setShowRawValues(boolean showRawValues)
Specify whether the weather values should be displayed as raw APRS or OpenTRAC values,
or formatted into human-expected units.
|
void |
stationAdded(int index,
MonitoredStation station)
Tell the listener that a new station has been added to the MonitoredStationList.
|
void |
stationRemoved(int index,
MonitoredStation station)
Tell the listener that a station is no longer being monitored.
|
void |
stationUpdated(int index,
MonitoredStation station)
Tell the listener that data about a MonitoredStation has changed.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
public static final javax.swing.RowFilter<TMWeather,java.lang.Integer> FILTER
public TMWeather()
public static java.lang.String generateWeatherValue(AX25Message msg, int columnIndex, boolean showRawValues)
msg
- AX25Message containing the weather datacolumnIndex
- column index according to the layout in the TMWeather table modelshowRawValues
- boolean true if the raw numeric values from the APRS or OpenTRAC message
should be displayed, false if the appropriately scaled value should be
displayed in the user-configured unitspublic int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
columnIndex
- zero-based number of the column to querypublic java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
column
- zero-based number of the columnpublic java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface javax.swing.table.TableModel
rowIndex
- zero-based row numbercolumnIndex
- zero-based column numberpublic AX25Message getWeatherMessageAt(int rowIndex, int nthCopy)
rowIndex
- zero-based row numbernthCopy
- how many more-recent weather messages should be skipped to get to the desired recordpublic void stationAdded(int index, MonitoredStation station)
stationAdded
in interface MonitoredStationListener
index
- int zero-based position in the list where the station has been addedstation
- MonitoredStation object to addpublic void stationUpdated(int index, MonitoredStation station)
stationUpdated
in interface MonitoredStationListener
index
- zero-based index of the station in the MonitoredStationListstation
- MonitoredStation whose data has been updatedpublic void stationRemoved(int index, MonitoredStation station)
stationRemoved
in interface MonitoredStationListener
index
- int zero-based position in the MonitoredStationList where the station used to bestation
- MonitoredStation being removedpublic MonitoredStation getStation(int rowIndex)
getStation
in interface HealthMonitorGui.MonitoredStationGettingModel
rowIndex
- the zero-based row index for the desired stationpublic void setShowRawValues(boolean showRawValues)
showRawValues
- boolean true if weather values should be reported as-is in the protocol messagepublic void close()
public java.awt.Color[] getTableCellColoring(javax.swing.JTable table, boolean isSelected, int modelRow, int column)
table
- JTable being renderedisSelected
- boolean true if table cell is selectedmodelRow
- zero-based row number in the table modelcolumn
- zero-based column number in the table modelpublic TMWeather.StringCellRenderer createStringCellRenderer()