Package org.pushingpixels.trident.Timeline

Examples of org.pushingpixels.trident.Timeline.TimelineState


   *
   * @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));
  }
View Full Code Here


  public synchronized Timeline getPlayingTimeline(Comparable<T> id) {
    Timeline timeline = this.timelineMap.get(id);
    if (timeline == null)
      return null;
    TimelineState state = timeline.getState();
    if ((state == TimelineState.PLAYING_FORWARD)
        || (state == TimelineState.PLAYING_REVERSE)) {
      return timeline;
    }
    return null;
View Full Code Here

   *
   * @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));
  }
View Full Code Here

  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();
    }
View Full Code Here

    }
  }

  public boolean hasRunningTimelines() {
    if (this.focusTimeline != null) {
      TimelineState focusTimelineState = this.focusTimeline.getState();
      if (focusTimelineState != TimelineState.IDLE)
        return true;
    }
    if (this.focusLoopTimeline != null) {
      TimelineState focusLoopTimelineState = this.focusLoopTimeline
          .getState();
      if (focusLoopTimelineState != TimelineState.IDLE)
        return true;
    }
    if (this.iconGlowTracker.isPlaying()) {
      return true;
    }
    if (this.transitionTimeline != null) {
      TimelineState modelTransitionTimelineState = this.transitionTimeline
          .getState();
      if (modelTransitionTimelineState != TimelineState.IDLE)
        return true;
    }
View Full Code Here

            System.out.println("Ending " + timeline.id + " on "
                // + timeline.timelineKind.toString()
                + " in state " + timeline.getState().name()
                + " at position " + timeline.durationFraction);
          }
          TimelineState oldState = timeline.getState();
          timeline.replaceState(TimelineState.DONE);
          this.callbackCallTimelineStateChanged(timeline, oldState);
          timeline.popState();
          if (timeline.getState() != TimelineState.IDLE) {
            throw new IllegalStateException(
View Full Code Here

    }
  }

  private void callbackCallTimelineStateChanged(final Timeline timeline,
      final TimelineState oldState) {
    final TimelineState newState = timeline.getState();
    final float durationFraction = timeline.durationFraction;
    final float timelinePosition = timeline.timelinePosition;
    Runnable callbackRunnable = new Runnable() {
      public void run() {
        boolean shouldRunOnUIThread = false;
View Full Code Here

      // }

      // see if it's already tracked
      Timeline existing = this.getRunningTimeline(timeline);
      if (existing == null) {
        TimelineState oldState = timeline.getState();
        timeline.timeUntilPlay = timeline.initialDelay - msToSkip;
        if (timeline.timeUntilPlay < 0) {
          timeline.durationFraction = (float) -timeline.timeUntilPlay
              / (float) timeline.duration;
          timeline.timelinePosition = timeline.ease
              .map(timeline.durationFraction);
          timeline.timeUntilPlay = 0;
        } else {
          timeline.durationFraction = 0.0f;
          timeline.timelinePosition = 0.0f;
        }
        timeline.pushState(TimelineState.PLAYING_FORWARD);
        timeline.pushState(TimelineState.READY);
        this.addTimeline(timeline);

        this.callbackCallTimelineStateChanged(timeline, oldState);
      } else {
        TimelineState oldState = existing.getState();
        if (oldState == TimelineState.READY) {
          // the timeline remains READY, but after that it will be
          // PLAYING_FORWARD
          existing.popState();
          existing.replaceState(TimelineState.PLAYING_FORWARD);
View Full Code Here

      // }

      // see if it's already tracked
      Timeline existing = this.getRunningTimeline(timeline);
      if (existing == null) {
        TimelineState oldState = timeline.getState();
        timeline.timeUntilPlay = timeline.initialDelay - msToSkip;
        if (timeline.timeUntilPlay < 0) {
          timeline.durationFraction = 1.0f
              - (float) -timeline.timeUntilPlay
              / (float) timeline.duration;
          timeline.timelinePosition = timeline.ease
              .map(timeline.durationFraction);
          timeline.timeUntilPlay = 0;
        } else {
          timeline.durationFraction = 1.0f;
          timeline.timelinePosition = 1.0f;
        }
        timeline.pushState(TimelineState.PLAYING_REVERSE);
        timeline.pushState(TimelineState.READY);

        this.addTimeline(timeline);
        this.callbackCallTimelineStateChanged(timeline, oldState);
      } else {
        TimelineState oldState = existing.getState();
        if (oldState == TimelineState.READY) {
          // the timeline remains READY, but after that it will be
          // PLAYING_REVERSE
          existing.popState();
          existing.replaceState(TimelineState.PLAYING_REVERSE);
View Full Code Here

      // }

      // see if it's already tracked
      Timeline existing = this.getRunningTimeline(timeline);
      if (existing == null) {
        TimelineState oldState = timeline.getState();
        timeline.timeUntilPlay = timeline.initialDelay - msToSkip;
        if (timeline.timeUntilPlay < 0) {
          timeline.durationFraction = (float) -timeline.timeUntilPlay
              / (float) timeline.duration;
          timeline.timelinePosition = timeline.ease
View Full Code Here

TOP

Related Classes of org.pushingpixels.trident.Timeline.TimelineState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.