Class TimeSeriesTableModel

    • Constructor Detail

      • TimeSeriesTableModel

        public TimeSeriesTableModel()
        Default constructor.
      • TimeSeriesTableModel

        public TimeSeriesTableModel​(TimeSeries series)
        Constructs a table model for a time series.
        Parameters:
        series - the time series.
      • TimeSeriesTableModel

        public TimeSeriesTableModel​(TimeSeries series,
                                    boolean editable)
        Creates a table model based on a time series.
        Parameters:
        series - the time series.
        editable - if true, the table is editable.
    • Method Detail

      • getColumnCount

        public int getColumnCount()
        Returns the number of columns in the table model. For this particular model, the column count is fixed at 2.
        Specified by:
        getColumnCount in interface TableModel
        Returns:
        The column count.
      • getRowCount

        public int getRowCount()
        Returns the number of rows in the table model.
        Specified by:
        getRowCount in interface TableModel
        Returns:
        The row count.
      • getValueAt

        public Object getValueAt​(int row,
                                 int column)
        Returns the data value for a cell in the table model.
        Specified by:
        getValueAt in interface TableModel
        Parameters:
        row - the row number.
        column - the column number.
        Returns:
        The data value for a cell in the table model.
      • isCellEditable

        public boolean isCellEditable​(int row,
                                      int column)
        Returns a flag indicating whether or not the specified cell is editable.
        Specified by:
        isCellEditable in interface TableModel
        Overrides:
        isCellEditable in class AbstractTableModel
        Parameters:
        row - the row number.
        column - the column number.
        Returns:
        true if the specified cell is editable.
      • setValueAt

        public void setValueAt​(Object value,
                               int row,
                               int column)
        Updates the time series.
        Specified by:
        setValueAt in interface TableModel
        Overrides:
        setValueAt in class AbstractTableModel
        Parameters:
        value - the new value.
        row - the row.
        column - the column.
      • seriesChanged

        public void seriesChanged​(SeriesChangeEvent event)
        Receives notification that the time series has been changed. Responds by firing a table data change event.
        Specified by:
        seriesChanged in interface SeriesChangeListener
        Parameters:
        event - the event.