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

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


    private final AnimationCallback getAnimationCallback()
    {
        if (null == m_animate)
        {
            m_animate = new AnimationCallback()
            {
                @Override
                public void execute(double time)
                {
                    doFrame();
View Full Code Here


        return s_instance;
    }

    private LayerRedrawManager()
    {
        m_redraw = new AnimationCallback()
        {
            @Override
            public void execute(double time)
            {
                final FastArrayList<Layer> list = m_layers;
View Full Code Here

                @Override
                public void onCanPlayThrough(CanPlayThroughEvent event)
                {
                    play();

                    AnimationScheduler.get().requestAnimationFrame(new AnimationCallback()
                    {
                        @Override
                        public void execute(double timestamp)
                        {
                            if (false == m_pause)
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

      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

        m_begtime = System.currentTimeMillis();

        final CanvasElement element = getCanvasElement();

        final AnimationCallback animate = new AnimationCallback()
        {
            @Override
            public void execute(double time)
            {
                doFrame();
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.