Class EffectsTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
edu.tufts.hrilab.action.gui.tablemodels.EffectsTableModel
All Implemented Interfaces:
Serializable, TableModel

public class EffectsTableModel extends DefaultTableModel
Model for the JTable containing effects. Provides various helper methods and takes care of handling the actual java types.
See Also:
  • Constructor Details

    • EffectsTableModel

      public EffectsTableModel(ActionDBEntry dbe)
      Initializes the table with the above defined column names.
  • Method Details

    • setEffects

      public void setEffects(ActionDBEntry dbe)
      Sets the roles of a DBEntry in the table.
      Parameters:
      dbe - DBEntry
    • exportEffects

      public boolean exportEffects(ActionDBEntry.Builder adbeb)
      Export the current effects to an ActionDBEntry Builder object.
      Parameters:
      adbeb - builder
      Returns:
      true if success
    • getColumnClass

      public Class getColumnClass(int c)
      JTable uses this method to determine the default renderer/ editor for each cell.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
      Parameters:
      c - the column being queried
      Returns:
      the class represented in the column
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Disable editing of the first row (default post condition)
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class DefaultTableModel
      Parameters:
      rowIndex -
      columnIndex -
      Returns: