Class SymbolFilter

All Implemented Interfaces:
ImageObserver, MenuContainer, Closeable, Serializable, AutoCloseable, Runnable, Accessible, TableModel, TrackerListener, FilterChangeListener, ColumnSizingTableModel, SaveableFilter

This filter editor selects messages by the APRS symbol code, indicated by symbol table ID and symbol type. The selection information is presented as a table of symbol codes and icons, plus a checkbox for each symbol type to specify which station types are enabled and disabled, and buttons to clear and set all the checkboxes together.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • SymbolFilter

      public SymbolFilter(SymbolFilter myFilter)
      Create the GUI control TableModel for the specified back-end SymbolFilter.
      Parameters:
      myFilter - SymbolFilter to monitor and control
  • Method Details

    • addTableModelListener

      public void addTableModelListener(TableModelListener l)
      Adds a listener to the list that is notified each time a change to the data model occurs.
      Specified by:
      addTableModelListener in interface TableModel
      Parameters:
      l - the TableModelListener
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Returns the data Class for the specified column.
      Specified by:
      getColumnClass in interface TableModel
      Parameters:
      columnIndex - the column being queried
      Returns:
      the Class object for the column's data
    • getColumnCount

      public int getColumnCount()
      Returns the number of columns in the model.
      Specified by:
      getColumnCount in interface TableModel
      Returns:
      the number of columns in the model
      See Also:
    • getColumnName

      public String getColumnName(int columnIndex)
      Returns the localized name for the column.
      Specified by:
      getColumnName in interface TableModel
      Parameters:
      columnIndex - the column being queried
      Returns:
      a string containing the name of column
    • getRowCount

      public int getRowCount()
      Returns the number of rows in the model.
      Specified by:
      getRowCount in interface TableModel
      Returns:
      the number of rows 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
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Returns true if the cell at rowIndex and columnIndex is editable. Otherwise, setValueAt on the cell will not change the value of that cell.
      Specified by:
      isCellEditable in interface TableModel
      Parameters:
      rowIndex - the row whose value to be queried
      columnIndex - the column whose value to be queried
      Returns:
      true if the cell is editable
      See Also:
    • removeTableModelListener

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

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Sets the value in the cell at columnIndex and rowIndex to aValue.
      Specified by:
      setValueAt in interface TableModel
      Parameters:
      aValue - the new value
      rowIndex - the row whose value is to be changed
      columnIndex - the column whose value is to be changed
      See Also:
    • 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 interface ColumnSizingTableModel
      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 interface ColumnSizingTableModel
      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
    • isSaveable

      public boolean isSaveable()
      Indicate if this Filter is saveable. Meant for use by combining filters whose sub-Filters may not all be savable.
      Specified by:
      isSaveable in interface SaveableFilter
      Returns:
      boolean true if the current Filter can be saved
    • getPreferredFileType

      public FileNameExtensionFilter getPreferredFileType()
      Specify the preferred filetype for files saving this Filter's data set.
      Specified by:
      getPreferredFileType in interface SaveableFilter
      Returns:
      FileNameExtensionFilter that will be used in the saving JFileChooser
    • saveFilterToFile

      public void saveFilterToFile(BufferedOutputStream out) throws IOException
      Save the contents of the Filter to the specified DataOutput object.
      Specified by:
      saveFilterToFile in interface SaveableFilter
      Parameters:
      out - DataOutput implementing object for writing the file contents in its preferred format
      Throws:
      IOException - if the write failed for some reason
    • messageAdded

      public void messageAdded(StationState ss, int index, AX25Message msg)
      Called when a Message is added to the history for a station in the tracker.
      Specified by:
      messageAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based index of the message added to the StationState object
      msg - APRS Message object being added to the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • messageDeleted

      public void messageDeleted(StationState ss, int index, AX25Message msg)
      Called when a AX25Message is deleted from the history for a station in the tracker.
      Specified by:
      messageDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the AX25Message will already be removed from the StationState object
      index - zero-based index of the message removed from the StationState object
      msg - APRS Message object being removed from the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • stationAdded

      public void stationAdded(StationState ss, int index)
      Called when a new station is initially added to the tracker.
      Specified by:
      stationAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the initial AX25Message will not yet be stored within the StationState object
      index - zero-based integer sequence number for this station in the StationTracker
    • stationUpdated

      public void stationUpdated(StationState ss)
      Called when an existing station is updated with new information in the tracker.
      Specified by:
      stationUpdated in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the new AX25Message will not yet be stored within the StationState object
    • stationDeleted

      public void stationDeleted(StationState ss, int index)
      Called when an existing station is deleted from the tracker.
      Specified by:
      stationDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based integer sequence number for this station in the StationTracker
    • run

      public void run()
      Do not call. Used by SwingUtilities.invokeLater() to refresh the table because the table model's statistics data values have changed.
      Specified by:
      run in interface Runnable
    • close

      public void close() throws IOException
      Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException - if an I/O error occurs
    • filterSettingsChanged

      public void filterSettingsChanged(Filter changedFilter, boolean changedByUser)
      Called when the specified Filter's matching criteria have been changed.
      Specified by:
      filterSettingsChanged in interface FilterChangeListener
      Parameters:
      changedFilter - Filter that has changed
      changedByUser - boolean true if change was manually made by user, false if change was made automatically by dynamic filter logic