* One of the sliders was potentially moved.
* Check for match based on name.
*/
public void checkSliderChanged(String sliderName, double value) {
CreatureType type = creaturePop_.getType();
for (SliderProperties props : this.getSliderProperties()) {
if (sliderName.equals(props.getName())) {
if (sliderName.endsWith(SIZE_LABEL)) {
type.setSize(value);
}
else if (sliderName.endsWith(GESTATION_LABEL)) {
type.setGestationPeriod((int)value);
}
else if (sliderName.endsWith(STARVATION_LABEL)) {
type.setStarvationThreshold((int)value);
}
else if (sliderName.endsWith(NUTRITION_LABEL)) {
type.setNutritionalValue((int)value);
}
else if (sliderName.endsWith(NORM_SPEED_LABEL)) {
type.setNormalSpeed(value);
}
else if (sliderName.endsWith(MAX_SPEED_LABEL )) {
type.setMaxSpeed(value);
}
else {
throw new IllegalStateException("Unexpected sliderName:" + sliderName);
}
}