Package com.sencha.gxt.fx.client.animation

Examples of com.sencha.gxt.fx.client.animation.Animator


   */
  public static Animator createCommandsAnimator(final PathSprite origin, List<PathCommand> commands) {
    List<PathSprite> sourceDelta = PathSprite.findDelta(origin, commands);
    final PathSprite source = sourceDelta.get(0);
    final PathSprite delta = sourceDelta.get(1);
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        PathSprite start = new PathSprite(source);
        for (int i = 0; i < start.size(); i++) {
          if (start.getCommand(i) instanceof MoveTo) {
View Full Code Here


   * @return the animator
   */
  public static Animator createDegreesAnimator(final Sprite sprite, double degrees) {
    final Rotation rot = sprite.getRotation();
    final double deltaDegrees = degrees - rot.getDegrees();
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        sprite.setRotation(rot.getDegrees() + (deltaDegrees * progress));
        sprite.redraw();
      }
View Full Code Here

      origin = 1;
    } else {
      origin = sprite.getOpacity();
    }
    final double delta = opacity - origin;
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        sprite.setOpacity(origin + (delta * progress));
        sprite.redraw();
      }
View Full Code Here

  public static Animator createRectangleAnimator(final RectangleSprite sprite, PreciseRectangle rectangle) {
    final PreciseRectangle origin = new PreciseRectangle(sprite.getX(), sprite.getY(), sprite.getWidth(),
        sprite.getHeight());
    final PreciseRectangle delta = new PreciseRectangle(rectangle.getX() - sprite.getX(), rectangle.getY()
        - sprite.getY(), rectangle.getWidth() - sprite.getWidth(), rectangle.getHeight() - sprite.getHeight());
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        sprite.setX(origin.getX() + delta.getX() * progress);
        sprite.setY(origin.getY() + delta.getY() * progress);
        sprite.setWidth(origin.getWidth() + delta.getWidth() * progress);
 
View Full Code Here

  public static Animator createRotationAnimator(final Sprite sprite, double x, double y, double degrees) {
    final Rotation rot = sprite.getRotation();
    final double deltaX = x - rot.getX();
    final double deltaY = y - rot.getY();
    final double deltaDegrees = degrees - rot.getDegrees();
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        sprite.setRotation(new Rotation(rot.getX() + (deltaX * progress), rot.getY() + (deltaY * progress),
            rot.getDegrees() + (deltaDegrees * progress)));
        sprite.redraw();
View Full Code Here

      sprite.setScaling(1);
    }
    final Scaling origin = sprite.getScaling();
    final Scaling delta = new Scaling(scaling.getX() - origin.getX(), scaling.getY() - origin.getY(),
        scaling.getCenterX() - origin.getCenterX(), scaling.getCenterY() - origin.getCenterY());
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        sprite.setScaling(new Scaling(origin.getX() + (delta.getX() * progress), origin.getY()
            + (delta.getY() * progress), origin.getCenterX() + (delta.getCenterX() * progress), origin.getCenterY()
            + (delta.getCenterY() * progress)));
 
View Full Code Here

      origin = 0;
    } else {
      origin = sprite.getStrokeWidth();
    }
    final double deltaWidth = strokeWidth - origin;
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        sprite.setStrokeWidth(origin + (deltaWidth * progress));
        sprite.redraw();
      }
View Full Code Here

   */
  public static Animator createTranslationAnimator(final Sprite sprite, double x, double y) {
    final Translation trans = sprite.getTranslation();
    final double deltaX = x - trans.getX();
    final double deltaY = y - trans.getY();
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        sprite.setTranslation(trans.getX() + (deltaX * progress), trans.getY() + (deltaY * progress));
        sprite.redraw();
      }
View Full Code Here

        - end.getEndAngle(), start.getRho() - end.getRho());
    delta.setMargin(start.getMargin() - end.getMargin());
    delta.setStartRho(start.getStartRho() - end.getStartRho());
    delta.setEndRho(start.getEndRho() - end.getEndRho());
    final Slice origin = new Slice(start);
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        origin.setStartAngle(start.getStartAngle() - (delta.getStartAngle() * progress));
        origin.setEndAngle(start.getEndAngle() - (delta.getEndAngle() * progress));
        origin.setRho(start.getRho() - (delta.getRho() * progress));
 
View Full Code Here

        - end.getEndAngle(), start.getRho() - end.getRho());
    delta.setMargin(start.getMargin() - end.getMargin());
    delta.setStartRho(start.getStartRho() - end.getStartRho());
    delta.setEndRho(start.getEndRho() - end.getEndRho());
    final Slice origin = new Slice(start);
    return new Animator() {
      @Override
      protected void onUpdate(double progress) {
        origin.setStartAngle(start.getStartAngle() - (delta.getStartAngle() * progress));
        origin.setEndAngle(start.getEndAngle() - (delta.getEndAngle() * progress));
        origin.setRho(start.getRho() - (delta.getRho() * progress));
 
View Full Code Here

TOP

Related Classes of com.sencha.gxt.fx.client.animation.Animator

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.