Example usage for org.jfree.data.gantt TaskSeriesCollection remove

List of usage examples for org.jfree.data.gantt TaskSeriesCollection remove

Introduction

In this page you can find the example usage for org.jfree.data.gantt TaskSeriesCollection remove.

Prototype

public void remove(int series) 

Source Link

Document

Removes a series from the collection and sends a org.jfree.data.general.DatasetChangeEvent to all registered listeners.

Usage

From source file:org.jfree.data.gantt.TaskSeriesCollectionTest.java

/**
 * Some basic checks for the remove() method.
 *//*from   ww w  .j av  a2  s. co  m*/
@Test
public void testRemove() {
    TaskSeriesCollection c = new TaskSeriesCollection();
    TaskSeries s1 = new TaskSeries("S1");
    c.add(s1);
    assertEquals("S1", c.getSeries(0).getKey());
    c.remove(0);
    assertEquals(0, c.getSeriesCount());
    c.add(s1);

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

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