Example usage for org.jfree.data.general SeriesChangeEvent SeriesChangeEvent

List of usage examples for org.jfree.data.general SeriesChangeEvent SeriesChangeEvent

Introduction

In this page you can find the example usage for org.jfree.data.general SeriesChangeEvent SeriesChangeEvent.

Prototype

public SeriesChangeEvent(Object source) 

Source Link

Document

Constructs a new event.

Usage

From source file:edu.gmu.cs.sim.util.media.chart.ChartGenerator.java

/** Override this to remove a series from the chart.  Be sure to call super(...) first. */
public void removeSeries(int index) {
    // stop the inspector....
    SeriesAttributes[] c = getSeriesAttributes();
    SeriesChangeListener tmpObj = c[index].getStoppable();
    if (tmpObj != null) {
        tmpObj.seriesChanged(new SeriesChangeEvent(this));
    }/*from  w w w.  j av  a 2s.  c o m*/

    // for good measure, set the index of the component to something crazy just in case a stoppable tries to continue pulsing it
    Component comp = seriesAttributes.getComponent(index);
    ((SeriesAttributes) comp).setSeriesIndex(-1);

    // remove the attribute and rebuild indices
    seriesAttributes.remove(index);
    rebuildAttributeIndices();
    revalidate();
}

From source file:org.jfree.data.general.Series.java

/**
 * General method for signalling to registered listeners that the series
 * has been changed.//from w  w  w.j a v  a 2  s. c o  m
 */
public void fireSeriesChanged() {
    if (this.notify) {
        notifyListeners(new SeriesChangeEvent(this));
    }
}