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

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

Introduction

In this page you can find the example usage for org.jfree.data.xy VectorSeries 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.VectorSeriesCollection.java

/**
 * Removes all the series from the collection and sends a
 * {@link DatasetChangeEvent} to all registered listeners.
 *///w  ww  . j  a  v  a2 s . c o m
public void removeAllSeries() {

    // deregister the collection as a change listener to each series in the
    // collection
    for (int i = 0; i < this.data.size(); i++) {
        VectorSeries series = (VectorSeries) this.data.get(i);
        series.removeChangeListener(this);
    }

    // remove all the series from the collection and notify listeners.
    this.data.clear();
    fireDatasetChanged();

}

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

/**
 * Removes the specified series from the collection and sends a
 * {@link DatasetChangeEvent} to all registered listeners.
 *
 * @param series  the series (<code>null</code> not permitted).
 *
 * @return A boolean indicating whether the series has actually been
 *         removed./* www  .  ja  va  2  s  . com*/
 */
public boolean removeSeries(VectorSeries series) {
    ParamChecks.nullNotPermitted(series, "series");
    boolean removed = this.data.remove(series);
    if (removed) {
        series.removeChangeListener(this);
        fireDatasetChanged();
    }
    return removed;
}