/** * * @see org.projectforge.business.gantt.GanttTask#getCalculatedEndDate() */ @Override public Date getCalculatedEndDate() { if (endDateCalculated == false) { calculatedEndDate = GanttUtils.getCalculatedEndDate(this); endDateCalculated = true; } return this.calculatedEndDate; }
/** * Calculates the end date. If the end date is set then this value is returned (ignoring the duration in days). If the end date is not * given, then the start date is taken and durationDays (only working days) will be added. If no start date is given, the start date will * be calculated from the node this node depends on. */ public static Date getCalculatedEndDate(final GanttTask node) { final Date end = getCalculatedEndDate(node, new HashSet<Serializable>(), new HashSet<Serializable>()); return end; }
private static Date getPredecessorRelDate(final GanttRelationType relationType, final GanttTask predecessor, final Set<Serializable> startDateSet, final Set<Serializable> endDateSet) { if (relationType == GanttRelationType.START_START || relationType == GanttRelationType.START_FINISH) { final Date calculatedStartDate = getCalculatedStartDate(predecessor, startDateSet, endDateSet); return calculatedStartDate; } else { final Date calculatedEndDate = getCalculatedEndDate(predecessor, startDateSet, endDateSet); return calculatedEndDate; } }
ObjectInfo(final GanttTask node, final int row) { this.fromDate = GanttUtils.getCalculatedStartDate(node); this.toDate = GanttUtils.getCalculatedEndDate(node); if (fromDate != null) { this.x1 = getXValue(fromDate); } else { x1 = 0; } if (toDate != null) { this.x2 = getXValue(toDate); } else { x2 = 0; } this.row = row; this.y = style.getYScale() * row; }
for (final GanttTask node : allVisibleGanttObjects) { Date periodStart = GanttUtils.getCalculatedStartDate(node); Date periodEnd = GanttUtils.getCalculatedEndDate(node); if (periodEnd == null) { periodEnd = periodStart;
private GanttTask getExternalGanttObject(final TaskDO task) { final GanttTask ganttObject = convertToGanttObject(task); if (ganttObject.getStartDate() == null) { ganttObject.setStartDate(GanttUtils.getCalculatedStartDate(ganttObject)); } if (ganttObject.getEndDate() == null) { ganttObject.setEndDate(GanttUtils.getCalculatedEndDate(ganttObject)); } // Remove any existing predecessor chain: ganttObject.setPredecessor(null); return ganttObject; }
@Test public void circularReferences() { final GanttTaskImpl a1 = createActivity(1).setTitle("a1"); final GanttTaskImpl a1_1 = createActivity(10).setTitle("a1_1"); a1_1.setPredecessor(a1); a1.addChild(a1_1); log.error("The two following error messages about circular reference detection are OK and part of this test."); assertNull(GanttUtils.getCalculatedStartDate(a1)); assertNull(GanttUtils.getCalculatedEndDate(a1)); assertNull(GanttUtils.getCalculatedStartDate(a1_1)); assertNull(GanttUtils.getCalculatedEndDate(a1_1)); }
final Date calculatedEndDate = getCalculatedEndDate(node, startDateSet, endDateSet); if (calculatedEndDate != null) { startDate = calculateDate(calculatedEndDate, -durationDays);
final Date date = getCalculatedEndDate(child, startDateSet, endDateSet); if (date != null && (endDate == null || date.after(endDate)) == true) { endDate = date;