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

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

Introduction

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

/**
 * Removes all the series from the collection.
 * <P>/*from   w w  w . j a va 2s .  c om*/
 * Notifies all registered listeners that the dataset has changed.
 * </p>
 */
public void removeAllSeries() {
    // Unregister the collection as a change listener to each series in
    // the collection.
    for (int i = 0; i < this.seriesList.size(); i++) {
        MatrixSeries series = (MatrixSeries) this.seriesList.get(i);
        series.removeChangeListener(this);
    }

    // Remove all the series from the collection and notify listeners.
    this.seriesList.clear();
    fireDatasetChanged();
}

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

/**
 * Removes a series from the collection.
 * <P>//from   www  .ja  va2s  .  co  m
 * Notifies all registered listeners that the dataset has changed.
 *
 * @param seriesIndex the series (zero based index).
 */
public void removeSeries(int seriesIndex) {
    // check arguments...
    if ((seriesIndex < 0) || (seriesIndex > getSeriesCount())) {
        throw new IllegalArgumentException("Index outside valid range.");
    }

    // fetch the series, remove the change listener, then remove the series.
    MatrixSeries series = (MatrixSeries) this.seriesList.get(seriesIndex);
    series.removeChangeListener(this);
    this.seriesList.remove(seriesIndex);
    fireDatasetChanged();
}

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

/**
 * Removes a series from the collection.
 * <P>/*from www  .  j  ava 2  s . c om*/
 * Notifies all registered listeners that the dataset has changed.
 * </p>
 *
 * @param series the series (<code>null</code>).
 */
public void removeSeries(MatrixSeries series) {
    ParamChecks.nullNotPermitted(series, "series");
    if (this.seriesList.contains(series)) {
        series.removeChangeListener(this);
        this.seriesList.remove(series);
        fireDatasetChanged();
    }
}