@Override protected void onSave() { task.setProgress(ganttObject.getProgress()); taskDao.update(task); }
private boolean isProgressModified(final GanttTask ganttObject, final TaskDO task) { return task != null && NumberHelper.isEqual(ganttObject.getProgress(), task.getProgress()) == false; }
final double height = style.getActivityHeight(); if (style.isShowCompletion() == true) { Integer completion = node.getProgress(); if (completion == null || completion < 0) { completion = 0;
private void assertDurationAndProgress(final GanttTask root, final Integer id, final BigDecimal expectedDuration, final Integer expectedProgress) { final GanttTask task = root.findById(id); assertTrue(NumberHelper.isEqual(expectedDuration, task.getDuration())); if (expectedProgress == null) { assertNull(task.getProgress()); } else { assertEquals(expectedProgress, task.getProgress()); } }
if (ganttTask.getProgress() != null) { task.setPercentageComplete(ganttTask.getProgress());
/** * Creates a new GanttTask and copies all fields from the given task (excluding the predecessor and any children). * @param task * @return */ public static final TaskDO convertToTask(final GanttTask ganttObject) { final TaskDO task = new TaskDO(); // Do not copy the id! The id is given by the data base. task.setGanttPredecessorOffset(ganttObject.getPredecessorOffset()); task.setGanttRelationType(ganttObject.getRelationType()); task.setDuration(ganttObject.getDuration()); task.setStartDate(ganttObject.getStartDate()); task.setEndDate(ganttObject.getEndDate()); task.setProgress(ganttObject.getProgress()); task.setGanttObjectType(ganttObject.getType()); task.setDescription(ganttObject.getDescription()); task.setTitle(ganttObject.getTitle()); return task; }