Example usage for org.jfree.data.xy XYIntervalSeriesCollection removeSeries

List of usage examples for org.jfree.data.xy XYIntervalSeriesCollection removeSeries

Introduction

In this page you can find the example usage for org.jfree.data.xy XYIntervalSeriesCollection removeSeries.

Prototype

public void removeSeries(XYIntervalSeries series) 

Source Link

Document

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

Usage

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

/**
 * Some basic checks for the removeSeries() method.
 *//*from   w ww.  ja v  a  2  s. c  o  m*/
@Test
public void testRemoveSeries() {
    XYIntervalSeriesCollection c = new XYIntervalSeriesCollection();
    XYIntervalSeries s1 = new XYIntervalSeries("s1");
    c.addSeries(s1);
    c.removeSeries(0);
    assertEquals(0, c.getSeriesCount());
    c.addSeries(s1);

    boolean pass = false;
    try {
        c.removeSeries(-1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);

    pass = false;
    try {
        c.removeSeries(1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);
}

From source file:org.jfree.data.xy.junit.XYIntervalSeriesCollectionTest.java

/**
 * Some basic checks for the removeSeries() method.
 *//*from w w  w  .ja v a2  s . co  m*/
public void testRemoveSeries() {
    XYIntervalSeriesCollection c = new XYIntervalSeriesCollection();
    XYIntervalSeries s1 = new XYIntervalSeries("s1");
    c.addSeries(s1);
    c.removeSeries(0);
    assertEquals(0, c.getSeriesCount());
    c.addSeries(s1);

    boolean pass = false;
    try {
        c.removeSeries(-1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);

    pass = false;
    try {
        c.removeSeries(1);
    } catch (IllegalArgumentException e) {
        pass = true;
    }
    assertTrue(pass);
}