use of org.rstudio.studio.client.common.presentation.events.SlideIndexChangedEvent in project rstudio by rstudio.
the class Presentation method onPresentationSlideChanged.
private void onPresentationSlideChanged(final int index, final JavaScriptObject jsCmds) {
// note the slide index and save it
currentState_.setSlideIndex(index);
indexPersister_.setIndex(index);
handlerManager_.fireEvent(new SlideIndexChangedEvent(index));
// execute commands if we stay on the slide for > 500ms
new Timer() {
@Override
public void run() {
// execute commands if we're still on the same slide
if (index == currentState_.getSlideIndex()) {
JsArray<JavaScriptObject> cmds = jsCmds.cast();
for (int i = 0; i < cmds.length(); i++) dispatchCommand(cmds.get(i));
}
}
}.schedule(500);
}
Aggregations