Class MessageStore_.TableModel

java.lang.Object
javax.swing.table.AbstractTableModel
eu.bandm.tools.message.MessageStore_.TableModel
All Implemented Interfaces:
Serializable, TableModel
Enclosing class:
MessageStore_<M extends Message>

public class MessageStore_.TableModel extends AbstractTableModel
Standard specialisation of AbstractTableModel. Usage is
     frame = new javax.swing.JFrame();
     frame.getContentPane().add(new javax.swing.JTable
                                 (myMessageStore.getTableModel())
                               );
     frame.pack();
     frame.setVisibility(true);
  
Own specializations are inserted by ...
     class myTableModel extends MessageStore.TableModel {...}
     myMessageStore.setTableModel(myMessageStore.new MyTableModel()) ;
  
See Also:
  • Constructor Details

    • TableModel

      public TableModel()
  • Method Details

    • getIndent

      public int getIndent(int row)
      Indentation level of the given table row nubmer.
      Parameters:
      row - for which indentation is requested.
      Returns:
      the indentation level of the given table row nubmer.
    • notifyAdd

      public void notifyAdd(int pos)
      Nofication that at the given position the data has changed. Triggers graphic repainting.
      Parameters:
      pos - where an message has been added or inserted.
    • notifySortingChanged

      public void notifySortingChanged()
      Nofication that potentially everywhere the data may have changed. Triggers graphic repainting.
    • getRowCount

      public int getRowCount()
      Deliver the total number of rows currently in the model storage. Callback needed by the Swing kernel.
      Returns:
      the row count in the model storage.
    • getColumnCount

      public int getColumnCount()
      Deliver the number of columns. Callback needed by the Swing kernel.
      Returns:
      the number of columns, fixed to 2 (location and text).
    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Return that no cell is editable.
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
      Parameters:
      row - the row number which is inquired.
      column - the column number which is inquired.
      Returns:
      false for every cell.
    • getValueAt

      public Object getValueAt(int row, int column)
      Callback defined by the Swing kernel to retrieve the data to render in the table cell. Here the message in the row will be returned for all columns; the renderer of a particular column must extract its info.
      Parameters:
      row - the row number which is inquired.
      column - the column number which is inquired.
      Returns:
      the message stored in the given row.