private void initTimeline() {
iterationTimeSlider.setMaximum(canvas.getTimeline().getDuration());
totalTimeSlider.setMaximum(canvas.getTimeline().getFullDuration());
canvas.getTimeline().addCallback(EventType.BEGIN, new TweenCallback() {
@Override public void onEvent(EventType eventType, BaseTween source) {
totalTimeSlider.setValue(0);
}
});
canvas.getTimeline().addCallback(EventType.START, new TweenCallback() {
@Override public void onEvent(EventType eventType, BaseTween source) {
if (canvas.getTimeline().getState()%4 == 2 && canvas.getTimeline().isYoyo())
iterationTimeSlider.setValue(canvas.getTimeline().getFullDuration());
else if (canvas.getTimeline().getState()%2 == 0)
iterationTimeSlider.setValue(0);