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

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

Introduction

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

Prototype

public void removeSeries(XIntervalSeries 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.XIntervalSeriesCollectionTest.java

/**
 * Some basic checks for the removeSeries() method.
 *//*from w w  w  .  ja  v  a  2 s.co  m*/
@Test
public void testRemoveSeries() {
    XIntervalSeriesCollection c = new XIntervalSeriesCollection();
    XIntervalSeries s1 = new XIntervalSeries("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.XIntervalSeriesCollectionTest.java

/**
 * Some basic checks for the removeSeries() method.
 *//*from   w w  w .  j a va  2 s.  c o m*/
public void testRemoveSeries() {
    XIntervalSeriesCollection c = new XIntervalSeriesCollection();
    XIntervalSeries s1 = new XIntervalSeries("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);
}