Пример #1
0
 /**
  * Returns the task in the series that has the specified description.
  *
  * @param description the name (<code>null</code> not permitted).
  * @return The task (possibly <code>null</code>).
  */
 public Task get(String description) {
   Task result = null;
   int count = this.tasks.size();
   for (int i = 0; i < count; i++) {
     Task t = (Task) this.tasks.get(i);
     if (t.getDescription().equals(description)) {
       result = t;
       break;
     }
   }
   return result;
 }
Пример #2
0
 @Override
 protected Object[] createItemArray(XYDataset dataset, int series, int item) {
   if (dataset instanceof XYTaskDataset) {
     Task t = ((XYTaskDataset) dataset).getTasks().getSeries(series).get(item);
     Object[] result = new Object[4];
     result[0] = t.getDescription();
     result[1] = xformat(t.getDuration().getStart().getTime());
     double y = dataset.getYValue(series, item);
     if (Double.isNaN(y) && dataset.getY(series, item) == null) {
       result[2] = this.getNullYString();
     } else {
       result[2] = yformat(y);
     }
     result[3] = xformat(t.getDuration().getEnd().getTime());
     return result;
   } else {
     return super.createItemArray(dataset, series, item);
   }
 }