當前位置: 首頁>>代碼示例>>Java>>正文


Java TimeSeriesCollection.removeSeries方法代碼示例

本文整理匯總了Java中org.jfree.data.time.TimeSeriesCollection.removeSeries方法的典型用法代碼示例。如果您正苦於以下問題:Java TimeSeriesCollection.removeSeries方法的具體用法?Java TimeSeriesCollection.removeSeries怎麽用?Java TimeSeriesCollection.removeSeries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.data.time.TimeSeriesCollection的用法示例。


在下文中一共展示了TimeSeriesCollection.removeSeries方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testRemoveSeries

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
/**
 * Tests the remove series method.
 */
public void testRemoveSeries() {

    final TimeSeriesCollection c1 = new TimeSeriesCollection();

    final TimeSeries s1 = new TimeSeries("Series 1");
    final TimeSeries s2 = new TimeSeries("Series 2");
    final TimeSeries s3 = new TimeSeries("Series 3");
    final TimeSeries s4 = new TimeSeries("Series 4");

    c1.addSeries(s1);
    c1.addSeries(s2);
    c1.addSeries(s3);
    c1.addSeries(s4);

    c1.removeSeries(s3);

    final TimeSeries s = c1.getSeries(2);
    final boolean b1 = s.equals(s4);
    assertTrue(b1);

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:25,代碼來源:TimeSeriesCollectionTests.java

示例2: testRemoveSeries

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
/**
 * Tests the remove series method.
 */
public void testRemoveSeries() {

    TimeSeriesCollection c1 = new TimeSeriesCollection();

    TimeSeries s1 = new TimeSeries("Series 1");
    TimeSeries s2 = new TimeSeries("Series 2");
    TimeSeries s3 = new TimeSeries("Series 3");
    TimeSeries s4 = new TimeSeries("Series 4");

    c1.addSeries(s1);
    c1.addSeries(s2);
    c1.addSeries(s3);
    c1.addSeries(s4);

    c1.removeSeries(s3);

    TimeSeries s = c1.getSeries(2);
    boolean b1 = s.equals(s4);
    assertTrue(b1);

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:25,代碼來源:TimeSeriesCollectionTests.java

示例3: removeSeries

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
/** Remove a data series */
public void removeSeries(String name){
	TimeSeriesCollection dataset = (TimeSeriesCollection)chart.getXYPlot().getDataset(0);
	int id = ((Integer)seriesIds.get(name)).intValue();
	dataset.removeSeries(id);
	// Decrament all ids greater than id
	for(Enumeration i = seriesIds.keys(); i.hasMoreElements();){
		String k = (String)i.nextElement();
		int tmpId = seriesIds.get(k);
		if(tmpId > id){
			tmpId--;
			seriesIds.put(k, tmpId);
			chart.getXYPlot().getRenderer().setSeriesPaint(tmpId, seriesPaint.get(k));
		}
	}
	seriesCount--;
}
 
開發者ID:Cride5,項目名稱:jablus,代碼行數:18,代碼來源:TimeGraphPanel.java

示例4: testRemoveSeries_int

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
/**
 * Some checks for the {@link TimeSeriesCollection#removeSeries(int)}
 * method.
 */
public void testRemoveSeries_int() {
    TimeSeriesCollection c1 = new TimeSeriesCollection();
    TimeSeries s1 = new TimeSeries("Series 1");
    TimeSeries s2 = new TimeSeries("Series 2");
    TimeSeries s3 = new TimeSeries("Series 3");
    TimeSeries s4 = new TimeSeries("Series 4");
    c1.addSeries(s1);
    c1.addSeries(s2);
    c1.addSeries(s3);
    c1.addSeries(s4);
    c1.removeSeries(2);
    assertTrue(c1.getSeries(2).equals(s4));
    c1.removeSeries(0);
    assertTrue(c1.getSeries(0).equals(s2));
    assertEquals(2, c1.getSeriesCount());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:21,代碼來源:TimeSeriesCollectionTests.java

示例5: testIndexOf

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
/**
 * Some tests for the indexOf() method.
 */
public void testIndexOf() {
    TimeSeries s1 = new TimeSeries("S1");
    TimeSeries s2 = new TimeSeries("S2");
    TimeSeriesCollection dataset = new TimeSeriesCollection();
    assertEquals(-1, dataset.indexOf(s1));
    assertEquals(-1, dataset.indexOf(s2));

    dataset.addSeries(s1);
    assertEquals(0, dataset.indexOf(s1));
    assertEquals(-1, dataset.indexOf(s2));

    dataset.addSeries(s2);
    assertEquals(0, dataset.indexOf(s1));
    assertEquals(1, dataset.indexOf(s2));

    dataset.removeSeries(s1);
    assertEquals(-1, dataset.indexOf(s1));
    assertEquals(0, dataset.indexOf(s2));

    TimeSeries s2b = new TimeSeries("S2");
    assertEquals(0, dataset.indexOf(s2b));
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:26,代碼來源:TimeSeriesCollectionTests.java

示例6: testEquals

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
/**
 * Some tests for the equals() method.
 */
public void testEquals() {

    final TimeSeriesCollection c1 = new TimeSeriesCollection();
    final TimeSeriesCollection c2 = new TimeSeriesCollection();

    final TimeSeries s1 = new TimeSeries("Series 1");
    final TimeSeries s2 = new TimeSeries("Series 2");

    // newly created collections should be equal
    final boolean b1 = c1.equals(c2);
    assertTrue("b1", b1);

    // add series to collection 1, should be not equal
    c1.addSeries(s1);
    c1.addSeries(s2);
    final boolean b2 = c1.equals(c2);
    assertFalse("b2", b2);

    // now add the same series to collection 2 to make them equal again...
    c2.addSeries(s1);
    c2.addSeries(s2);
    final boolean b3 = c1.equals(c2);
    assertTrue("b3", b3);

    // now remove series 2 from collection 2
    c2.removeSeries(s2);
    final boolean b4 = c1.equals(c2);
    assertFalse("b4", b4);

    // now remove series 2 from collection 1 to make them equal again
    c1.removeSeries(s2);
    final boolean b5 = c1.equals(c2);
    assertTrue("b5", b5);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:38,代碼來源:TimeSeriesCollectionTests.java

示例7: testEquals

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
/**
 * Some tests for the equals() method.
 */
public void testEquals() {

    TimeSeriesCollection c1 = new TimeSeriesCollection();
    TimeSeriesCollection c2 = new TimeSeriesCollection();

    TimeSeries s1 = new TimeSeries("Series 1");
    TimeSeries s2 = new TimeSeries("Series 2");

    // newly created collections should be equal
    boolean b1 = c1.equals(c2);
    assertTrue("b1", b1);

    // add series to collection 1, should be not equal
    c1.addSeries(s1);
    c1.addSeries(s2);
    boolean b2 = c1.equals(c2);
    assertFalse("b2", b2);

    // now add the same series to collection 2 to make them equal again...
    c2.addSeries(s1);
    c2.addSeries(s2);
    boolean b3 = c1.equals(c2);
    assertTrue("b3", b3);

    // now remove series 2 from collection 2
    c2.removeSeries(s2);
    boolean b4 = c1.equals(c2);
    assertFalse("b4", b4);

    // now remove series 2 from collection 1 to make them equal again
    c1.removeSeries(s2);
    boolean b5 = c1.equals(c2);
    assertTrue("b5", b5);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:38,代碼來源:TimeSeriesCollectionTests.java

示例8: removeSeries

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
protected void removeSeries(JFreeChart chart, int seriesIndex) {
    Color color = (Color) chart.getPlot().getLegendItems().get(seriesIndex).getLinePaint();
    palette.release(color);
    String key = enabled.remove(seriesIndex);
    XYPlot plot = chart.getXYPlot();
    Series<?> series = sampler.getSeries(key);
    Unit unit = series.getUnit();
    
    Integer datasetIndex = datasetMapping.get(unit);
    TimeSeriesCollection col = (TimeSeriesCollection) plot.getDataset(datasetIndex);
    
    List<String> colIndices = seriesMapping.get(unit);
    int colIndex = colIndices.indexOf(key);
    colIndices.remove(key);
    
    col.removeSeries(colIndex);
    if (col.getSeriesCount() == 0) {
        plot.setDataset(datasetIndex, null);
        plot.setRangeAxis(datasetIndex, null);
        seriesMapping.remove(unit);
        datasetMapping.remove(unit);
    }
    
    rebuildLegend();
    repaint();
    gp.saveLayout();
}
 
開發者ID:swift-lang,項目名稱:swift-k,代碼行數:28,代碼來源:GraphPanel.java

示例9: maintain

import org.jfree.data.time.TimeSeriesCollection; //導入方法依賴的package包/類
public void maintain() {
  dataSource.update();
  TimeSeriesCollection collection = (TimeSeriesCollection) chart.getXYPlot().getDataset();
  collection.removeSeries(1);
  collection.addSeries(createAverageSeries(dataSource.getTimeSeries()));
}
 
開發者ID:pmoor,項目名稱:bitthief,代碼行數:7,代碼來源:RawDownloadRate.java


注:本文中的org.jfree.data.time.TimeSeriesCollection.removeSeries方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。