assert startOpacity <= Opacity.OPAQUE;
assert endOpacity >= Opacity.TRANSPARENT;
assert endOpacity <= Opacity.OPAQUE;
assert duration >= 0;
NMorphScalar morph = new NMorphScalar(FXUtil.OPACITY_MORPH) {
@Override
public void tearDownEffect() {
// do not tear down as this sets original state
};
};
morph.setStartValue(Integer.toString(startOpacity));
morph.setEndValue(Integer.toString(endOpacity));
morph.setTransitionType(FXUtil.EASE_OUT);
morph.setDuration(duration);
return morph;
}