• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TimePeriodValuesCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jfree.data.time.TimePeriodValuesCollection的典型用法代码示例。如果您正苦于以下问题:Java TimePeriodValuesCollection类的具体用法?Java TimePeriodValuesCollection怎么用?Java TimePeriodValuesCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TimePeriodValuesCollection类属于org.jfree.data.time包,在下文中一共展示了TimePeriodValuesCollection类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: test1161340

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * A test for bug report 1161340.  I wasn't able to reproduce the problem
 * with this test.
 */
public void test1161340() {
    TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
    TimePeriodValues v1 = new TimePeriodValues("V1");
    v1.add(new Day(11, 3, 2005), 1.2);
    v1.add(new Day(12, 3, 2005), 3.4);
    dataset.addSeries(v1);
    assertEquals(1, dataset.getSeriesCount());
    dataset.removeSeries(v1);
    assertEquals(0, dataset.getSeriesCount());
    
    TimePeriodValues v2 = new TimePeriodValues("V2");
    v1.add(new Day(5, 3, 2005), 1.2);
    v1.add(new Day(6, 3, 2005), 3.4);
    dataset.addSeries(v2);
    assertEquals(1, dataset.getSeriesCount());
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:TimePeriodValuesCollectionTests.java


示例2: testEquals

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Tests the equals() method.
 */
public void testEquals() {
    
    TimePeriodValuesCollection c1 = new TimePeriodValuesCollection();
    TimePeriodValuesCollection c2 = new TimePeriodValuesCollection();
    assertTrue(c1.equals(c2));
    
    c1.setDomainIsPointsInTime(!c1.getDomainIsPointsInTime());
    assertFalse(c1.equals(c2));
    c2.setDomainIsPointsInTime(c1.getDomainIsPointsInTime());
    assertTrue(c1.equals(c2));
    
    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));
    
    TimePeriodValues v1 = new TimePeriodValues("Test");
    TimePeriodValues v2 = new TimePeriodValues("Test");
    
    c1.addSeries(v1);
    assertFalse(c1.equals(c2));
    c2.addSeries(v2);
    assertTrue(c1.equals(c2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:28,代码来源:TimePeriodValuesCollectionTests.java


示例3: getEntityHyperlink

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
@Override
public JRPrintHyperlink getEntityHyperlink(ChartEntity entity)
{
	JRPrintHyperlink printHyperlink = null;
	if (hasHyperlinks() && entity instanceof XYItemEntity)
	{
		XYItemEntity itemEntity = (XYItemEntity) entity;
		TimePeriodValuesCollection dataset = (TimePeriodValuesCollection) itemEntity.getDataset();
		TimePeriodValues series = dataset.getSeries(itemEntity.getSeriesIndex());
		Map<TimePeriod, JRPrintHyperlink> serieHyperlinks = itemHyperlinks.get(series.getKey());
		if (serieHyperlinks != null)
		{
			TimePeriod timePeriod = series.getTimePeriod(itemEntity.getItem());
			printHyperlink = serieHyperlinks.get(timePeriod);
		}
	}
	return printHyperlink;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:TimePeriodChartHyperlinkProvider.java


示例4: resetUI

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Resets the display.
 */
@Override
void resetUI() {
    super.resetUI();
    XYPlot xyPlot = mChart.getXYPlot();

    AbstractXYItemRenderer br = new XYBarRenderer();
    mDatasetsSyncHist = new TimePeriodValues[NUM_AUTHS+1];

    @SuppressWarnings("unchecked")
    Map<SimpleTimePeriod, Integer> mTimePeriodMapTmp[] = new HashMap[NUM_AUTHS + 1];
    mTimePeriodMap = mTimePeriodMapTmp;

    TimePeriodValuesCollection tpvc = new TimePeriodValuesCollection();
    xyPlot.setDataset(tpvc);
    xyPlot.setRenderer(br);

    for (int i = 0; i < NUM_AUTHS + 1; i++) {
        br.setSeriesPaint(i, AUTH_COLORS[i]);
        mDatasetsSyncHist[i] = new TimePeriodValues(AUTH_NAMES[i]);
        tpvc.addSeries(mDatasetsSyncHist[i]);
        mTimePeriodMap[i] = new HashMap<SimpleTimePeriod, Integer>();

    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:28,代码来源:DisplaySyncHistogram.java


示例5: testEquals

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Tests the equals() method.
 */
public void testEquals() {
    
    TimePeriodValuesCollection c1 = new TimePeriodValuesCollection();
    TimePeriodValuesCollection c2 = new TimePeriodValuesCollection();
    assertTrue(c1.equals(c2));
    
    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));
    
    TimePeriodValues v1 = new TimePeriodValues("Test");
    TimePeriodValues v2 = new TimePeriodValues("Test");
    
    c1.addSeries(v1);
    assertFalse(c1.equals(c2));
    c2.addSeries(v2);
    assertTrue(c1.equals(c2));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TimePeriodValuesCollectionTests.java


示例6: testGetDomainBoundsWithoutInterval

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Some checks for the getDomainBounds() method.
 */
public void testGetDomainBoundsWithoutInterval() {
    // check empty dataset
    TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
    Range r = dataset.getDomainBounds(false);
    assertNull(r);
    
    // check dataset with one time period
    TimePeriodValues s1 = new TimePeriodValues("S1");
    s1.add(new SimpleTimePeriod(1000L, 2000L), 1.0);
    dataset.addSeries(s1);
    r = dataset.getDomainBounds(false);
    assertEquals(1500.0, r.getLowerBound(), EPSILON);
    assertEquals(1500.0, r.getUpperBound(), EPSILON);
    
    // check dataset with two time periods
    s1.add(new SimpleTimePeriod(1500L, 3000L), 2.0);
    r = dataset.getDomainBounds(false);
    assertEquals(1500.0, r.getLowerBound(), EPSILON);
    assertEquals(2250.0, r.getUpperBound(), EPSILON);  
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:24,代码来源:TimePeriodValuesCollectionTests.java


示例7: createBarDataset

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
private XYDataset createBarDataset() {
	final TimePeriodValuesCollection result = new TimePeriodValuesCollection();
	Set<String> nameSet = this.m_dataSetMap.keySet();

	for (String name : nameSet) {
		final TimePeriodValues series = new TimePeriodValues(name);

		Map<Date, ? extends Number> map = m_dataSetMap.get(name);

		Iterator<Date> ir = map.keySet().iterator();

		while (ir.hasNext()) {
			Date key = ir.next();
			series.add(new SimpleTimePeriod(key, new Date(key.getTime()
					+ (m_interval * OneDay))), map.get(key));
		}

		result.addSeries(series);
	}
	return result;
}
 
开发者ID:ezScrum,项目名称:ezScrum,代码行数:22,代码来源:ChartUtil.java


示例8: generateLabel

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
@Override
public String generateLabel(XYDataset dataset, int series, int item)
{
	Comparable<?> seriesName = dataset.getSeriesKey(series);
	Map<TimePeriod, String> labels = labelsMap.get(seriesName);
	if(labels != null)
	{
		return labels.get(((TimePeriodValuesCollection)dataset).getSeries(series).getTimePeriod(item));
	}
	return super.generateLabel( dataset, series, item );
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:12,代码来源:TimePeriodDatasetLabelGenerator.java


示例9: getCustomDataset

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
@Override
public Dataset getCustomDataset()
{
	TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
	if (seriesNames != null)
	{
		for(int i = 0; i < seriesNames.size(); i++)
		{
			Comparable<?> seriesName = seriesNames.get(i);
			dataset.addSeries(seriesMap.get(seriesName));
		}
	}
	return dataset;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:JRFillTimePeriodDataset.java


示例10: createTimePeriodDataset

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
private XYDataset createTimePeriodDataset()
{
	if (sampleTimePeriodDataset == null)
	{
		TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();

		Day today = new Day();
		TimePeriodValues series1 = new TimePeriodValues("First");
		TimePeriodValues series2 = new TimePeriodValues("Second");
		
		for (int i = 0; i < 24; i++) 
		{
			Minute m0 = new Minute(0, new Hour(i, today));
			Minute m1 = new Minute(15, new Hour(i, today));
			Minute m2 = new Minute(30, new Hour(i, today));
			Minute m3 = new Minute(45, new Hour(i, today));
			Minute m4 = new Minute(0, new Hour(i + 1, today));
			series1.add(new SimpleTimePeriod(m0.getStart(), m1.getStart()), Math.random());
			series2.add(new SimpleTimePeriod(m1.getStart(), m2.getStart()), Math.random());
			series1.add(new SimpleTimePeriod(m2.getStart(), m3.getStart()), Math.random());
			series2.add(new SimpleTimePeriod(m3.getStart(), m4.getStart()), Math.random());
		}

		dataset.addSeries(series1);
		dataset.addSeries(series2);
		
		sampleTimePeriodDataset = dataset;
	}

	return sampleTimePeriodDataset;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:32,代码来源:ConvertChartContext.java


示例11: processNode

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
public void processNode(Object name, Map map, Object value) throws Exception {
    if(value != null && value instanceof TimePeriodValuesCollection) {
        this.collection = (TimePeriodValuesCollection)value;
    }else {
        // TODO
    }         
}
 
开发者ID:davetcc,项目名称:groovychart,代码行数:8,代码来源:TimePeriodValuesCollectionBuilder.java


示例12: resetUI

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Resets the display.
 */
@Override
void resetUI() {
    super.resetUI();
    XYPlot xyPlot = mChart.getXYPlot();
    xyPlot.getRangeAxis().setVisible(false);
    mTooltipGenerator = new CustomXYToolTipGenerator();

    @SuppressWarnings("unchecked")
    List<String>[] mTooltipsTmp = new List[NUM_SERIES];
    mTooltips = mTooltipsTmp;

    XYBarRenderer br = new XYBarRenderer();
    br.setUseYInterval(true);
    mDatasets = new TimePeriodValues[NUM_SERIES];

    TimePeriodValuesCollection tpvc = new YIntervalTimePeriodValuesCollection(1);
    xyPlot.setDataset(tpvc);
    xyPlot.setRenderer(br);

    for (int i = 0; i < NUM_SERIES; i++) {
        br.setSeriesPaint(i, SERIES_COLORS[i]);
        mDatasets[i] = new TimePeriodValues(SERIES_NAMES[i]);
        tpvc.addSeries(mDatasets[i]);
        mTooltips[i] = new ArrayList<String>();
        mTooltipGenerator.addToolTipSeries(mTooltips[i]);
        br.setSeriesToolTipGenerator(i, mTooltipGenerator);
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:32,代码来源:DisplaySyncPerf.java


示例13: createTimePeriodDataset

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
private XYDataset createTimePeriodDataset() {
	if (sampleTimePeriodDataset == null) {
		TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();

		Day today = new Day();
		TimePeriodValues series1 = new TimePeriodValues("First");
		TimePeriodValues series2 = new TimePeriodValues("Second");

		for (int i = 0; i < 24; i++) {
			Minute m0 = new Minute(0, new Hour(i, today));
			Minute m1 = new Minute(15, new Hour(i, today));
			Minute m2 = new Minute(30, new Hour(i, today));
			Minute m3 = new Minute(45, new Hour(i, today));
			Minute m4 = new Minute(0, new Hour(i + 1, today));
			series1.add(new SimpleTimePeriod(m0.getStart(), m1.getStart()), Math.random());
			series2.add(new SimpleTimePeriod(m1.getStart(), m2.getStart()), Math.random());
			series1.add(new SimpleTimePeriod(m2.getStart(), m3.getStart()), Math.random());
			series2.add(new SimpleTimePeriod(m3.getStart(), m4.getStart()), Math.random());
		}

		dataset.addSeries(series1);
		dataset.addSeries(series2);

		sampleTimePeriodDataset = dataset;
	}

	return sampleTimePeriodDataset;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:ConvertChartContext.java


示例14: testGetDomainBoundsWithInterval

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Some more checks for the getDomainBounds() method.
 * 
 * @see #testGetDomainBoundsWithoutInterval()
 */
public void testGetDomainBoundsWithInterval() {
    // check empty dataset
    TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
    Range r = dataset.getDomainBounds(true);
    assertNull(r);
    
    // check dataset with one time period
    TimePeriodValues s1 = new TimePeriodValues("S1");
    s1.add(new SimpleTimePeriod(1000L, 2000L), 1.0);
    dataset.addSeries(s1);
    r = dataset.getDomainBounds(true);
    assertEquals(1000.0, r.getLowerBound(), EPSILON);
    assertEquals(2000.0, r.getUpperBound(), EPSILON);
    
    // check dataset with two time periods
    s1.add(new SimpleTimePeriod(1500L, 3000L), 2.0);
    r = dataset.getDomainBounds(true);
    assertEquals(1000.0, r.getLowerBound(), EPSILON);
    assertEquals(3000.0, r.getUpperBound(), EPSILON);
    
    // add a third time period
    s1.add(new SimpleTimePeriod(6000L, 7000L), 1.5);
    r = dataset.getDomainBounds(true);
    assertEquals(1000.0, r.getLowerBound(), EPSILON);
    assertEquals(7000.0, r.getUpperBound(), EPSILON);

    // add a fourth time period
    s1.add(new SimpleTimePeriod(4000L, 5000L), 1.4);
    r = dataset.getDomainBounds(true);
    assertEquals(1000.0, r.getLowerBound(), EPSILON);
    assertEquals(7000.0, r.getUpperBound(), EPSILON);    
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:38,代码来源:TimePeriodValuesCollectionTests.java


示例15: resetUI

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Resets the display.
 */
@Override
void resetUI() {
    super.resetUI();
    XYPlot xyPlot = mChart.getXYPlot();

    XYBarRenderer br = new XYBarRenderer();
    mDatasetsSync = new TimePeriodValues[NUM_AUTHS];

    @SuppressWarnings("unchecked")
    List<String> mTooltipsSyncTmp[] = new List[NUM_AUTHS];
    mTooltipsSync = mTooltipsSyncTmp;

    mTooltipGenerators = new CustomXYToolTipGenerator[NUM_AUTHS];

    TimePeriodValuesCollection tpvc = new TimePeriodValuesCollection();
    xyPlot.setDataset(tpvc);
    xyPlot.setRenderer(0, br);

    XYLineAndShapeRenderer ls = new XYLineAndShapeRenderer();
    ls.setBaseLinesVisible(false);
    mDatasetsSyncTickle = new TimeSeries[NUM_AUTHS];
    TimeSeriesCollection tsc = new TimeSeriesCollection();
    xyPlot.setDataset(1, tsc);
    xyPlot.setRenderer(1, ls);

    mDatasetError = new TimeSeries("Errors", FixedMillisecond.class);
    xyPlot.setDataset(2, new TimeSeriesCollection(mDatasetError));
    XYLineAndShapeRenderer errls = new XYLineAndShapeRenderer();
    errls.setBaseLinesVisible(false);
    errls.setSeriesPaint(0, Color.RED);
    xyPlot.setRenderer(2, errls);

    for (int i = 0; i < NUM_AUTHS; i++) {
        br.setSeriesPaint(i, AUTH_COLORS[i]);
        ls.setSeriesPaint(i, AUTH_COLORS[i]);
        mDatasetsSync[i] = new TimePeriodValues(AUTH_NAMES[i]);
        tpvc.addSeries(mDatasetsSync[i]);
        mTooltipsSync[i] = new ArrayList<String>();
        mTooltipGenerators[i] = new CustomXYToolTipGenerator();
        br.setSeriesToolTipGenerator(i, mTooltipGenerators[i]);
        mTooltipGenerators[i].addToolTipSeries(mTooltipsSync[i]);

        mDatasetsSyncTickle[i] = new TimeSeries(AUTH_NAMES[i] + " tickle",
                FixedMillisecond.class);
        tsc.addSeries(mDatasetsSyncTickle[i]);
        ls.setSeriesShape(i, ShapeUtilities.createUpTriangle(2.5f));
    }
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:52,代码来源:DisplaySync.java


示例16: getCollection

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Getter for property collection.
 * @return Value of property collection.
 */
public TimePeriodValuesCollection getCollection() {
    return this.collection;
}
 
开发者ID:davetcc,项目名称:groovychart,代码行数:8,代码来源:TimePeriodValuesCollectionBuilder.java


示例17: setCollection

import org.jfree.data.time.TimePeriodValuesCollection; //导入依赖的package包/类
/**
 * Setter for property collection.
 * @param collection New value of property collection.
 */
public void setCollection(TimePeriodValuesCollection collection) {
    this.collection = collection;
}
 
开发者ID:davetcc,项目名称:groovychart,代码行数:8,代码来源:TimePeriodValuesCollectionBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VerifyOutput类代码示例发布时间:2022-05-22
下一篇:
Java TableDataInsertAllRequest类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap