Class TrackedStationTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
org.ka2ddo.yaac.gui.TrackedStationTableModel
All Implemented Interfaces:
Serializable, TableModel, FireTableModel

public class TrackedStationTableModel extends AbstractTableModel implements FireTableModel
This singleton table model manages UI access to the WatchedStationsTracker.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Method Details

    • getRowCount

      public int getRowCount()
      Returns the number of rows in the model. A JTable 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 interface TableModel
      Returns:
      the number of rows in the model
      See Also:
    • getColumnCount

      public int getColumnCount()
      Returns the number of columns in the model. A JTable uses this method to determine how many columns it should create and display by default.
      Specified by:
      getColumnCount in interface TableModel
      Returns:
      the number of columns in the model
      See Also:
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
      Returns the value for the cell at columnIndex and rowIndex.
      Specified by:
      getValueAt in interface TableModel
      Parameters:
      rowIndex - the row whose value is to be queried
      columnIndex - the column whose value is to be queried
      Returns:
      the value Object at the specified cell
    • getColumnName

      public String getColumnName(int column)
      Return the label for this table column.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
      Parameters:
      column - the column being queried
      Returns:
      a string containing the name of column
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Returns Class of the column values.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
      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 interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
      Parameters:
      rowIndex - the row being queried
      columnIndex - the column being queried
      Returns:
      boolean true if table cell is editable (i.e., safe to call setValueAt()
    • setValueAt

      public 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.
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
      Parameters:
      aValue - value to assign to cell
      rowIndex - row of cell
      columnIndex - column of cell
    • addTableModelListener

      public void addTableModelListener(TableModelListener l)
      Adds a listener to the list that's notified each time a change to the data model occurs.
      Specified by:
      addTableModelListener in interface TableModel
      Overrides:
      addTableModelListener in class AbstractTableModel
      Parameters:
      l - the TableModelListener
    • removeTableModelListener

      public void removeTableModelListener(TableModelListener l)
      Removes a listener from the list that's notified each time a change to the data model occurs.
      Specified by:
      removeTableModelListener in interface TableModel
      Overrides:
      removeTableModelListener in class AbstractTableModel
      Parameters:
      l - the TableModelListener
    • getTrackedStationTableModel

      public static TableModel 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