[Bug #897] Fix bug

Change message.

FEA: ItEr71S04BugFixing
This commit is contained in:
Óscar González Fernández 2011-02-28 16:22:47 +01:00
parent 95b3be8486
commit 39e3af1870

View file

@ -311,7 +311,7 @@ public class StretchesFunctionController extends GenericForwardComposer {
private void appendLengthPercentage(Listitem item, final Stretch stretch) {
final Decimalbox tempDecimalbox = new Decimalbox();
Decimalbox decimalbox = Util.bind(tempDecimalbox,
final Decimalbox decimalbox = Util.bind(tempDecimalbox,
new Util.Getter<BigDecimal>() {
@Override
public BigDecimal get() {
@ -324,18 +324,18 @@ public class StretchesFunctionController extends GenericForwardComposer {
if (value == null) {
value = BigDecimal.ZERO;
}
if (value.toBigInteger().intValue() > 100
|| value.toBigInteger().intValue() < 0) {
throw new WrongValueException(
tempDecimalbox,
_("Length percentage should be between 0 and 100"));
}
value = value.setScale(2).divide(
new BigDecimal(100), RoundingMode.DOWN);
try {
stretchesFunctionModel
.setStretchLengthPercentage(stretch,
value);
focusState.focusOn(stretch, Field.LENGTH);
reloadStretchesListAndCharts();
} catch (IllegalArgumentException e) {
throw new WrongValueException(tempDecimalbox, e
.getMessage());
}
stretchesFunctionModel.setStretchLengthPercentage(
stretch, value);
focusState.focusOn(stretch, Field.LENGTH);
reloadStretchesListAndCharts();
}
});
appendChild(item, decimalbox);