Class SprogSlotMonDataModel

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ADDRCOLUMN  
      static int DIRCOLUMN  
      (package private) static java.lang.Boolean False  
      static int NUMCOLUMN  
      static int SLOTCOLUMN  
      static int SPDCOLUMN  
      static int STATCOLUMN  
      (package private) static java.lang.Boolean True  
      • 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 slotTable)
      Configure a table to have our standard rows and columns.
      void dispose()  
      java.lang.Class<?> getColumnClass​(int col)  
      int getColumnCount()  
      java.lang.String getColumnName​(int col)  
      int getPreferredWidth​(int col)  
      int getRowCount()
      Return the number of rows to be displayed.
      java.lang.Object getValueAt​(int row, int col)  
      boolean isCellEditable​(int row, int col)  
      void notifyChangedSlot​(SprogSlot s)  
      void setValueAt​(java.lang.Object value, int row, int col)  
      void showAllSlots​(boolean val)  
      protected int slotNum​(int row)
      Return slot number for a specific row.
      • 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

      • getRowCount

        public int getRowCount()
        Return the number of rows to be displayed. This can vary depending on whether only active rows are displayed.

        This should probably use a local cache instead of counting/searching each time.

        Specified by:
        getRowCount in interface javax.swing.table.TableModel
      • getColumnCount

        public int getColumnCount()
        Specified by:
        getColumnCount in interface javax.swing.table.TableModel
      • 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)
        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)
        Specified by:
        getValueAt in interface javax.swing.table.TableModel
      • 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 slotTable)
        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:
        slotTable - the slot table to configure.
      • slotNum

        protected int slotNum​(int row)
        Return slot number for a specific row.

        This should probably use a local cache instead of counting/searching each time.

        Parameters:
        row - Row number in the displayed table
        Returns:
        Matching slot number