Package org.ka2ddo.yaac.gui
Class TXIGatedStationsTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.TXIGatedStationsTableModel
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,TableModel
,Digipeater.TXIGatedStationStatusListener
,ColumnSizingTableModel
public class TXIGatedStationsTableModel
extends AbstractTableModel
implements Digipeater.TXIGatedStationStatusListener, ColumnSizingTableModel, Closeable
This class defines a TableModel for viewing the status of stations TX-IGated by
this station.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this table model and releases any system resources associated with it.Class<?>
getColumnClass
(int columnIndex) Returns the data Class for the specified column.int
Returns the number of columns in the model.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.int
Returns the number of rows in the model.getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell atcolumnIndex
androwIndex
.boolean
isSizeToFit
(int columnIndex) Specifies whether setWidthToFit() should be enabled on this columnvoid
txIGatedStationAdded
(int index) Inform listener that a station has been added to the list of I-gated stations.void
txIGatedStationDeleted
(int index) Inform listener that a station is no longer being I-gated by this station (timed out).void
txIGatedStationUpdated
(int index) Inform listener that a station has been forwarded again.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
-
Constructor Details
-
TXIGatedStationsTableModel
public TXIGatedStationsTableModel()
-
-
Method Details
-
getColumnClass
Returns the data Class for the specified column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- the column being queried- Returns:
- the Class object for the column's data
-
getColumnName
Returns the localized name for the column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column being queried- Returns:
- a string containing the name of
column
-
getColumnCount
public int getColumnCount()Returns the number of columns in the model.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns in the model
- See Also:
-
getRowCount
public int getRowCount()Returns the number of rows in the model. AJTable
uses this method to determine how many rows it should display. This method should be quick, as it is called frequently during rendering.- Specified by:
getRowCount
in interfaceTableModel
- Returns:
- the number of rows in the model
- See Also:
-
getValueAt
Returns the value for the cell atcolumnIndex
androwIndex
.- Specified by:
getValueAt
in interfaceTableModel
- Parameters:
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queried- Returns:
- the value Object at the specified cell
-
getColumnWidth
public int getColumnWidth(int columnIndex) Specifies the default initial width of a column from this model. Should only be queried at table creation time.- Specified by:
getColumnWidth
in interfaceColumnSizingTableModel
- Parameters:
columnIndex
- int index of the model's column whose width should be obtained- Returns:
- the width, in the same units used by the TableColumn class's setWidth() method, or -1 to indicate the width should not be forced
-
isSizeToFit
public boolean isSizeToFit(int columnIndex) Specifies whether setWidthToFit() should be enabled on this column- Specified by:
isSizeToFit
in interfaceColumnSizingTableModel
- Parameters:
columnIndex
- int index of the model's column whose width should be obtained- Returns:
- boolean true if sizeWidthToFit() should be called on this column
-
txIGatedStationAdded
public void txIGatedStationAdded(int index) Inform listener that a station has been added to the list of I-gated stations.- Specified by:
txIGatedStationAdded
in interfaceDigipeater.TXIGatedStationStatusListener
- Parameters:
index
- position in list of I-gated stations
-
txIGatedStationUpdated
public void txIGatedStationUpdated(int index) Inform listener that a station has been forwarded again.- Specified by:
txIGatedStationUpdated
in interfaceDigipeater.TXIGatedStationStatusListener
- Parameters:
index
- position in list of I-gated stations
-
txIGatedStationDeleted
public void txIGatedStationDeleted(int index) Inform listener that a station is no longer being I-gated by this station (timed out).- Specified by:
txIGatedStationDeleted
in interfaceDigipeater.TXIGatedStationStatusListener
- Parameters:
index
- position in list of I-gated stations
-
close
public void close()Closes this table model and releases any system resources associated with it. If the table model is already closed then invoking this method has no effect.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-