Add function isSigmoid in IAssignmentFunctionConfiguration

FEA: ItEr75S23FixAllocationModel
This commit is contained in:
Manuel Rego Casasnovas 2011-08-26 09:10:49 +02:00
parent bed8715973
commit 5e2f50d082
3 changed files with 23 additions and 5 deletions

View file

@ -1302,7 +1302,7 @@ class Row {
// Cannot apply function if task contains consolidated day assignments
final ResourceAllocation<?> resourceAllocation = getAllocation();
if (isSigmoid(function.getName())
if (function.isSigmoid()
&& !resourceAllocation
.getConsolidatedAssignments().isEmpty()) {
showCannotApplySigmoidFunction();
@ -1331,10 +1331,6 @@ class Row {
this.previousListitem = previousListitem;
}
private boolean isSigmoid(String value) {
return AssignmentFunctionName.SIGMOID.toString().equals(value);
}
private void showCannotApplySigmoidFunction() {
try {
Messagebox
@ -1401,6 +1397,11 @@ class Row {
fireCellChanged();
}
@Override
public boolean isSigmoid() {
return false;
}
};
private IAssignmentFunctionConfiguration manualFunction = new IAssignmentFunctionConfiguration() {
@ -1430,6 +1431,11 @@ class Row {
resourceAllocation.setAssignmentFunction(ManualFunction.create());
}
@Override
public boolean isSigmoid() {
return false;
}
};
private abstract class CommonStrechesConfiguration extends
@ -1533,6 +1539,11 @@ class Row {
fireCellChanged();
}
@Override
public boolean isSigmoid() {
return true;
}
};
private IAssignmentFunctionConfiguration[] functions = {

View file

@ -34,4 +34,6 @@ public interface IAssignmentFunctionConfiguration {
public void goToConfigure();
public boolean isSigmoid();
}

View file

@ -97,4 +97,9 @@ public abstract class StrechesFunctionConfiguration implements
resourceAllocation.setAssignmentFunction(StretchesFunction.create());
}
@Override
public boolean isSigmoid() {
return false;
}
}