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


Java TaskSeriesCollection.add方法代码示例

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


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

示例1: test697153

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * A test for bug report 697153.
 */
public void test697153() {

    final TaskSeries s1 = new TaskSeries("S1");
    s1.add(new Task("Task 1", new SimpleTimePeriod(new Date(), new Date())));
    s1.add(new Task("Task 2", new SimpleTimePeriod(new Date(), new Date())));
    s1.add(new Task("Task 3", new SimpleTimePeriod(new Date(), new Date())));

    final TaskSeries s2 = new TaskSeries("S2");
    s2.add(new Task("Task 2", new SimpleTimePeriod(new Date(), new Date())));
    s2.add(new Task("Task 3", new SimpleTimePeriod(new Date(), new Date())));
    s2.add(new Task("Task 4", new SimpleTimePeriod(new Date(), new Date())));

    final TaskSeriesCollection tsc = new TaskSeriesCollection();
    tsc.add(s1);
    tsc.add(s2);

    s1.removeAll();

    final int taskCount = tsc.getColumnCount();

    assertEquals(3, taskCount);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:27,代码来源:TaskSeriesCollectionTests2.java

示例2: test800324

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * A test for bug report 800324.
 */
public void test800324() {
    final TaskSeries s1 = new TaskSeries("S1");
    s1.add(new Task("Task 1", new SimpleTimePeriod(new Date(), new Date())));
    s1.add(new Task("Task 2", new SimpleTimePeriod(new Date(), new Date())));
    s1.add(new Task("Task 3", new SimpleTimePeriod(new Date(), new Date())));
            
    final TaskSeriesCollection tsc = new TaskSeriesCollection();
    tsc.add(s1);

    // these methods should return null since the column number is too high...
    final Number start = tsc.getStartValue(0, 3);
    assertEquals(start, null);
    final Number end = tsc.getEndValue(0, 3);
    assertEquals(end, null);

    final int count = tsc.getSubIntervalCount(0, 3);
    assertEquals(0, count);
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:23,代码来源:TaskSeriesCollectionTests2.java

示例3: createCollection2

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * Creates a sample collection for testing purposes.
 * 
 * @return A sample collection.
 */
private TaskSeriesCollection createCollection2() {
    TaskSeriesCollection result = new TaskSeriesCollection();
    TaskSeries s1 = new TaskSeries("S1");
    Task t1 = new Task("Task 1", new Date(10), new Date(20));
    t1.addSubtask(new Task("Task 1A", new Date(10), new Date(15)));
    t1.addSubtask(new Task("Task 1B", new Date(16), new Date(20)));
    t1.setPercentComplete(0.10);
    s1.add(t1);
    Task t2 = new Task("Task 2", new Date(30), new Date(40));
    t2.addSubtask(new Task("Task 2A", new Date(30), new Date(35)));
    t2.addSubtask(new Task("Task 2B", new Date(36), new Date(40)));
    t2.setPercentComplete(0.20);
    s1.add(t2);
    result.add(s1);
    TaskSeries s2 = new TaskSeries("S2");
    Task t3 = new Task("Task 3", new Date(50), new Date(60));
    t3.addSubtask(new Task("Task 3A", new Date(50), new Date(55)));
    t3.addSubtask(new Task("Task 3B", new Date(56), new Date(60)));
    t3.setPercentComplete(0.30);
    s2.add(t3);
    result.add(s2);
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:TaskSeriesCollectionTests.java

示例4: testGetSeries

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * Some basic tests for the getSeries() methods.
 */
public void testGetSeries() {
    TaskSeries s1 = new TaskSeries("S1");
    TaskSeries s2 = new TaskSeries("S2");
    TaskSeriesCollection c = new TaskSeriesCollection();
    c.add(s1);
    
    assertEquals(c.getSeries(0), s1);
    assertEquals(c.getSeries("S1"), s1);
    assertEquals(c.getSeries("XX"), null);
    
    c.add(s2);
    assertEquals(c.getSeries(1), s2);
    assertEquals(c.getSeries("S2"), s2);
    
    boolean pass = false;
    try {
        c.getSeries(null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:27,代码来源:TaskSeriesCollectionTests.java

示例5: getDrugDataSet

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
private static XYTaskDataset getDrugDataSet(Integer demographicId,String[] dins){

        TaskSeriesCollection datasetDrug = new TaskSeriesCollection();
        oscar.oscarRx.data.RxPrescriptionData prescriptData = new oscar.oscarRx.data.RxPrescriptionData();


        for(String din:dins){
             oscar.oscarRx.data.RxPrescriptionData.Prescription [] arr =  prescriptData.getPrescriptionScriptsByPatientRegionalIdentifier(demographicId,din);
             TaskSeries ts  = new TaskSeries(arr[0].getBrandName());
             for(oscar.oscarRx.data.RxPrescriptionData.Prescription pres:arr){
                 ts.add(new Task(pres.getBrandName(),pres.getRxDate(),pres.getEndDate()));
             }
             datasetDrug.add(ts);
        }

        XYTaskDataset dataset = new XYTaskDataset(datasetDrug);
            dataset.setTransposed(true);
            dataset.setSeriesWidth(0.6);
        return dataset;
    }
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:21,代码来源:MeasurementGraphAction2.java

示例6: createTaskSeriesCollection

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * Creates the final task series collection from the calculated
 * {@link #taskSeries}.
 */
protected TaskSeriesCollection createTaskSeriesCollection() {
	TaskSeriesCollection result = new TaskSeriesCollection();

	for (String seriesName : taskSeries.getKeys()) {
		TaskSeries series = new TaskSeries(seriesName);
		series.setDescription(seriesName);
		result.add(series);

		for (Task task : taskSeries.getCollection(seriesName)) {
			series.add(task);
		}
	}

	return result;
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:20,代码来源:TaskSeriesCollectionCreator.java

示例7: createCollection2

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * Creates a sample collection for testing purposes.
 *
 * @return A sample collection.
 */
private TaskSeriesCollection createCollection2() {
    TaskSeriesCollection result = new TaskSeriesCollection();
    TaskSeries s1 = new TaskSeries("S1");
    Task t1 = new Task("Task 1", new Date(10), new Date(20));
    t1.addSubtask(new Task("Task 1A", new Date(10), new Date(15)));
    t1.addSubtask(new Task("Task 1B", new Date(16), new Date(20)));
    t1.setPercentComplete(0.10);
    s1.add(t1);
    Task t2 = new Task("Task 2", new Date(30), new Date(40));
    t2.addSubtask(new Task("Task 2A", new Date(30), new Date(35)));
    t2.addSubtask(new Task("Task 2B", new Date(36), new Date(40)));
    t2.setPercentComplete(0.20);
    s1.add(t2);
    result.add(s1);
    TaskSeries s2 = new TaskSeries("S2");
    Task t3 = new Task("Task 3", new Date(50), new Date(60));
    t3.addSubtask(new Task("Task 3A", new Date(50), new Date(55)));
    t3.addSubtask(new Task("Task 3B", new Date(56), new Date(60)));
    t3.setPercentComplete(0.30);
    s2.add(t3);
    result.add(s2);
    return result;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:29,代码来源:TaskSeriesCollectionTests.java

示例8: testGetSeries

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * Some basic tests for the getSeries() methods.
 */
public void testGetSeries() {
    TaskSeries s1 = new TaskSeries("S1");
    TaskSeries s2 = new TaskSeries("S2");
    TaskSeriesCollection c = new TaskSeriesCollection();
    c.add(s1);

    assertEquals(c.getSeries(0), s1);
    assertEquals(c.getSeries("S1"), s1);
    assertEquals(c.getSeries("XX"), null);

    c.add(s2);
    assertEquals(c.getSeries(1), s2);
    assertEquals(c.getSeries("S2"), s2);

    boolean pass = false;
    try {
        c.getSeries(null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:27,代码来源:TaskSeriesCollectionTests.java

示例9: getDrugDataSet

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
private static XYTaskDataset getDrugDataSet(String demographic,String[] dins){

        TaskSeriesCollection datasetDrug = new TaskSeriesCollection();
        oscar.oscarRx.data.RxPrescriptionData prescriptData = new oscar.oscarRx.data.RxPrescriptionData();


        for(String din:dins){
             oscar.oscarRx.data.RxPrescriptionData.Prescription [] arr =  prescriptData.getPrescriptionScriptsByPatientRegionalIdentifier(Integer.parseInt(demographic),din);
             TaskSeries ts  = new TaskSeries(arr[0].getBrandName());
             for(oscar.oscarRx.data.RxPrescriptionData.Prescription pres:arr){
                 ts.add(new Task(pres.getBrandName(),pres.getRxDate(),pres.getEndDate()));
             }
             datasetDrug.add(ts);
        }

        XYTaskDataset dataset = new XYTaskDataset(datasetDrug);
            dataset.setTransposed(true);
            dataset.setSeriesWidth(0.6);
        return dataset;
    }
 
开发者ID:oscarservice,项目名称:oscar-old,代码行数:21,代码来源:MeasurementGraphAction2.java

示例10: createCollection1

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * Creates a sample collection for testing purposes.
 * 
 * @return A sample collection.
 */
private TaskSeriesCollection createCollection1() {
    TaskSeriesCollection result = new TaskSeriesCollection();
    TaskSeries s1 = new TaskSeries("S1");
    s1.add(new Task("Task 1", new Date(1), new Date(2)));
    s1.add(new Task("Task 2", new Date(3), new Date(4)));
    result.add(s1);
    TaskSeries s2 = new TaskSeries("S2");
    s2.add(new Task("Task 3", new Date(5), new Date(6)));
    result.add(s2);
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:TaskSeriesCollectionTests.java

示例11: testEquals

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    
    TaskSeries s1 = new TaskSeries("S");
    s1.add(new Task("T1", new Date(1), new Date(2)));
    s1.add(new Task("T2", new Date(11), new Date(22)));
    TaskSeries s2 = new TaskSeries("S");
    s2.add(new Task("T1", new Date(1), new Date(2)));
    s2.add(new Task("T2", new Date(11), new Date(22)));
    TaskSeriesCollection c1 = new TaskSeriesCollection();
    c1.add(s1);
    c1.add(s2);
    
    TaskSeries s1b = new TaskSeries("S");
    s1b.add(new Task("T1", new Date(1), new Date(2)));
    s1b.add(new Task("T2", new Date(11), new Date(22)));
    TaskSeries s2b = new TaskSeries("S");
    s2b.add(new Task("T1", new Date(1), new Date(2)));
    s2b.add(new Task("T2", new Date(11), new Date(22)));
    TaskSeriesCollection c2 = new TaskSeriesCollection();
    c2.add(s1b);
    c2.add(s2b);
    
    assertTrue(c1.equals(c2));
    assertTrue(c2.equals(c1));

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:30,代码来源:TaskSeriesCollectionTests.java

示例12: testGetStartValue3

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * A check for a null task duration.
 */
public void testGetStartValue3() {
    TaskSeriesCollection c = new TaskSeriesCollection();
    TaskSeries s = new TaskSeries("Series 1");
    s.add(new Task("Task with null duration", null));
    c.add(s);
    Number millis = c.getStartValue("Series 1", "Task with null duration");
    assertTrue(millis == null);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:TaskSeriesCollectionTests.java

示例13: testGetEndValue3

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * A check for a null task duration.
 */
public void testGetEndValue3() {
    TaskSeriesCollection c = new TaskSeriesCollection();
    TaskSeries s = new TaskSeries("Series 1");
    s.add(new Task("Task with null duration", null));
    c.add(s);
    Number millis = c.getEndValue("Series 1", "Task with null duration");
    assertTrue(millis == null);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:TaskSeriesCollectionTests.java

示例14: test697153

import org.jfree.data.gantt.TaskSeriesCollection; //导入方法依赖的package包/类
/**
 * A test for bug report 697153.
 */
public void test697153() {

    TaskSeries s1 = new TaskSeries("S1");
    s1.add(new Task("Task 1", new SimpleTimePeriod(new Date(), 
            new Date())));
    s1.add(new Task("Task 2", new SimpleTimePeriod(new Date(), 
            new Date())));
    s1.add(new Task("Task 3", new SimpleTimePeriod(new Date(), 
            new Date())));

    TaskSeries s2 = new TaskSeries("S2");
    s2.add(new Task("Task 2", new SimpleTimePeriod(new Date(), 
            new Date())));
    s2.add(new Task("Task 3", new SimpleTimePeriod(new Date(), 
            new Date())));
    s2.add(new Task("Task 4", new SimpleTimePeriod(new Date(), 
            new Date())));

    TaskSeriesCollection tsc = new TaskSeriesCollection();
    tsc.add(s1);
    tsc.add(s2);

    s1.removeAll();

    int taskCount = tsc.getColumnCount();

    assertEquals(3, taskCount);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:TaskSeriesCollectionTests.java

示例15: getCustomDataset

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


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