Package org.ka2ddo.yaac.gui
Class TrackedStationTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.TrackedStationTableModel
- All Implemented Interfaces:
Serializable
,TableModel
,FireTableModel
This singleton table model manages UI access to the
WatchedStationsTracker
.- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener to the list that's notified each time a change to the data model occurs.Class<?>
getColumnClass
(int columnIndex) Returns Class of the column values.int
Returns the number of columns in the model.getColumnName
(int column) Return the label for this table column.int
Returns the number of rows in the model.static TableModel
Get a table model that allows viewing and manipulating the list of individually tracked stations.getValueAt
(int rowIndex, int columnIndex) Returns the value for the cell atcolumnIndex
androwIndex
.boolean
isCellEditable
(int rowIndex, int columnIndex) Indicate if a table cell is editable.void
Removes a listener from the list that's notified each time a change to the data model occurs.static void
setShowSoundsColumn
(boolean showSoundsColumn) Specify whether the makeSounds column should be displayed.void
setValueAt
(Object aValue, int rowIndex, int columnIndex) This empty implementation is provided so users don't have to implement this method if their data model is not editable.Methods inherited from class javax.swing.table.AbstractTableModel
findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ka2ddo.yaac.core.FireTableModel
fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged
-
Method Details
-
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:
-
getColumnCount
public int getColumnCount()Returns the number of columns in the model. AJTable
uses this method to determine how many columns it should create and display by default.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns 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
-
getColumnName
Return the label for this table column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column being queried- Returns:
- a string containing the name of
column
-
getColumnClass
Returns Class of the column values.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
- Parameters:
columnIndex
- the column being queried- Returns:
- the Class for the specified column's values
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) Indicate if a table cell is editable.- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
rowIndex
- the row being queriedcolumnIndex
- the column being queried- Returns:
- boolean true if table cell is editable (i.e., safe to call setValueAt()
-
setValueAt
This empty implementation is provided so users don't have to implement this method if their data model is not editable.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
- Parameters:
aValue
- value to assign to cellrowIndex
- row of cellcolumnIndex
- column of cell
-
addTableModelListener
Adds a listener to the list that's notified each time a change to the data model occurs.- Specified by:
addTableModelListener
in interfaceTableModel
- Overrides:
addTableModelListener
in classAbstractTableModel
- Parameters:
l
- the TableModelListener
-
removeTableModelListener
Removes a listener from the list that's notified each time a change to the data model occurs.- Specified by:
removeTableModelListener
in interfaceTableModel
- Overrides:
removeTableModelListener
in classAbstractTableModel
- Parameters:
l
- the TableModelListener
-
getTrackedStationTableModel
Get a table model that allows viewing and manipulating the list of individually tracked stations.- Returns:
- TableModel
-
setShowSoundsColumn
public static void setShowSoundsColumn(boolean showSoundsColumn) Specify whether the makeSounds column should be displayed.- Parameters:
showSoundsColumn
- boolean true if makeSounds column is included in the table
-