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

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

Introduction

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

Prototype

public void addChangeListener(SeriesChangeListener listener) 

Source Link

Document

Registers an object with this series, to receive notification whenever the series changes.

Usage

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

/**
 * Some checks for the clear() method./*  w  w w .j  a va 2s  . c om*/
 */
@Test
public void testClear() {
    XYIntervalSeries s1 = new XYIntervalSeries("S1");
    s1.addChangeListener(this);
    s1.clear();
    assertNull(this.lastEvent);
    assertTrue(s1.isEmpty());
    s1.add(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
    assertFalse(s1.isEmpty());
    s1.clear();
    assertNotNull(this.lastEvent);
    assertTrue(s1.isEmpty());
}

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

/**
 * Adds a series to the collection and sends a {@link DatasetChangeEvent}
 * to all registered listeners.//  w ww  .j  a va  2  s  . c  o m
 *
 * @param series  the series (<code>null</code> not permitted).
 */
public void addSeries(XYIntervalSeries series) {
    ParamChecks.nullNotPermitted(series, "series");
    this.data.add(series);
    series.addChangeListener(this);
    fireDatasetChanged();
}