Class SpreadSheetCellSelector.TableModel

    • Field Detail

      • m_Selected

        protected boolean[][] m_Selected
        the matrix indicating whether a cell is selected or not.
    • Constructor Detail

      • TableModel

        public TableModel()
        Initializes the model with an empty spread sheet.
      • TableModel

        public TableModel​(SpreadSheet sheet)
        Initializes the model with the given spread sheet.
        Parameters:
        sheet - the spread sheet to display
      • TableModel

        public TableModel​(SpreadSheet sheet,
                          int numDec)
        Initializes the model with the given spread sheet and number of decimals to display.
        Parameters:
        sheet - the spread sheet to display
        numDec - the number of decimals to display
    • Method Detail

      • setSelected

        public boolean setSelected​(int row,
                                   int col,
                                   boolean selected)
        Sets the selection state of a cell.
        Parameters:
        row - the row of the cell
        col - the column of the cell
        selected - whether selected or not
        Returns:
        if the value got changed
      • isSelected

        public boolean isSelected​(int row,
                                  int col)
        Returns whether a cell is selected or not.
        Parameters:
        row - the row of the cell
        col - the column of the cell
        Returns:
        true if selected