Java Code Examples for net.sf.mpxj.Task#setWBS()

The following examples show how to use net.sf.mpxj.Task#setWBS() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GanttDesignerReader.java    From mpxj with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Read task data from a Gantt Designer file.
 *
 * @param gantt Gantt Designer file
 */
private void processTasks(Gantt gantt)
{
   ProjectCalendar calendar = m_projectFile.getDefaultCalendar();

   for (Gantt.Tasks.Task ganttTask : gantt.getTasks().getTask())
   {
      String wbs = ganttTask.getID();
      ChildTaskContainer parentTask = getParentTask(wbs);

      Task task = parentTask.addTask();
      //ganttTask.getB() // bar type
      //ganttTask.getBC() // bar color
      task.setCost(ganttTask.getC());
      task.setName(ganttTask.getContent());
      task.setDuration(ganttTask.getD());
      task.setDeadline(ganttTask.getDL());
      //ganttTask.getH() // height
      //ganttTask.getIn(); // indent
      task.setWBS(wbs);
      task.setPercentageComplete(ganttTask.getPC());
      task.setStart(ganttTask.getS());
      //ganttTask.getU(); // Unknown
      //ganttTask.getVA(); // Valign

      task.setFinish(calendar.getDate(task.getStart(), task.getDuration(), false));
      m_taskMap.put(wbs, task);
   }
}