Class ExpressionWatchPanel.TableModel

    • Constructor Detail

      • TableModel

        public TableModel​(Variables variables)
        Initializes the model.
        Parameters:
        variables - the Variables instance to use
    • Method Detail

      • setVariables

        public void setVariables​(Variables value)
        Sets the underlying Variables instance.
        Parameters:
        value - the instance to use
      • getVariables

        public Variables getVariables()
        Returns the underlying Variables instance.
        Returns:
        the instance in use
      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the table.
        Specified by:
        getColumnCount in interface TableModel
        Returns:
        always 3
      • getRowCount

        public int getRowCount()
        Returns the number of rows in the table.
        Specified by:
        getRowCount in interface TableModel
        Returns:
        the number of rows
      • refreshExpression

        protected void refreshExpression​(int rowIndex,
                                         boolean fireUpdate)
        Refreshes the value at the specified position.
        Parameters:
        rowIndex - the value to refresh
        fireUpdate - whether to fire an update event
      • refreshExpression

        public void refreshExpression​(int rowIndex)
        Refreshes the value at the specified position.
        Parameters:
        rowIndex - the value to refresh
      • refreshAllExpressions

        public void refreshAllExpressions()
        Refreshes the value of all expressions.
      • getExpressionAt

        public String getExpressionAt​(int rowIndex)
        Returns the expression at the specified position.
        Parameters:
        rowIndex - the row of the expression
        Returns:
        the expression
      • getTypeAt

        public ExpressionWatchPanel.ExpressionType getTypeAt​(int rowIndex)
        Returns the type at the specified position.
        Parameters:
        rowIndex - the row of the expression
        Returns:
        the type
      • getValueAt

        public Object getValueAt​(int rowIndex,
                                 int columnIndex)
        Returns the value at the specified position.
        Specified by:
        getValueAt in interface TableModel
        Parameters:
        rowIndex - the row of the cell
        columnIndex - the column of the cell
        Returns:
        the value of the cell
      • getColumnClass

        public Class getColumnClass​(int columnIndex)
        Returns the class of the column.
        Specified by:
        getColumnClass in interface TableModel
        Overrides:
        getColumnClass in class AbstractTableModel
        Parameters:
        columnIndex - the index of the column
        Returns:
        the class for the specified column
      • clear

        public void clear()
        Clears the internal model.
        Specified by:
        clear in interface ClearableModel
      • fixExpression

        public String fixExpression​(String expr,
                                    ExpressionWatchPanel.ExpressionType type)
        Fixes an expression. In case of VARIABLE, surrounding () are removed.
        Parameters:
        expr - the expression to add
        type - the type of the expression
      • updateExpression

        public void updateExpression​(int rowIndex,
                                     String expr,
                                     ExpressionWatchPanel.ExpressionType type)
        Updates an expression.
        Parameters:
        rowIndex - the index of the expression
        expr - the new expression
        type - the type of the new expression
      • removeExpression

        public void removeExpression​(int rowIndex)
        Removes the expression at the specified position.
        Parameters:
        rowIndex - the row of the expression to remove