Bug #1354: Fix bug
Although the constraint is not applied it must be provided. Otherwise the dominating forces would not take it into account. Normally this wasn't a problem since if the secondary point date changes it was provided. But it can happen that the secondary point doesn't change, in that case the constraint must still be taken into account.
This commit is contained in:
parent
d91016f532
commit
93d5667769
1 changed files with 14 additions and 11 deletions
|
|
@ -1746,15 +1746,17 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
||||||
.withConstraints(restrictions.getStartConstraints())
|
.withConstraints(restrictions.getStartConstraints())
|
||||||
.withConstraints(getStartConstraints())
|
.withConstraints(getStartConstraints())
|
||||||
.applyWithoutFinalCheck();
|
.applyWithoutFinalCheck();
|
||||||
if (result != null && !result.equals(getStartDate(task))) {
|
if (result != null) {
|
||||||
return enforceRestrictions(result);
|
enforceRestrictions(result);
|
||||||
|
return biggerThan(result, adapter.getEndDateFor(task));
|
||||||
}
|
}
|
||||||
return restrictions;
|
return restrictions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private PositionRestrictions enforceRestrictions(GanttDate result) {
|
private void enforceRestrictions(GanttDate result) {
|
||||||
adapter.setStartDateFor(task, result);
|
if (!result.equals(getStartDate(task))) {
|
||||||
return biggerThan(result, adapter.getEndDateFor(task));
|
adapter.setStartDateFor(task, result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1768,8 +1770,9 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
||||||
.withConstraints(restrictions.getEndConstraints())
|
.withConstraints(restrictions.getEndConstraints())
|
||||||
.withConstraints(getEndConstraints())
|
.withConstraints(getEndConstraints())
|
||||||
.applyWithoutFinalCheck();
|
.applyWithoutFinalCheck();
|
||||||
if (result != null && !result.equals(getEndDateFor(task))) {
|
if (result != null) {
|
||||||
return enforceRestrictions(result);
|
enforceRestrictions(result);
|
||||||
|
return lessThan(adapter.getStartDate(task), result);
|
||||||
}
|
}
|
||||||
return restrictions;
|
return restrictions;
|
||||||
}
|
}
|
||||||
|
|
@ -1784,11 +1787,11 @@ public class GanttDiagramGraph<V, D extends IDependency<V>> implements
|
||||||
return adapter.getEndConstraintsFor(task);
|
return adapter.getEndConstraintsFor(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
private PositionRestrictions enforceRestrictions(GanttDate newEnd) {
|
private void enforceRestrictions(GanttDate newEnd) {
|
||||||
adapter.setEndDateFor(task, newEnd);
|
if (!newEnd.equals(getEndDateFor(task))) {
|
||||||
return lessThan(adapter.getStartDate(task), newEnd);
|
adapter.setEndDateFor(task, newEnd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue