当前位置: 首页>>代码示例>>Java>>正文


Java TimeSeries.addChangeListener方法代码示例

本文整理汇总了Java中org.jfree.data.time.TimeSeries.addChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java TimeSeries.addChangeListener方法的具体用法?Java TimeSeries.addChangeListener怎么用?Java TimeSeries.addChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.data.time.TimeSeries的用法示例。


在下文中一共展示了TimeSeries.addChangeListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testDelete2

import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
 * Basic tests for the delete() method.
 */
public void testDelete2() {
    TimeSeries s1 = new TimeSeries("Series", Year.class);    
    s1.add(new Year(2000), 13.75);
    s1.add(new Year(2001), 11.90);
    s1.add(new Year(2002), null);
    s1.addChangeListener(this);
    this.gotSeriesChangeEvent = false;
    s1.delete(new Year(2001));
    assertTrue(this.gotSeriesChangeEvent);
    assertEquals(2, s1.getItemCount());
    assertEquals(null, s1.getValue(new Year(2001)));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:TimeSeriesTests.java

示例2: testDelete2

import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
 * Basic tests for the delete() method.
 */
public void testDelete2() {
    TimeSeries s1 = new TimeSeries("Series", Year.class);    
    s1.add(new Year(2000), 13.75);
    s1.add(new Year(2001), 11.90);
    s1.add(new Year(2002), null);
    s1.addChangeListener(this);
    this.gotSeriesChangeEvent = false;
    s1.delete(new Year(2001));
    assertTrue(this.gotSeriesChangeEvent);
    assertEquals(2, s1.getItemCount());
    assertEquals(null, s1.getValue(new Year(2001)));
    
    // try deleting a time period that doesn't exist...
    this.gotSeriesChangeEvent = false;
    s1.delete(new Year(2006));
    assertFalse(this.gotSeriesChangeEvent);
    
    // try deleting null
    try {
        s1.delete(null);
        fail("Expected IllegalArgumentException.");
    }
    catch (IllegalArgumentException e) {
        // expected
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:30,代码来源:TimeSeriesTests.java

示例3: testRemoveAgedItems

import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
 * Some checks for the removeAgedItems() method.
 */
public void testRemoveAgedItems() {
	TimeSeries series = new TimeSeries("Test Series", Year.class);
	series.addChangeListener(this);
	assertEquals(Long.MAX_VALUE, series.getMaximumItemAge());
	assertEquals(Integer.MAX_VALUE, series.getMaximumItemCount());
	this.gotSeriesChangeEvent = false;
	
	// test empty series
	series.removeAgedItems(true);
	assertEquals(0, series.getItemCount());
	assertFalse(this.gotSeriesChangeEvent);
	
	// test series with one item
	series.add(new Year(1999), 1.0);
	series.setMaximumItemAge(0);
	this.gotSeriesChangeEvent = false;
	series.removeAgedItems(true);
	assertEquals(1, series.getItemCount());
	assertFalse(this.gotSeriesChangeEvent);

	// test series with two items
	series.setMaximumItemAge(10);
	series.add(new Year(2001), 2.0);
	this.gotSeriesChangeEvent = false;
	series.setMaximumItemAge(2);
	assertEquals(2, series.getItemCount());
	assertEquals(0, series.getIndex(new Year(1999)));
	assertFalse(this.gotSeriesChangeEvent);
	series.setMaximumItemAge(1);
	assertEquals(1, series.getItemCount());
	assertEquals(0, series.getIndex(new Year(2001)));
	assertTrue(this.gotSeriesChangeEvent);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:TimeSeriesTests.java

示例4: testRemoveAgedItems2

import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
 * Some checks for the removeAgedItems(long, boolean) method.
 */
public void testRemoveAgedItems2() {
    long y2006 = 1157087372534L;  // milliseconds somewhere in 2006
	TimeSeries series = new TimeSeries("Test Series", Year.class);
	series.addChangeListener(this);
	assertEquals(Long.MAX_VALUE, series.getMaximumItemAge());
	assertEquals(Integer.MAX_VALUE, series.getMaximumItemCount());
	this.gotSeriesChangeEvent = false;
	
	// test empty series
	series.removeAgedItems(y2006, true);
	assertEquals(0, series.getItemCount());
	assertFalse(this.gotSeriesChangeEvent);
    
    // test a series with 1 item
    series.add(new Year(2004), 1.0);
    series.setMaximumItemAge(1);
    this.gotSeriesChangeEvent = false;
    series.removeAgedItems(new Year(2005).getMiddleMillisecond(), true);
    assertEquals(1, series.getItemCount());
    assertFalse(this.gotSeriesChangeEvent);
    series.removeAgedItems(y2006, true);
    assertEquals(0, series.getItemCount());
    assertTrue(this.gotSeriesChangeEvent);

    // test a series with two items
    series.setMaximumItemAge(2);
    series.add(new Year(2003), 1.0);
    series.add(new Year(2005), 2.0);
    assertEquals(2, series.getItemCount());
    this.gotSeriesChangeEvent = false;
    assertEquals(2, series.getItemCount());
    
    series.removeAgedItems(new Year(2005).getMiddleMillisecond(), true);
    assertEquals(2, series.getItemCount());
    assertFalse(this.gotSeriesChangeEvent);
    series.removeAgedItems(y2006, true);
    assertEquals(1, series.getItemCount());
    assertTrue(this.gotSeriesChangeEvent);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:43,代码来源:TimeSeriesTests.java

示例5: testDelete2

import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
 * Basic tests for the delete() method.
 */
public void testDelete2() {
    TimeSeries s1 = new TimeSeries("Series");
    s1.add(new Year(2000), 13.75);
    s1.add(new Year(2001), 11.90);
    s1.add(new Year(2002), null);
    s1.addChangeListener(this);
    this.gotSeriesChangeEvent = false;
    s1.delete(new Year(2001));
    assertTrue(this.gotSeriesChangeEvent);
    assertEquals(2, s1.getItemCount());
    assertEquals(null, s1.getValue(new Year(2001)));

    // try deleting a time period that doesn't exist...
    this.gotSeriesChangeEvent = false;
    s1.delete(new Year(2006));
    assertFalse(this.gotSeriesChangeEvent);

    // try deleting null
    try {
        s1.delete(null);
        fail("Expected IllegalArgumentException.");
    }
    catch (IllegalArgumentException e) {
        // expected
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:30,代码来源:TimeSeriesTests.java

示例6: testRemoveAgedItems

import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
 * Some checks for the removeAgedItems() method.
 */
public void testRemoveAgedItems() {
    TimeSeries series = new TimeSeries("Test Series");
    series.addChangeListener(this);
    assertEquals(Long.MAX_VALUE, series.getMaximumItemAge());
    assertEquals(Integer.MAX_VALUE, series.getMaximumItemCount());
    this.gotSeriesChangeEvent = false;

    // test empty series
    series.removeAgedItems(true);
    assertEquals(0, series.getItemCount());
    assertFalse(this.gotSeriesChangeEvent);

    // test series with one item
    series.add(new Year(1999), 1.0);
    series.setMaximumItemAge(0);
    this.gotSeriesChangeEvent = false;
    series.removeAgedItems(true);
    assertEquals(1, series.getItemCount());
    assertFalse(this.gotSeriesChangeEvent);

    // test series with two items
    series.setMaximumItemAge(10);
    series.add(new Year(2001), 2.0);
    this.gotSeriesChangeEvent = false;
    series.setMaximumItemAge(2);
    assertEquals(2, series.getItemCount());
    assertEquals(0, series.getIndex(new Year(1999)));
    assertFalse(this.gotSeriesChangeEvent);
    series.setMaximumItemAge(1);
    assertEquals(1, series.getItemCount());
    assertEquals(0, series.getIndex(new Year(2001)));
    assertTrue(this.gotSeriesChangeEvent);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:37,代码来源:TimeSeriesTests.java

示例7: testRemoveAgedItems2

import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
 * Some checks for the removeAgedItems(long, boolean) method.
 */
public void testRemoveAgedItems2() {
    long y2006 = 1157087372534L;  // milliseconds somewhere in 2006
    TimeSeries series = new TimeSeries("Test Series");
    series.addChangeListener(this);
    assertEquals(Long.MAX_VALUE, series.getMaximumItemAge());
    assertEquals(Integer.MAX_VALUE, series.getMaximumItemCount());
    this.gotSeriesChangeEvent = false;

    // test empty series
    series.removeAgedItems(y2006, true);
    assertEquals(0, series.getItemCount());
    assertFalse(this.gotSeriesChangeEvent);

    // test a series with 1 item
    series.add(new Year(2004), 1.0);
    series.setMaximumItemAge(1);
    this.gotSeriesChangeEvent = false;
    series.removeAgedItems(new Year(2005).getMiddleMillisecond(), true);
    assertEquals(1, series.getItemCount());
    assertFalse(this.gotSeriesChangeEvent);
    series.removeAgedItems(y2006, true);
    assertEquals(0, series.getItemCount());
    assertTrue(this.gotSeriesChangeEvent);

    // test a series with two items
    series.setMaximumItemAge(2);
    series.add(new Year(2003), 1.0);
    series.add(new Year(2005), 2.0);
    assertEquals(2, series.getItemCount());
    this.gotSeriesChangeEvent = false;
    assertEquals(2, series.getItemCount());

    series.removeAgedItems(new Year(2005).getMiddleMillisecond(), true);
    assertEquals(2, series.getItemCount());
    assertFalse(this.gotSeriesChangeEvent);
    series.removeAgedItems(y2006, true);
    assertEquals(1, series.getItemCount());
    assertTrue(this.gotSeriesChangeEvent);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:43,代码来源:TimeSeriesTests.java


注:本文中的org.jfree.data.time.TimeSeries.addChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。