Example usage for org.jfree.data.gantt TaskSeries removeChangeListener

List of usage examples for org.jfree.data.gantt TaskSeries removeChangeListener

Introduction

In this page you can find the example usage for org.jfree.data.gantt TaskSeries 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.gantt.TaskSeriesCollection.java

/**
 * Removes a series from the collection and sends
 * a {@link org.jfree.data.general.DatasetChangeEvent}
 * to all registered listeners./*from w w w . j a  v a2  s  .c  o  m*/
 *
 * @param series  the series (zero based index).
 */
public void remove(int series) {
    if ((series < 0) || (series >= getSeriesCount())) {
        throw new IllegalArgumentException("TaskSeriesCollection.remove(): index outside valid range.");
    }

    // fetch the series, remove the change listener, then remove the series.
    TaskSeries ts = (TaskSeries) this.data.get(series);
    ts.removeChangeListener(this);
    this.data.remove(series);
    fireDatasetChanged();

}

From source file:org.jfree.data.gantt.TaskSeriesCollection.java

/**
 * Removes all the series from the collection and sends
 * a {@link org.jfree.data.general.DatasetChangeEvent}
 * to all registered listeners./*from   w  ww .j a  va 2s  . c  om*/
 */
public void removeAll() {

    // deregister the collection as a change listener to each series in
    // the collection.
    Iterator iterator = this.data.iterator();
    while (iterator.hasNext()) {
        TaskSeries series = (TaskSeries) iterator.next();
        series.removeChangeListener(this);
    }

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

}

From source file:org.jfree.data.gantt.TaskSeriesCollection.java

/**
 * Removes a series from the collection and sends
 * a {@link org.jfree.data.general.DatasetChangeEvent}
 * to all registered listeners.//from ww w.  ja va 2  s .co  m
 *
 * @param series  the series.
 */
public void remove(TaskSeries series) {
    ParamChecks.nullNotPermitted(series, "series");
    if (this.data.contains(series)) {
        series.removeChangeListener(this);
        this.data.remove(series);
        fireDatasetChanged();
    }
}