Example usage for org.jfree.data.xy YIntervalSeriesCollection getSeriesCount

List of usage examples for org.jfree.data.xy YIntervalSeriesCollection getSeriesCount

Introduction

In this page you can find the example usage for org.jfree.data.xy YIntervalSeriesCollection getSeriesCount.

Prototype

@Override
public int getSeriesCount() 

Source Link

Document

Returns the number of series in the collection.

Usage

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

/**
 * Some basic checks for the removeSeries() method.
 *//*from w  ww.  j  a va  2  s .c  o m*/
@Test
public void testRemoveSeries() {
    YIntervalSeriesCollection c = new YIntervalSeriesCollection();
    YIntervalSeries s1 = new YIntervalSeries("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.YIntervalSeriesCollectionTest.java

/**
 * Some basic checks for the removeSeries() method.
 *//*from w w w  . j a v a2 s  .  c  o m*/
public void testRemoveSeries() {
    YIntervalSeriesCollection c = new YIntervalSeriesCollection();
    YIntervalSeries s1 = new YIntervalSeries("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:de.tud.kom.p2psim.impl.skynet.visualization.MetricsPlot.java

private DeviationRenderer configureRendererForDataSet(XYItemRenderer r, YIntervalSeriesCollection dataSet) {
    DeviationRenderer renderer = (DeviationRenderer) r;
    YIntervalSeries serie = null;/*from  w w  w .  j av a 2  s . com*/
    for (int i = 0; i < dataSet.getSeriesCount(); i++) {
        serie = dataSet.getSeries(i);
        renderer.setSeriesStroke(i, displayedSeries.get(serie.getKey()).getStroke());
        renderer.setSeriesPaint(i, displayedSeries.get(serie.getKey()).getColor());
        renderer.setSeriesFillPaint(i, Color.LIGHT_GRAY);

    }
    if (showSdtDev) {
        renderer.setAlpha(0.3f);
    }
    return renderer;
}