/** * Returns the status of the associated timer. * * @return <code>true</code> is the associated timer is running, * <code>false</code> otherwise. */ private boolean isRunning() { TimelineState state = this.timeline.getState(); return ((state == TimelineState.PLAYING_FORWARD) || (state == TimelineState.PLAYING_REVERSE)); }
public final void setCycleDelay(long cycleDelay) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline"); } this.cycleDelay = cycleDelay; }
public final void setSecondaryID(Comparable<?> secondaryId) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline"); } this.secondaryId = secondaryId; }
public final void setInitialDelay(long initialDelay) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline"); } this.initialDelay = initialDelay; }
public final void setEase(TimelineEase ease) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline"); } this.ease = ease; }
public final void setEase(TimelineEase ease) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline"); } this.ease = ease; }
public float getFocusStrength(boolean hasFocus) { if (this.focusTimeline == null) return 0.0f; TimelineState focusTimelineState = this.focusTimeline.getState(); if ((focusTimelineState == TimelineState.READY) || (focusTimelineState == TimelineState.PLAYING_FORWARD) || (focusTimelineState == TimelineState.PLAYING_REVERSE)) { return this.focusTimeline.getTimelinePosition(); } return hasFocus ? 1.0f : 0.0f; }
public float getFocusStrength(boolean hasFocus) { if (this.focusTimeline == null) return 0.0f; TimelineState focusTimelineState = this.focusTimeline.getState(); if ((focusTimelineState == TimelineState.READY) || (focusTimelineState == TimelineState.PLAYING_FORWARD) || (focusTimelineState == TimelineState.PLAYING_REVERSE)) { return this.focusTimeline.getTimelinePosition(); } return hasFocus ? 1.0f : 0.0f; }
public final void setDuration(long durationMs) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline [" + this.toString() + "]"); } this.duration = durationMs; }
public final void setInitialDelay(long initialDelay) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline [" + this.toString() + "]"); } this.initialDelay = initialDelay; }
public void run() { if (Timeline.this.getState() == TimelineState.CANCELLED) return; // System.err.println("Timeline @" // + Timeline.this.hashCode()); callback.onTimelinePulse(durationFraction, timelinePosition); } });
public final void setInitialDelay(long initialDelay) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline [" + this.toString() + "]"); } this.initialDelay = initialDelay; }
public final void setCycleDelay(long cycleDelay) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline [" + this.toString() + "]"); } this.cycleDelay = cycleDelay; }
@Override public void run() { if (Timeline.this.getState() == TimelineState.CANCELLED) return; // System.err.println("Timeline @" // + Timeline.this.hashCode()); callback.onTimelinePulse(durationFraction, timelinePosition); } });
public final void setCycleDelay(long cycleDelay) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline [" + this.toString() + "]"); } this.cycleDelay = cycleDelay; }
public final void removeCallback(TimelineCallback callback) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline [" + this.toString() + "]"); } this.callback.removeCallback(callback); }
public final void removeCallback(TimelineCallback callback) { if (this.getState() != TimelineState.IDLE) { throw new IllegalArgumentException( "Cannot change state of non-idle timeline [" + this.toString() + "]"); } this.callback.removeCallback(callback); }
@Override public void setLcdValueAnimated(final double LCD_VALUE) { if (lcdTimeline.getState() == Timeline.TimelineState.PLAYING_FORWARD || lcdTimeline.getState() == Timeline.TimelineState.PLAYING_REVERSE) { lcdTimeline.abort(); } lcdTimeline = new Timeline(this); lcdTimeline.addPropertyToInterpolate("lcdValue", this.lcdValue, LCD_VALUE); lcdTimeline.setEase(new Spline(0.5f)); lcdTimeline.play(); }
@Override public void setValueAnimated(final double VALUE) { if (timeline.getState() == Timeline.TimelineState.PLAYING_FORWARD || timeline.getState() == Timeline.TimelineState.PLAYING_REVERSE) { timeline.abort(); } timeline = new Timeline(this); timeline.addPropertyToInterpolate("value", value, VALUE); timeline.setEase(new Spline(0.5f)); timeline.setDuration(800); timeline.play(); }