/** * Schedules a task for repeated execution. The task will be executed on the * UI thread and will begin executing immediately. * * @param callback * The task to execute. * * @param period * The interval at which the task will be repeated (in milliseconds). */ public static ScheduledCallback scheduleRecurringCallback(Runnable callback, long period) { return scheduleRecurringCallback(callback, 0, period); }
/** * Schedules a task for repeated execution. The task will be executed on the * UI thread and will begin executing immediately. * * @param callback * The task to execute. * * @param period * The interval at which the task will be repeated. */ public static ScheduledCallback scheduleRecurringCallback(Runnable callback, long period) { return scheduleRecurringCallback(callback, 0, period); }
public void scheduleRecurring(long delay, long period, Runnable callback) { scheduleRecurringCallback(callback, delay, period); }
public void scheduleRecurring(long period, Runnable callback) { scheduleRecurringCallback(callback, period); }
public void play() { if (scheduledCallback != null) { throw new IllegalStateException("Movie is already playing."); } scheduledCallback = ApplicationContext.scheduleRecurringCallback(nextFrameCallback, (int)((1 / (double)frameRate) * 1000)); movieListeners.movieStarted(this); }
public void play() { if (scheduledCallback != null) { throw new IllegalStateException("Movie is already playing."); } scheduledCallback = ApplicationContext.scheduleRecurringCallback(nextFrameCallback, (int)((1 / (double)frameRate) * 1000)); movieListeners.movieStarted(this); }
/** * Starts the transition. Calls {@link #update()} to establish the * initial state and starts a timer that will repeatedly call * {@link #update()} at the current rate. The specified * <tt>TransitionListener</tt> will be notified when the transition * completes. * * @param transitionListener * The listener to get notified when the transition completes, or * <tt>null</tt> if no notification is necessary */ public void start(TransitionListener transitionListener) { if (transitionCallback != null) { throw new IllegalStateException("Transition is currently running."); } this.transitionListener = transitionListener; startTime = System.currentTimeMillis(); currentTime = startTime; transitionCallback = ApplicationContext.scheduleRecurringCallback(updateCallback, getInterval()); update(); }
/** * Starts the transition. Calls {@link #update()} to establish the * initial state and starts a timer that will repeatedly call * {@link #update()} at the current rate. The specified * <tt>TransitionListener</tt> will be notified when the transition * completes. * * @param transitionListenerArgument * The listener to get notified when the transition completes, or * <tt>null</tt> if no notification is necessary */ public void start(TransitionListener transitionListenerArgument) { if (transitionCallback != null) { throw new IllegalStateException("Transition is currently running."); } this.transitionListener = transitionListenerArgument; startTime = System.currentTimeMillis(); currentTime = startTime; transitionCallback = ApplicationContext.scheduleRecurringCallback(updateCallback, getInterval()); update(); }
private void showCaret(boolean show) { if (scheduledBlinkCaretCallback != null) { scheduledBlinkCaretCallback.cancel(); } if (show) { caretOn = true; scheduledBlinkCaretCallback = ApplicationContext.scheduleRecurringCallback(blinkCaretCallback, Platform.getCursorBlinkRate()); // Run the callback once now to show the cursor immediately blinkCaretCallback.run(); } else { scheduledBlinkCaretCallback = null; } }
private void showCaret(boolean show) { if (scheduledBlinkCaretCallback != null) { scheduledBlinkCaretCallback.cancel(); } if (show) { caretOn = true; scheduledBlinkCaretCallback = ApplicationContext.scheduleRecurringCallback( blinkCaretCallback, Platform.getCursorBlinkRate()); // Run the callback once now to show the cursor immediately blinkCaretCallback.run(); } else { scheduledBlinkCaretCallback = null; } } }
private void showCaret(boolean show) { if (scheduledBlinkCaretCallback != null) { scheduledBlinkCaretCallback.cancel(); } if (show) { caretOn = true; scheduledBlinkCaretCallback = ApplicationContext.scheduleRecurringCallback( blinkCaretCallback, Platform.getCursorBlinkRate()); // Run the callback once now to show the cursor immediately blinkCaretCallback.run(); } else { scheduledBlinkCaretCallback = null; } } }
private void showCaret(boolean show) { if (scheduledBlinkCaretCallback != null) { scheduledBlinkCaretCallback.cancel(); } if (show) { caretOn = true; scheduledBlinkCaretCallback = ApplicationContext.scheduleRecurringCallback(blinkCaretCallback, Platform.getCursorBlinkRate()); // Run the callback once now to show the cursor immediately blinkCaretCallback.run(); } else { scheduledBlinkCaretCallback = null; } }
ApplicationContext.scheduleRecurringCallback(scrollSelectionCallback, SCROLL_RATE);
ApplicationContext.scheduleRecurringCallback(scrollSelectionCallback, SCROLL_RATE);
: TextArea.ScrollDirection.DOWN; scheduledScrollSelectionCallback = ApplicationContext.scheduleRecurringCallback( scrollSelectionCallback, SCROLL_RATE);
: TextArea.ScrollDirection.DOWN; scheduledScrollSelectionCallback = ApplicationContext.scheduleRecurringCallback( scrollSelectionCallback, SCROLL_RATE);