Class BlacklistTableModel

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

public class BlacklistTableModel extends AbstractTableModel
This class makes the list of digipeater blacklisted callsigns visible as an editable table view by implementing a Swing TableModel.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • BlacklistTableModel

      public BlacklistTableModel()
      Create a BlacklistTableModel.
  • Method Details

    • getElementAt

      public static Digipeater.BlacklistMask getElementAt(int index)
      Returns the value at the specified index.
      Parameters:
      index - the requested index
      Returns:
      the value at index
    • getRowCount

      public int getRowCount()
      Returns the length of the list.
      Returns:
      the length of the list
    • getColumnCount

      public int getColumnCount()
      Get the number of columns in the table model.
      Returns:
      column count
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
      Obtain the value of a particular cell in the table.
      Parameters:
      rowIndex - zero-based row index of the cell
      columnIndex - zero-based column index of the cell
      Returns:
      the value of the cell
    • getColumnName

      public String getColumnName(int column)
      Get the localizd name for the column header.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
      Parameters:
      column - zero-based column index
      Returns:
      String title of the column
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Get the Class of values in the specified column.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
      Parameters:
      columnIndex - zero-based column index
      Returns:
      Class of data values from cells in the column
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Indicate whether the specified cell is editable.
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
      Parameters:
      rowIndex - zero-based row index of the cell
      columnIndex - zero-based column index of the cell
      Returns:
      boolean true if cell is editable
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Set the value of an editable table cell.
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
      Parameters:
      aValue - new value for the cell
      rowIndex - zero-based row index of the cell
      columnIndex - zero-based column index of the cell
    • addToBlacklist

      public void addToBlacklist(String callsign)
      Add a callsign to the blacklist.
      Parameters:
      callsign - String of callsign
    • removeFromBlacklist

      public void removeFromBlacklist(String callsign)
      Remove a callsign from the blacklist.
      Parameters:
      callsign - String of callsign