Class AutomatTableDataModel

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

    public class AutomatTableDataModel
    extends javax.swing.table.AbstractTableModel
    Table data model for display of Automat instances.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int KILLCOL  
      (package private) static int NAMECOL  
      (package private) static int NUMCOLUMN  
      (package private) AutomatSummary summary  
      (package private) static int TURNSCOL  
      • Fields inherited from class javax.swing.table.AbstractTableModel

        listenerList
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configureTable​(javax.swing.JTable table)
      Configure a table to have our standard rows and columns.
      void dispose()  
      java.lang.Class<?> getColumnClass​(int col)
      Note that this returns String even for columns that contain buttons.
      int getColumnCount()  
      java.lang.String getColumnName​(int col)  
      int getPreferredWidth​(int col)  
      int getRowCount()  
      java.lang.Object getValueAt​(int row, int col)  
      boolean isCellEditable​(int row, int col)  
      (package private) void setColumnToHoldButton​(javax.swing.JTable table, int column, javax.swing.JButton sample)
      Service method to setup a column so that it will hold a button for its values
      void setValueAt​(java.lang.Object value, int row, int col)  
      • Methods inherited from class javax.swing.table.AbstractTableModel

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

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

      • getColumnName

        public java.lang.String getColumnName​(int col)
        Specified by:
        getColumnName in interface javax.swing.table.TableModel
        Overrides:
        getColumnName in class javax.swing.table.AbstractTableModel
      • getColumnClass

        public java.lang.Class<?> getColumnClass​(int col)
        Note that this returns String even for columns that contain buttons.
        Specified by:
        getColumnClass in interface javax.swing.table.TableModel
        Overrides:
        getColumnClass in class javax.swing.table.AbstractTableModel
      • isCellEditable

        public boolean isCellEditable​(int row,
                                      int col)
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int col)
      • setValueAt

        public void setValueAt​(java.lang.Object value,
                               int row,
                               int col)
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.AbstractTableModel
      • configureTable

        public void configureTable​(javax.swing.JTable table)
        Configure a table to have our standard rows and columns. This is optional, in that other table formats can use this table model. But we put it here to help keep it consistent.
        Parameters:
        table - the table to configure
      • setColumnToHoldButton

        void setColumnToHoldButton​(javax.swing.JTable table,
                                   int column,
                                   javax.swing.JButton sample)
        Service method to setup a column so that it will hold a button for its values
        Parameters:
        table - the table in which to configure the column
        column - the position of the configured column
        sample - typical button, used for size