Example usage for org.jfree.data.time.ohlc OHLCSeries addChangeListener

List of usage examples for org.jfree.data.time.ohlc OHLCSeries addChangeListener

Introduction

In this page you can find the example usage for org.jfree.data.time.ohlc OHLCSeries 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.time.ohlc.OHLCSeriesTest.java

/**
 * Some checks for the clear() method.//from  w ww.ja v  a  2 s .com
 */
@Test
public void testClear() {
    OHLCSeries s1 = new OHLCSeries("S1");
    s1.addChangeListener(this);
    s1.clear();
    assertNull(this.lastEvent);
    assertTrue(s1.isEmpty());
    s1.add(new Year(2006), 1.0, 1.1, 1.1, 1.1);
    assertFalse(s1.isEmpty());
    s1.clear();
    assertNotNull(this.lastEvent);
    assertTrue(s1.isEmpty());
}

From source file:org.jfree.data.time.ohlc.OHLCSeriesCollection.java

/**
 * Adds a series to the collection and sends a {@link DatasetChangeEvent}
 * to all registered listeners./*from  www .ja  v  a 2 s.c  om*/
 *
 * @param series  the series (<code>null</code> not permitted).
 */
public void addSeries(OHLCSeries series) {
    ParamChecks.nullNotPermitted(series, "series");
    this.data.add(series);
    series.addChangeListener(this);
    fireDatasetChanged();
}