Example usage for org.jfree.data.xy XYIntervalSeries removeChangeListener

List of usage examples for org.jfree.data.xy XYIntervalSeries removeChangeListener

Introduction

In this page you can find the example usage for org.jfree.data.xy XYIntervalSeries removeChangeListener.

Prototype

public void removeChangeListener(SeriesChangeListener listener) 

Source Link

Document

Deregisters an object, so that it not longer receives notification whenever the series changes.

Usage

From source file:org.jfree.data.xy.XYIntervalSeriesCollection.java

/**
 * Removes a series from the collection and sends a
 * {@link DatasetChangeEvent} to all registered listeners.
 *
 * @param series  the series index (zero-based).
 *
 * @since 1.0.10/*from w  w w .  j  av a2s. c om*/
 */
public void removeSeries(int series) {
    if ((series < 0) || (series >= getSeriesCount())) {
        throw new IllegalArgumentException("Series index out of bounds.");
    }
    XYIntervalSeries ts = (XYIntervalSeries) this.data.get(series);
    ts.removeChangeListener(this);
    this.data.remove(series);
    fireDatasetChanged();
}

From source file:org.jfree.data.xy.XYIntervalSeriesCollection.java

/**
 * Removes all the series from the collection and sends a
 * {@link DatasetChangeEvent} to all registered listeners.
 *
 * @since 1.0.10// w w  w.  ja va  2s.  co m
 */
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++) {
        XYIntervalSeries series = (XYIntervalSeries) this.data.get(i);
        series.removeChangeListener(this);
    }
    this.data.clear();
    fireDatasetChanged();
}

From source file:org.jfree.data.xy.XYIntervalSeriesCollection.java

/**
 * Removes a series from the collection and sends a
 * {@link DatasetChangeEvent} to all registered listeners.
 *
 * @param series  the series (<code>null</code> not permitted).
 *
 * @since 1.0.10//  w w w.  j a  va2  s  .c  om
 */
public void removeSeries(XYIntervalSeries series) {
    ParamChecks.nullNotPermitted(series, "series");
    if (this.data.contains(series)) {
        series.removeChangeListener(this);
        this.data.remove(series);
        fireDatasetChanged();
    }
}