Example usage for org.jfree.data.time.ohlc OHLCSeriesCollection removeAllSeries

List of usage examples for org.jfree.data.time.ohlc OHLCSeriesCollection removeAllSeries

Introduction

In this page you can find the example usage for org.jfree.data.time.ohlc OHLCSeriesCollection removeAllSeries.

Prototype

public void removeAllSeries() 

Source Link

Document

Removes all the series from the collection and sends a DatasetChangeEvent to all registered listeners.

Usage

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

/**
 * A simple check for the removeAllSeries() method.
 *//*  www.j a  va2  s.c om*/
@Test
public void testRemoveAllSeries() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    c1.addChangeListener(this);

    // there should be no change event when clearing an empty series
    this.lastEvent = null;
    c1.removeAllSeries();
    assertNull(this.lastEvent);

    OHLCSeries s1 = new OHLCSeries("Series 1");
    OHLCSeries s2 = new OHLCSeries("Series 2");
    c1.addSeries(s1);
    c1.addSeries(s2);
    c1.removeAllSeries();
    assertEquals(0, c1.getSeriesCount());
    assertNotNull(this.lastEvent);
    this.lastEvent = null; // clean up
}