Class ConnectionModel

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

public class ConnectionModel extends AbstractTableModel implements ColumnSizingTableModel, ConnStateChangeListener
This presents the current list of AX.25 connected sessions managed by this process's AX.25 stack as a table view.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • ConnectionModel

      public ConnectionModel()
      Create a TableModel for viewing the current AX.25 connected-mode sessions observed by this instance of YAAC.
  • 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:
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Returns rendering data type for each column of the table.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
      Parameters:
      columnIndex - the column being queried
      Returns:
      the Object.class
    • getColumnName

      public String getColumnName(int column)
      Returns the localized name for each 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
    • 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
    • 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
    • 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
    • updateConnStateRow

      public void updateConnStateRow(AX25Callsign sender, AX25Callsign dest)
      Report that the row containing the specified pair of callsigns has been updated. This is expected to be called from a thread other than the AWT dispatch thread.
      Specified by:
      updateConnStateRow in interface ConnStateChangeListener
      Parameters:
      sender - AX25Callsign of originator of session
      dest - AX25Callsign of recipient of session
    • updateWholeConStateTable

      public void updateWholeConStateTable()
      Report that a ConnState session has been added or removed from the AX25Stack, but we don't know which row number it is. This is expected to be called from a thread other than the AWT dispatch thread.
      Specified by:
      updateWholeConStateTable in interface ConnStateChangeListener