com.dlsc.flexgantt.swing

## Class MessageTableModel

- java.lang.Object
- - javax.swing.table.AbstractTableModel
  - - com.dlsc.flexgantt.swing.MessageTableModel

- All Implemented Interfaces:
    IMessageListener, Serializable, EventListener, TableModel
  Direct Known Subclasses:
    ConstraintViolationTableModel

      public class MessageTableModel
      extends AbstractTableModel
      implements IMessageListener

  The table model used by the dialog's table. The model attaches itself as a `IMessageListener` to the Gantt chart and updates itself based on the incoming messages.
  Since:
    1.0
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class javax.swing.table.AbstractTableModel

      `listenerList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessageTableModel(AbstractGanttChart gc)` Constructs a new model for the given Gantt chart.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getColumnCount()`
    `IMessage` | `getMessageInRow(int row)` A utility method for easily retrieving the message displayed in the given row.
    `int` | `getRowCount()`
    `Object` | `getValueAt(int rowIndex, int columnIndex)`
    `void` | `messageAdded(IMessage msg)` Called when a message has been added.
    `void` | `messageRemoved(IMessage msg)` Called when a message has been removed.
    `void` | `messagesCleared()` Called when all messages have been removed.

    - ### Methods inherited from class javax.swing.table.AbstractTableModel

      `addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MessageTableModel

          public MessageTableModel(AbstractGanttChart gc)

      Constructs a new model for the given Gantt chart.
      Parameters:
        `gc` - the Gantt chart
      Since:
        1.0

  - ### Method Detail

    - #### getRowCount

          public int getRowCount()

      Specified by:
        `getRowCount` in interface `TableModel`

    - #### getColumnCount

          public int getColumnCount()

      Specified by:
        `getColumnCount` in interface `TableModel`

    - #### getValueAt

          public Object getValueAt(int rowIndex,
                                   int columnIndex)

      Specified by:
        `getValueAt` in interface `TableModel`

    - #### getMessageInRow

          public IMessage getMessageInRow(int row)

      A utility method for easily retrieving the message displayed in the given row.
      Parameters:
        `row` - the table row
      Returns:
        the message in the given row
      Since:
        1.0

    - #### messageAdded

          public void messageAdded(IMessage msg)

      Description copied from interface: `IMessageListener`
      Called when a message has been added.
      Specified by:
        `messageAdded` in interface `IMessageListener`
      Parameters:
        `msg` - the added message

    - #### messageRemoved

          public void messageRemoved(IMessage msg)

      Description copied from interface: `IMessageListener`
      Called when a message has been removed.
      Specified by:
        `messageRemoved` in interface `IMessageListener`
      Parameters:
        `msg` - the removed message

    - #### messagesCleared

          public void messagesCleared()

      Description copied from interface: `IMessageListener`
      Called when all messages have been removed.
      Specified by:
        `messagesCleared` in interface `IMessageListener`

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.