The global constraints to apply depend on the point,
globalStartConstraints can't always be applied.

FEA: ItEr64OTS03PlanificacionHaciaAtras
This commit is contained in:
Óscar González Fernández 2010-12-15 01:29:51 +01:00
parent e1fbe76a4d
commit 1ca56bd7f8

View file

@ -1388,10 +1388,23 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
result.addAll(getDependenciesConstraintsFor(getPrimaryPoint()));
result.addAll(getTaskConstraints(getPrimaryPoint()));
}
result.addAll(globalStartConstraints);
result.addAll(getGlobalConstraintsToApply(getPrimaryPoint()));
return result;
}
private Collection<Constraint<GanttDate>> getGlobalConstraintsToApply(
Point point) {
Validate.isTrue(isSupportedPoint(point));
switch (point) {
case START:
return globalStartConstraints;
case END:
return globalEndConstraints;
default:
throw new RuntimeException("shouldn't happen");
}
}
protected List<Constraint<GanttDate>> getConstraintsForSecondaryPoint() {
return getDependenciesConstraintsFor(getSecondaryPoint());
}