本文整理汇总了Java中org.jfree.data.gantt.TaskSeriesCollection类的典型用法代码示例。如果您正苦于以下问题:Java TaskSeriesCollection类的具体用法?Java TaskSeriesCollection怎么用?Java TaskSeriesCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskSeriesCollection类属于org.jfree.data.gantt包,在下文中一共展示了TaskSeriesCollection类的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);
}
示例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);
}
示例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;
}
示例4: testGetStartValue2
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getStartValue() method for sub-intervals.
*/
public void testGetStartValue2() {
TaskSeriesCollection c = createCollection2();
assertEquals(new Long(10L), c.getStartValue("S1", "Task 1", 0));
assertEquals(new Long(16L), c.getStartValue("S1", "Task 1", 1));
assertEquals(new Long(30L), c.getStartValue("S1", "Task 2", 0));
assertEquals(new Long(36L), c.getStartValue("S1", "Task 2", 1));
assertEquals(new Long(50L), c.getStartValue("S2", "Task 3", 0));
assertEquals(new Long(56L), c.getStartValue("S2", "Task 3", 1));
assertEquals(new Long(10L), c.getStartValue(0, 0, 0));
assertEquals(new Long(16L), c.getStartValue(0, 0, 1));
assertEquals(new Long(30L), c.getStartValue(0, 1, 0));
assertEquals(new Long(36L), c.getStartValue(0, 1, 1));
assertEquals(new Long(50L), c.getStartValue(1, 2, 0));
assertEquals(new Long(56L), c.getStartValue(1, 2, 1));
}
示例5: testGetEndValue2
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getEndValue() method for sub-intervals.
*/
public void testGetEndValue2() {
TaskSeriesCollection c = createCollection2();
assertEquals(new Long(15L), c.getEndValue("S1", "Task 1", 0));
assertEquals(new Long(20L), c.getEndValue("S1", "Task 1", 1));
assertEquals(new Long(35L), c.getEndValue("S1", "Task 2", 0));
assertEquals(new Long(40L), c.getEndValue("S1", "Task 2", 1));
assertEquals(new Long(55L), c.getEndValue("S2", "Task 3", 0));
assertEquals(new Long(60L), c.getEndValue("S2", "Task 3", 1));
assertEquals(new Long(15L), c.getEndValue(0, 0, 0));
assertEquals(new Long(20L), c.getEndValue(0, 0, 1));
assertEquals(new Long(35L), c.getEndValue(0, 1, 0));
assertEquals(new Long(40L), c.getEndValue(0, 1, 1));
assertEquals(new Long(55L), c.getEndValue(1, 2, 0));
assertEquals(new Long(60L), c.getEndValue(1, 2, 1));
}
示例6: testGetStartValue
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getStartValue() method.
*/
public void testGetStartValue() {
TaskSeriesCollection c = createCollection1();
assertEquals(new Long(1L), c.getStartValue("S1", "Task 1"));
assertEquals(new Long(3L), c.getStartValue("S1", "Task 2"));
assertEquals(new Long(5L), c.getStartValue("S2", "Task 3"));
assertEquals(new Long(1L), c.getStartValue(0, 0));
assertEquals(new Long(3L), c.getStartValue(0, 1));
assertEquals(null, c.getStartValue(0, 2));
assertEquals(null, c.getStartValue(1, 0));
assertEquals(null, c.getStartValue(1, 1));
assertEquals(new Long(5L), c.getStartValue(1, 2));
// test collection 3, which doesn't define all tasks in all series
TaskSeriesCollection c3 = createCollection3();
assertEquals(new Long(100), c3.getStartValue(0, 0));
assertEquals(new Long(220), c3.getStartValue(0, 1));
assertTrue(c3.getStartValue(1, 0) == null);
assertEquals(new Long(2220), c3.getStartValue(1, 1));
}
示例7: testGetStartValue2
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getStartValue() method for sub-intervals.
*/
public void testGetStartValue2() {
TaskSeriesCollection c = createCollection2();
assertEquals(new Long(10L), c.getStartValue("S1", "Task 1", 0));
assertEquals(new Long(16L), c.getStartValue("S1", "Task 1", 1));
assertEquals(new Long(30L), c.getStartValue("S1", "Task 2", 0));
assertEquals(new Long(36L), c.getStartValue("S1", "Task 2", 1));
assertEquals(new Long(50L), c.getStartValue("S2", "Task 3", 0));
assertEquals(new Long(56L), c.getStartValue("S2", "Task 3", 1));
assertEquals(new Long(10L), c.getStartValue(0, 0, 0));
assertEquals(new Long(16L), c.getStartValue(0, 0, 1));
assertEquals(new Long(30L), c.getStartValue(0, 1, 0));
assertEquals(new Long(36L), c.getStartValue(0, 1, 1));
assertEquals(new Long(50L), c.getStartValue(1, 2, 0));
assertEquals(new Long(56L), c.getStartValue(1, 2, 1));
TaskSeriesCollection c3 = createCollection3();
assertEquals(new Long(11), c3.getStartValue(0, 0, 0));
assertEquals(new Long(22), c3.getStartValue(0, 1, 0));
assertEquals(new Long(33), c3.getStartValue(0, 1, 1));
assertTrue(c3.getStartValue(1, 0, 0) == null);
assertEquals(new Long(44), c3.getStartValue(1, 1, 0));
assertEquals(new Long(55), c3.getStartValue(1, 1, 1));
assertEquals(new Long(66), c3.getStartValue(1, 1, 2));
}
示例8: testGetEndValue
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getEndValue() method.
*/
public void testGetEndValue() {
TaskSeriesCollection c = createCollection1();
assertEquals(new Long(2L), c.getEndValue("S1", "Task 1"));
assertEquals(new Long(4L), c.getEndValue("S1", "Task 2"));
assertEquals(new Long(6L), c.getEndValue("S2", "Task 3"));
assertEquals(new Long(2L), c.getEndValue(0, 0));
assertEquals(new Long(4L), c.getEndValue(0, 1));
assertEquals(null, c.getEndValue(0, 2));
assertEquals(null, c.getEndValue(1, 0));
assertEquals(null, c.getEndValue(1, 1));
assertEquals(new Long(6L), c.getEndValue(1, 2));
// test collection 3, which doesn't define all tasks in all series
TaskSeriesCollection c3 = createCollection3();
assertEquals(new Long(200), c3.getEndValue(0, 0));
assertEquals(new Long(350), c3.getEndValue(0, 1));
assertTrue(c3.getEndValue(1, 0) == null);
assertEquals(new Long(3350), c3.getEndValue(1, 1));
}
示例9: testGetEndValue2
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getEndValue() method for sub-intervals.
*/
public void testGetEndValue2() {
TaskSeriesCollection c = createCollection2();
assertEquals(new Long(15L), c.getEndValue("S1", "Task 1", 0));
assertEquals(new Long(20L), c.getEndValue("S1", "Task 1", 1));
assertEquals(new Long(35L), c.getEndValue("S1", "Task 2", 0));
assertEquals(new Long(40L), c.getEndValue("S1", "Task 2", 1));
assertEquals(new Long(55L), c.getEndValue("S2", "Task 3", 0));
assertEquals(new Long(60L), c.getEndValue("S2", "Task 3", 1));
assertEquals(new Long(15L), c.getEndValue(0, 0, 0));
assertEquals(new Long(20L), c.getEndValue(0, 0, 1));
assertEquals(new Long(35L), c.getEndValue(0, 1, 0));
assertEquals(new Long(40L), c.getEndValue(0, 1, 1));
assertEquals(new Long(55L), c.getEndValue(1, 2, 0));
assertEquals(new Long(60L), c.getEndValue(1, 2, 1));
TaskSeriesCollection c3 = createCollection3();
assertEquals(new Long(111), c3.getEndValue(0, 0, 0));
assertEquals(new Long(222), c3.getEndValue(0, 1, 0));
assertEquals(new Long(333), c3.getEndValue(0, 1, 1));
assertTrue(c3.getEndValue(1, 0, 0) == null);
assertEquals(new Long(444), c3.getEndValue(1, 1, 0));
assertEquals(new Long(555), c3.getEndValue(1, 1, 1));
assertEquals(new Long(666), c3.getEndValue(1, 1, 2));
}
示例10: 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);
}
示例11: 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;
}
示例12: 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;
}
示例13: testGetStartValue
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getStartValue() method.
*/
public void testGetStartValue() {
TaskSeriesCollection c = createCollection1();
assertEquals(new Long(1L), c.getStartValue("S1", "Task 1"));
assertEquals(new Long(3L), c.getStartValue("S1", "Task 2"));
assertEquals(new Long(5L), c.getStartValue("S2", "Task 3"));
assertEquals(new Long(1L), c.getStartValue(0, 0));
assertEquals(new Long(3L), c.getStartValue(0, 1));
assertEquals(null, c.getStartValue(0, 2));
assertEquals(null, c.getStartValue(1, 0));
assertEquals(null, c.getStartValue(1, 1));
assertEquals(new Long(5L), c.getStartValue(1, 2));
// test collection 3, which doesn't define all tasks in all series
TaskSeriesCollection c3 = createCollection3();
assertEquals(new Long(100), c3.getStartValue(0, 0));
assertEquals(new Long(220), c3.getStartValue(0, 1));
assertTrue(c3.getStartValue(1, 0) == null);
assertEquals(new Long(2220), c3.getStartValue(1, 1));
}
示例14: testGetStartValue2
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getStartValue() method for sub-intervals.
*/
public void testGetStartValue2() {
TaskSeriesCollection c = createCollection2();
assertEquals(new Long(10L), c.getStartValue("S1", "Task 1", 0));
assertEquals(new Long(16L), c.getStartValue("S1", "Task 1", 1));
assertEquals(new Long(30L), c.getStartValue("S1", "Task 2", 0));
assertEquals(new Long(36L), c.getStartValue("S1", "Task 2", 1));
assertEquals(new Long(50L), c.getStartValue("S2", "Task 3", 0));
assertEquals(new Long(56L), c.getStartValue("S2", "Task 3", 1));
assertEquals(new Long(10L), c.getStartValue(0, 0, 0));
assertEquals(new Long(16L), c.getStartValue(0, 0, 1));
assertEquals(new Long(30L), c.getStartValue(0, 1, 0));
assertEquals(new Long(36L), c.getStartValue(0, 1, 1));
assertEquals(new Long(50L), c.getStartValue(1, 2, 0));
assertEquals(new Long(56L), c.getStartValue(1, 2, 1));
TaskSeriesCollection c3 = createCollection3();
assertEquals(new Long(11), c3.getStartValue(0, 0, 0));
assertEquals(new Long(22), c3.getStartValue(0, 1, 0));
assertEquals(new Long(33), c3.getStartValue(0, 1, 1));
assertTrue(c3.getStartValue(1, 0, 0) == null);
assertEquals(new Long(44), c3.getStartValue(1, 1, 0));
assertEquals(new Long(55), c3.getStartValue(1, 1, 1));
assertEquals(new Long(66), c3.getStartValue(1, 1, 2));
}
示例15: testGetEndValue
import org.jfree.data.gantt.TaskSeriesCollection; //导入依赖的package包/类
/**
* Some tests for the getEndValue() method.
*/
public void testGetEndValue() {
TaskSeriesCollection c = createCollection1();
assertEquals(new Long(2L), c.getEndValue("S1", "Task 1"));
assertEquals(new Long(4L), c.getEndValue("S1", "Task 2"));
assertEquals(new Long(6L), c.getEndValue("S2", "Task 3"));
assertEquals(new Long(2L), c.getEndValue(0, 0));
assertEquals(new Long(4L), c.getEndValue(0, 1));
assertEquals(null, c.getEndValue(0, 2));
assertEquals(null, c.getEndValue(1, 0));
assertEquals(null, c.getEndValue(1, 1));
assertEquals(new Long(6L), c.getEndValue(1, 2));
// test collection 3, which doesn't define all tasks in all series
TaskSeriesCollection c3 = createCollection3();
assertEquals(new Long(200), c3.getEndValue(0, 0));
assertEquals(new Long(350), c3.getEndValue(0, 1));
assertTrue(c3.getEndValue(1, 0) == null);
assertEquals(new Long(3350), c3.getEndValue(1, 1));
}