Package com.google.gwt.animation.client.AnimationScheduler

Examples of com.google.gwt.animation.client.AnimationScheduler.AnimationCallback


  }
  void setRedrawAlpha(float alpha){
    redrawColor=CssColor.make("hsla(0,100%,100%,"+alpha+")");
  }
  void start(){
    animationCallback=new AnimationCallback(){
     
      @Override
      public void execute(double timestamp) {
       
        now=timestamp;
View Full Code Here


      return;
    }

    final long startTime = System.currentTimeMillis();

    final AnimationCallback animationCallback = new AnimationCallback() {

      @Override
      public void execute(double now) {

        if (now >= startTime + step.getTime()) {
          ScrollPanelTouchImpl.this.pos(step.x, step.y);
          ScrollPanelTouchImpl.this.animating = false;
          fireEvent(new ScrollAnimationEndEvent());
          ScrollPanelTouchImpl.this.startAnimation();
          return;
        }

        now = (now - startTime) / step.getTime() - 1;
        double easeOut = Math.sqrt(1 - now * now);
        int newX = (int) Math.round((step.getX() - startX) * easeOut + startX);
        int newY = (int) Math.round((step.getY() - startY) * easeOut + startY);
        ScrollPanelTouchImpl.this.pos(newX, newY);
        fireEvent(new ScrollAnimationMoveEvent());
        if (ScrollPanelTouchImpl.this.animating)
          ScrollPanelTouchImpl.this.aniTime = AnimationScheduler.get().requestAnimationFrame(this);

      }
    };

    animationCallback.execute(startTime);

  }
View Full Code Here

     * Give the browser a chance to redraw before applying the next delta.
     * Otherwise, we'll end up locking the browser if the user moves the mouse
     * too quickly.
     */
    if (animationCallback == null) {
      animationCallback = new AnimationCallback() {
        @Override
        public void execute(double arg0) {
          if (this != animationCallback) {
            // The resize event was already ended.
            return;
View Full Code Here

   *
   * @param timestamp the time to pass to the callback
   */
  private void executeLastCallbackAt(double timestamp) {
    assertTrue(callbacks.size() > 0);
    AnimationCallback callback = callbacks.remove(callbacks.size() - 1);
    callback.execute(timestamp);
  }
View Full Code Here

    return "com.google.gwt.animation.Animation";
  }

  public void testCancel() {
    delayTestFinish(TEST_TIMEOUT);
    AnimationHandle handle = scheduler.requestAnimationFrame(new AnimationCallback() {
      @Override
      public void execute(double timestamp) {
        fail("The animation frame was cancelled and should not execute.");
      }
    }, null);
View Full Code Here

  public void testRequestAnimationFrame() {
    delayTestFinish(TEST_TIMEOUT);
    final double startTime = Duration.currentTimeMillis();
    DivElement element = Document.get().createDivElement();
    scheduler.requestAnimationFrame(new AnimationCallback() {
      @Override
      public void execute(double timestamp) {
        // Make sure timestamp is not a high-res timestamp (see issue 8570)
        assertTrue(timestamp >= startTime);
        finishTest();
View Full Code Here

  }

  public void testRequestAnimationFrameWithoutElement() {
    delayTestFinish(TEST_TIMEOUT);
    final double startTime = Duration.currentTimeMillis();
    scheduler.requestAnimationFrame(new AnimationCallback() {
      @Override
      public void execute(double timestamp) {
        // Make sure timestamp is not a high-res timestamp (see issue 8570)
        assertTrue(timestamp >= startTime);
        finishTest();
View Full Code Here

      }
    });
    RootPanel.get("rootPanel").add(welcomeDialog);
    welcomeDialog.nameBox.setFocus(true);

    animScheduler.requestAnimationFrame(new AnimationCallback() {
      @Override
      public void execute(double timestamp) {
        for (PerspectiveAnimator animator : animators.values()) {
          animator.nextFrame();
        }
View Full Code Here

      return;
    }

    final long startTime = System.currentTimeMillis();

    final AnimationCallback animationCallback = new AnimationCallback() {

      @Override
      public void execute(double now) {

        if (now >= startTime + step.getTime()) {
          ScrollPanelTouchImpl.this.pos(step.x, step.y);
          ScrollPanelTouchImpl.this.animating = false;
          if (issueEvent) {
            fireEvent(new ScrollAnimationEndEvent());
          }
          ScrollPanelTouchImpl.this.startAnimation(issueEvent);
          return;
        }

        now = (now - startTime) / step.getTime() - 1;
        double easeOut = Math.sqrt(1 - now * now);
        int newX = (int) Math.round((step.getX() - startX) * easeOut + startX);
        int newY = (int) Math.round((step.getY() - startY) * easeOut + startY);
        ScrollPanelTouchImpl.this.pos(newX, newY);
        fireEvent(new ScrollAnimationMoveEvent());
        if (ScrollPanelTouchImpl.this.animating)
          ScrollPanelTouchImpl.this.aniTime = AnimationScheduler.get().requestAnimationFrame(this);

      }
    };

    animationCallback.execute(startTime);

  }
View Full Code Here

      }
    });
    RootPanel.get("rootPanel").add(welcomeDialog);
    welcomeDialog.nameBox.setFocus(true);

    animScheduler.requestAnimationFrame(new AnimationCallback() {
      @Override
      public void execute(double timestamp) {
        for (PerspectiveAnimator animator : animators.values()) {
          animator.nextFrame();
        }
View Full Code Here

TOP

Related Classes of com.google.gwt.animation.client.AnimationScheduler.AnimationCallback

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.