Class DestinationFilter

All Implemented Interfaces:
ImageObserver, MenuContainer, Closeable, Serializable, AutoCloseable, Accessible, TableModel, DestinationListener, FilterChangeListener, SaveableFilter, FastComparableTableModel

This filter selects messages based on their destination AX.25 address. This is used to support altnets.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • DestinationFilter

      public DestinationFilter(DestinationFilter filter)
      Create a GUI instance for controlling a Destination filter.
      Parameters:
      filter - org.ka2ddo.yaac.filter.DestinationFilter to 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 most specific superclass for all the cell values in the column. This is used by the JTable to set up a default renderer and editor for the column.
      Specified by:
      getColumnClass in interface TableModel
      Parameters:
      columnIndex - the index of the column
      Returns:
      the common ancestor class of the object values in the model.
    • 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:
    • getColumnName

      public String getColumnName(int columnIndex)
      Returns the name of the column at columnIndex. This is used to initialize the table's column header name. Note: this name does not need to be unique; two columns in a table can have the same name.
      Specified by:
      getColumnName in interface TableModel
      Parameters:
      columnIndex - the index of the column
      Returns:
      the name of the column
    • 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:
    • 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:
    • compareRows

      public int compareRows(int rowIndex1, int rowIndex2, int columnIndex)
      Compare the selected column of the two rows.
      Specified by:
      compareRows in interface FastComparableTableModel
      Parameters:
      rowIndex1 - zero-based model row index of first row to compare
      rowIndex2 - zero-based model row index of second row to compare
      columnIndex - zero-based model column index of column to compare
      Returns:
      +1 if the 1st row's column is after the 2nd row's column, -1 if before, or 0 if equal precedence
    • destinationAdded

      public void destinationAdded(String destination, int index)
      Inform listener that a new destination (tocall) has been registered.
      Specified by:
      destinationAdded in interface DestinationListener
      Parameters:
      destination - String callsign or tocall of the AX.25 destination (or original destination if Tx I-gated)
      index - zero-based index of new entry in the list of destinations
    • destinationUsedAgain

      public void destinationUsedAgain(String destination)
      Inform listener that an already-known destination (tocall) has updated its statistics count.
      Specified by:
      destinationUsedAgain in interface DestinationListener
      Parameters:
      destination - String callsign or tocall of the AX.25 destination (or original destination if Tx I-gated)
    • 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
    • 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
    • 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