Class LastDigipeatFilterUI

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

This filter accepts or rejects messages based on the last station to transmit the message.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • LastDigipeatFilterUI

      public LastDigipeatFilterUI(LastDigipeatFilter myFilter)
      Create a UI for controlling a LastDigipeatFilter
      Parameters:
      myFilter - the LastDigipeatFilter instance to control
      See Also:
  • Method Details

    • 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:
    • 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
    • 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
    • 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
    • getColumnName

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

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Indicate whether the specified table cell can be edited.
      Specified by:
      isCellEditable in interface TableModel
      Parameters:
      rowIndex - zero-based row index in the table
      columnIndex - zero-based column index in the table
      Returns:
      boolean true if user can edit the cell
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Set the value of the table cell.
      Specified by:
      setValueAt in interface TableModel
      Parameters:
      aValue - value to store in the cell
      rowIndex - zero-based row index in the table
      columnIndex - zero-based column index in the table
    • digipeaterAdded

      public void digipeaterAdded(String digipeat)
      Report when a new digipeater is identified.
      Specified by:
      digipeaterAdded in interface DigipeatListener
      Parameters:
      digipeat - String callsign of digipeater
    • digipeaterUsedAgain

      public void digipeaterUsedAgain(String digipeat)
      Report when a digipeater is used again.
      Specified by:
      digipeaterUsedAgain in interface DigipeatListener
      Parameters:
      digipeat - String callsign of digipeater
    • 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
    • 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
    • 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
    • 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