controls.setHeading("Controls");
FormLayout fl = new FormLayout();
fl.setLabelWidth(125);
controls.setLayout(fl);
Slider segments = new Slider();
segments.setMaxValue(12);
segments.setMinValue(1);
segments.setIncrement(1);
segments.setValue(numSegments);
segments.addListener(Events.Change, new Listener<SliderEvent>() {
public void handleEvent(SliderEvent be) {
numSegments = be.getNewValue();
adjustUpdateSpeed(updateSpeed);
}
});
SliderField segFld = new SliderField(segments);
segFld.setFieldLabel("Segments (#)");
controls.add(segFld);
final Slider update = new Slider() {
@Override
protected String onFormatValue(int value) {
if (value == 0) return "Off";
return super.onFormatValue(value);
}
};
update.setMinValue(0);
update.setMaxValue(3000);
update.setIncrement(100);
update.setValue(updateSpeed);
update.setMessage("{0}ms");
update.addListener(Events.Change, new Listener<SliderEvent>() {
public void handleEvent(SliderEvent se) {
adjustUpdateSpeed(se.getNewValue());
}
});
SliderField updFld = new SliderField(update);