Package jadex.tools.comanalyzer.table
Class MessageTableModel
- java.lang.Object
- 
- javax.swing.table.AbstractTableModel
- 
- jadex.tools.comanalyzer.table.MessageTableModel
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- javax.swing.table.TableModel
 
 public class MessageTableModel extends javax.swing.table.AbstractTableModelThe table model for messages. It uses a sorted list to store the messages, cause the sequence of messages must be conserved regardless of their insertion time.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.util.ListCOLUMN_HEADERSList of all available column headers.protected SortedListmessagesSortedList of messages in table model.
 - 
Constructor SummaryConstructors Constructor Description MessageTableModel()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddMessage(Message message)Add a message to the tablevoidaddMessages(Message[] messages)Add an array of message to the table.booleancontainsMessage(Message message)Returnstrueif the message is in the tablejava.lang.ClassgetColumnClass(int columnIndex)Returns the class of columncolumnIndex.intgetColumnCount()Returns the number of columns in the modeljava.lang.StringgetColumnName(int columnIndex)Returns the name for the column.MessagegetMessage(int i)Returns the message at row i.intgetRowCount()Returns the number of rows in the model.java.lang.ObjectgetValueAt(int rowIndex, int columnIndex)Returns the value for the cell atcolumnIndexandrowIndex.voidremoveAllMessages()Remove all messages from table.booleanremoveMessage(Message message)Remove a message from the table.- 
Methods inherited from class javax.swing.table.AbstractTableModeladdTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
- 
 
- 
- 
- 
Field Detail- 
COLUMN_HEADERSpublic static final java.util.List COLUMN_HEADERS List of all available column headers.
 - 
messagesprotected SortedList messages SortedList of messages in table model.
 
- 
 - 
Method Detail- 
addMessagepublic boolean addMessage(Message message) Add a message to the table- Parameters:
- message- The message to add.
- Returns:
- trueif success
 
 - 
removeMessagepublic boolean removeMessage(Message message) Remove a message from the table.- Parameters:
- message- The message to remove.
- Returns:
- trueif success
 
 - 
addMessagespublic void addMessages(Message[] messages) Add an array of message to the table.- Parameters:
- messages- The Array of messages to add.
 
 - 
removeAllMessagespublic void removeAllMessages() Remove all messages from table.
 - 
getColumnCountpublic int getColumnCount() Returns the number of columns in the model- Returns:
- The number of columns in the model
 
 - 
getRowCountpublic int getRowCount() Returns the number of rows in the model.- Returns:
- the number of rows in the model
 
 - 
getValueAtpublic java.lang.Object getValueAt(int rowIndex, int columnIndex)Returns the value for the cell atcolumnIndexandrowIndex.- 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
 
 - 
getColumnNamepublic java.lang.String getColumnName(int columnIndex) Returns the name for the column.- Specified by:
- getColumnNamein interface- javax.swing.table.TableModel
- Overrides:
- getColumnNamein class- javax.swing.table.AbstractTableModel
- Parameters:
- column- The column being queried
- Returns:
- A string containing the default name of column
 
 - 
getColumnClasspublic java.lang.Class getColumnClass(int columnIndex) Returns the class of columncolumnIndex.- Specified by:
- getColumnClassin interface- javax.swing.table.TableModel
- Overrides:
- getColumnClassin class- javax.swing.table.AbstractTableModel
- Parameters:
- columnIndex- The column being queried
- Returns:
- the class of column columnIndex
 
 - 
containsMessagepublic boolean containsMessage(Message message) Returnstrueif the message is in the table- Parameters:
- message- The message queried
- Returns:
- trueif the message exist
 
 - 
getMessagepublic Message getMessage(int i) Returns the message at row i.- Parameters:
- i- The row with the message.
- Returns:
- The message at row i.
 
 
- 
 
-