Пример #1
0
  /**
   * Removes a series from the collection and sends a {@link DatasetChangeEvent} to all registered
   * listeners.
   *
   * @param series the series (<code>null</code> not permitted).
   */
  public void removeSeries(XYSeries series) {

    if (series == null) {
      throw new IllegalArgumentException("Null 'series' argument.");
    }
    if (this.data.contains(series)) {
      series.removeChangeListener(this);
      this.data.remove(series);
      fireDatasetChanged();
    }
  }
Пример #2
0
  /**
   * Removes all the series from the collection and sends a {@link DatasetChangeEvent} to all
   * registered listeners.
   */
  public void removeAllSeries() {
    // Unregister the collection as a change listener to each series in
    // the collection.
    for (int i = 0; i < this.data.size(); i++) {
      XYSeries series = (XYSeries) this.data.get(i);
      series.removeChangeListener(this);
    }

    // Remove all the series from the collection and notify listeners.
    this.data.clear();
    fireDatasetChanged();
  }
Пример #3
0
  /**
   * Removes a series from the collection and sends a {@link DatasetChangeEvent} to all registered
   * listeners.
   *
   * @param series the series index (zero-based).
   */
  public void removeSeries(int series) {

    if ((series < 0) || (series > getSeriesCount())) {
      throw new IllegalArgumentException("Series index out of bounds.");
    }

    // fetch the series, remove the change listener, then remove the series.
    XYSeries ts = (XYSeries) this.data.get(series);
    ts.removeChangeListener(this);
    this.data.remove(series);
    fireDatasetChanged();
  }
Пример #4
0
  /**
   * Removes a series from the collection and sends a {@link DatasetChangeEvent} to all registered
   * listeners.
   *
   * @param series the series (<code>null</code> not permitted).
   */
  public void removeSeries(XYSeries series) {

    // check arguments...
    if (series == null) {
      throw new IllegalArgumentException("Null 'series' argument.");
    }

    // remove the series...
    if (this.data.contains(series)) {
      series.removeChangeListener(this);
      this.data.remove(series);
      if (this.data.size() == 0) {
        this.xPoints.clear();
      }
      fireDatasetChanged();
    }
  }
Пример #5
0
  /**
   * Removes a series from the collection and sends a {@link DatasetChangeEvent} to all registered
   * listeners.
   *
   * @param series the series (zero based index).
   */
  public void removeSeries(int series) {

    // check arguments...
    if ((series < 0) || (series > getSeriesCount())) {
      throw new IllegalArgumentException("Index outside valid range.");
    }

    // fetch the series, remove the change listener, then remove the series.
    XYSeries s = (XYSeries) this.data.get(series);
    s.removeChangeListener(this);
    this.data.remove(series);
    if (this.data.size() == 0) {
      this.xPoints.clear();
    } else if (this.autoPrune) {
      prune();
    }
    fireDatasetChanged();
  }