Class InspectorTableModel

    • Constructor Detail

      • InspectorTableModel

        public InspectorTableModel​(String[] col_names,
                                   int i)
        the constructor, adding a TableModelListener. if the table is changed, invoke the corresponding setter from the AttributeMapI.validSetterMap() to change the value of the inspectedAtt
        Parameters:
        col_names - all the attribute names in the first column
        i - the row number
    • Method Detail

      • setPropNames

        public void setPropNames​(ArrayList<String> props)
        set the attribute names in the 1st column
        Parameters:
        props - the attribute name list
      • getPropNames

        public ArrayList<String> getPropNames()
        get the attribute name list in the 1st column
        Returns:
        the attribute name list
      • getValueAt

        public Object getValueAt​(int row,
                                 int col)
        get the value of the table, names are stored in 1st column values are stored in 2nd column
        Specified by:
        getValueAt in interface TableModel
        Overrides:
        getValueAt in class DefaultTableModel
        Parameters:
        row - row number
        col - column number
        Returns:
        the value at the given row and column
      • setValueAt

        public void setValueAt​(Object value,
                               int row,
                               int col)
        change the value at the given row and column
        Specified by:
        setValueAt in interface TableModel
        Overrides:
        setValueAt in class DefaultTableModel
        Parameters:
        value - the new value
        row - row number
        col - column number
      • isCellEditable

        public boolean isCellEditable​(int row,
                                      int col)
        the 1st name column cannot be edited
        Specified by:
        isCellEditable in interface TableModel
        Overrides:
        isCellEditable in class DefaultTableModel
        Parameters:
        row - row number
        col - column number
        Returns:
        true if column != 0