Class EventTableModel

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.table.TableModel

    public class EventTableModel
    extends javax.swing.table.AbstractTableModel
    The event table for configuring an SCR Model.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Patricia Derler
    See Also:
    Serialized Form
    Pt.AcceptedRating:
    Red (pd)
    Pt.ProposedRating:
    Red (pd)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​Token> _tokenMap
      Map from input port name to input value.
      • Fields inherited from class javax.swing.table.AbstractTableModel

        listenerList
    • Constructor Summary

      Constructors 
      Constructor Description
      EventTableModel​(Parameter parameter, FSMActor model)
      Construct a new event table model for a given parameter and the FSMActor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addColumn()
      Add a column.
      void checkDisjointness()
      Check that all modes are unique.
      void deleteColumn​(int index)
      Delete a column.
      int getColumnCount()
      Get the column count.
      int getRowCount()
      Return the row count.
      java.lang.Object getValueAt​(int rowIndex, int columnIndex)  
      boolean isCellEditable​(int rowIndex, int columnIndex)
      Return true, indicating that the cell is editable.
      void saveModel()
      Save the model.
      void setValueAt​(java.lang.Object aValue, int rowIndex, int columnIndex)  
      • Methods inherited from class javax.swing.table.AbstractTableModel

        addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _tokenMap

        protected java.util.Map<java.lang.String,​Token> _tokenMap
        Map from input port name to input value. The fire() method populates this map. This is protected so that if a subclass overrides fire(), it can determine the values of the inputs.
    • Constructor Detail

      • EventTableModel

        public EventTableModel​(Parameter parameter,
                               FSMActor model)
        Construct a new event table model for a given parameter and the FSMActor. Initialize the column count to 3.
        Parameters:
        parameter - The parameter
        model - The model
    • Method Detail

      • checkDisjointness

        public void checkDisjointness()
                               throws IllegalActionException
        Check that all modes are unique. -- by definition Check that all values are unique. Check that pairwise OR of events in a row is always false. --- check coverage: AND of all events in a row is true
        Throws:
        IllegalActionException - If thrown while checking the disjointness.
      • getValueAt

        public java.lang.Object getValueAt​(int rowIndex,
                                           int columnIndex)
      • setValueAt

        public void setValueAt​(java.lang.Object aValue,
                               int rowIndex,
                               int columnIndex)
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.AbstractTableModel
      • isCellEditable

        public boolean isCellEditable​(int rowIndex,
                                      int columnIndex)
        Return true, indicating that the cell is editable.
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
        Parameters:
        rowIndex - The rowIndex, which is ignored in this base class.
        columnIndex - The columnIndex.
        Returns:
        return true if columnIndex is greater than 0.
      • getRowCount

        public int getRowCount()
        Return the row count.
        Returns:
        the row count
      • addColumn

        public void addColumn()
        Add a column.
      • deleteColumn

        public void deleteColumn​(int index)
        Delete a column.
        Parameters:
        index - The column to be deleted.
      • getColumnCount

        public int getColumnCount()
        Get the column count.
        Returns:
        The columnt count.