Class SignallingSourcePanel.SignalMastAspectModel

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.swing.table.TableModel
    Enclosing class:
    SignallingSourcePanel

    public class SignallingSourcePanel.SignalMastAspectModel
    extends javax.swing.table.AbstractTableModel
    implements java.beans.PropertyChangeListener
    TableModel to store SML control Signal Masts and their Set To Aspect.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void configEditColumn​(javax.swing.JTable table)
      Display buttons in 2 columns of the manual control signal masts table.
      void configureTable​(javax.swing.JTable table)  
      protected void deletePair​(int r)  
      void dispose()
      Remove references to and from this object, so that it can eventually be garbage-collected.
      protected void editPair​(int r)
      Respond to the Edit Logic button being clicked.
      java.lang.Class<?> getColumnClass​(int c)  
      int getColumnCount()
      Get the number of columns in the signal masts table.
      java.lang.String getColumnName​(int col)  
      int getPreferredWidth​(int col)  
      int getRowCount()
      Get the number of Included signal masts for this SML.
      java.lang.Object getValueAt​(int r, int c)
      Retrieve the contents to display in a cell in the table, in terms of model
      boolean isCellEditable​(int r, int c)
      Query whether the cells in a table column should respond to clicks.
      void propertyChange​(java.beans.PropertyChangeEvent e)
      Listen for changes to specific properties of the displayed Signal Masts.
      protected void setColumnToHoldButton​(javax.swing.JTable table, int column, javax.swing.JButton sample)
      Helper function for configEditColumn(JTable).
      void setSetToState​(java.lang.String x)  
      void setValueAt​(java.lang.Object type, int r, int c)
      Process the contents from a table cell, in terms of model
      (package private) void updateSignalMastLogic​(SignalMastLogic smlOld, SignalMastLogic smlNew)  
      • 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

      • getColumnClass

        public java.lang.Class<?> getColumnClass​(int c)
        Specified by:
        getColumnClass in interface javax.swing.table.TableModel
        Overrides:
        getColumnClass in class javax.swing.table.AbstractTableModel
      • configureTable

        public void configureTable​(javax.swing.JTable table)
      • 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
      • dispose

        public void dispose()
        Remove references to and from this object, so that it can eventually be garbage-collected.
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Listen for changes to specific properties of the displayed Signal Masts.
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
        Parameters:
        e - The ChangeEvent heard
      • configEditColumn

        protected void configEditColumn​(javax.swing.JTable table)
        Display buttons in 2 columns of the manual control signal masts table.
        Parameters:
        table - The control signal mast table to be configured
      • setColumnToHoldButton

        protected void setColumnToHoldButton​(javax.swing.JTable table,
                                             int column,
                                             javax.swing.JButton sample)
        Helper function for configEditColumn(JTable).
        Parameters:
        table - The control signal mast table to be configured
        column - Index for the column to put the button in
        sample - JButton to put there
      • getColumnCount

        public int getColumnCount()
        Get the number of columns in the signal masts table.
        Specified by:
        getColumnCount in interface javax.swing.table.TableModel
        Returns:
        Fixed value of 6
      • isCellEditable

        public boolean isCellEditable​(int r,
                                      int c)
        Query whether the cells in a table column should respond to clicks.
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.AbstractTableModel
        Parameters:
        r - Index for the cell row
        c - Index for the cell column
      • editPair

        protected void editPair​(int r)
        Respond to the Edit Logic button being clicked.
        Parameters:
        r - Index for the cell row
      • deletePair

        protected void deletePair​(int r)
      • setSetToState

        public void setSetToState​(java.lang.String x)
      • getRowCount

        public int getRowCount()
        Get the number of Included signal masts for this SML.
        Specified by:
        getRowCount in interface javax.swing.table.TableModel
      • getValueAt

        public java.lang.Object getValueAt​(int r,
                                           int c)
        Retrieve the contents to display in a cell in the table, in terms of model
        Specified by:
        getValueAt in interface javax.swing.table.TableModel
        Parameters:
        r - index for the cell row
        c - index for the cell column
        Returns:
        The value (text) stored in the cell
      • setValueAt

        public void setValueAt​(java.lang.Object type,
                               int r,
                               int c)
        Process the contents from a table cell, in terms of model
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.AbstractTableModel
        Parameters:
        type - the object type of the cell contents
        r - index for the cell row
        c - index for the cell column