/** * Cancels this timer. If the timer is not running, this is a no-op. */ public void cancel() { if (!isRunning()) { return; } cancelCounter++; if (isRepeating) { clearInterval(timerId); } else { clearTimeout(timerId); } timerId = null; }
/** * Schedules a timer that elapses repeatedly. If the timer is already running then it will be * first canceled before re-scheduling. * * @param periodMillis how long to wait before the timer elapses, in milliseconds, between each * repetition */ public void scheduleRepeating(int periodMillis) { if (periodMillis <= 0) { throw new IllegalArgumentException("must be positive"); } if (isRunning()) { cancel(); } isRepeating = true; timerId = setInterval(createCallback(this, cancelCounter), periodMillis); }
/** * Schedules a timer to elapse in the future. If the timer is already running then it will be * first canceled before re-scheduling. * * @param delayMillis how long to wait before the timer elapses, in milliseconds */ public void schedule(int delayMillis) { if (delayMillis < 0) { throw new IllegalArgumentException("must be non-negative"); } if (isRunning()) { cancel(); } isRepeating = false; timerId = setTimeout(createCallback(this, cancelCounter), delayMillis); }
@Override public boolean isWorkPending() { return lazyAdjustColumnWidths.isRunning(); }
private void stopTimer() { if (null != this.timer) { if (this.timer.isRunning()) { this.timer.cancel(); } this.timer = null; } }
private void clearTimers() { if (null != this.hideTimer) { if (this.hideTimer.isRunning()) { this.hideTimer.cancel(); } } } }
@Override protected void doRemove() { if (timer.isRunning()) { timer.cancel(); } } };
public void startTimeout() { if (timeout > 0 && (null == timer || !timer.isRunning())) { timer = new Timer() { @Override public void run() { FloatingWidgetView.this.hide(); } }; timer.schedule(timeout); } }
public void stopTimeout() { if (null != timer && timer.isRunning()) { timer.cancel(); } }
public void clear() { if (null != timer && timer.isRunning()) { timer.cancel(); } shortcutCallbacks.clear(); reset(); }
public void show() { if (null != this.timer && this.timer.isRunning()) { return; } startTimer(); view.show(); }
void scheduleMove(final Callback callback, final int x, final int y, final int millis) { timeoutRunnable = () -> callback.onMove(x, y); if (!timer.isRunning()) { timer.schedule(millis); } }
@Override public void onChange(Observable<T> observable) { if(timer.isRunning()) { timer.cancel(); } timer.schedule(delay); } });
private void onKeyUp(KeyUpEvent event) { if(timer.isRunning()) { timer.cancel(); } timer.schedule(DEBOUNCE_DELAY_MS); }
private void clearTimeout() { if (null != this.timeout) { log("Clearing timeout..."); if (this.timeout.isRunning()) { this.timeout.cancel(); } this.timeout = null; } }
/** * Cancels this timer. If the timer is not running, this is a no-op. */ public void cancel() { if (!isRunning()) { return; } cancelCounter++; if (isRepeating) { clearInterval(timerId); } else { clearTimeout(timerId); } timerId = null; }
/** * Cancels this timer. If the timer is not running, this is a no-op. */ public void cancel() { if (!isRunning()) { return; } cancelCounter++; if (isRepeating) { clearInterval(timerId); } else { clearTimeout(timerId); } timerId = null; }
public void clear() { removeHandlers(); removeFromLayer(layer, shapeProxy); if (null != this.timer && this.timer.isRunning()) { this.timer.cancel(); } this.attached = false; this.xDiff = null; this.yDiff = null; }
public Decorator hide() { if (!timer.isRunning()) { decorator.animate(AnimationTweener.LINEAR, AnimationProperties.toPropertyList(AnimationProperty.Properties.STROKE_ALPHA(0)), ANIMATION_DURATION, createHideAnimationCallback()); } return this; }
public Decorator show(final double x, final double y) { if (!timer.isRunning()) { decorator.animate(AnimationTweener.LINEAR, AnimationProperties.toPropertyList(AnimationProperty.Properties.STROKE_ALPHA(1)), ANIMATION_DURATION, createShowAnimationCallback(x, y)); timer.schedule(TIMER_DELAY); } return this; }