Package org.mt4j.util.animation

Examples of org.mt4j.util.animation.Animation


    this.closeKeyboard();
  }
 
  protected void closeKeyboard(){
    float width = this.getWidthXY(TransformSpace.RELATIVE_TO_PARENT);
    Animation keybCloseAnim = new Animation("Keyboard Fade", new MultiPurposeInterpolator(width, 1, 300, 0.2f, 0.5f, 1), this);
    keybCloseAnim.addAnimationListener(new IAnimationListener(){
      public void processAnimationEvent(AnimationEvent ae) {
//        float delta = ae.getAnimation().getInterpolator().getCurrentStepDelta();
        switch (ae.getId()) {
        case AnimationEvent.ANIMATION_STARTED:
        case AnimationEvent.ANIMATION_UPDATED:
          float currentVal = ae.getAnimation().getInterpolator().getCurrentValue();
//          keyboard.setWidthXYRelativeToParent(currentVal);
          setWidthRelativeToParent(currentVal);
          break;
        case AnimationEvent.ANIMATION_ENDED:
          setVisible(false);
          destroy();
          break
        default:
          break;
        }//switch
      }//processanimation
    });
    keybCloseAnim.start();
  }
View Full Code Here


  /**
   * Stops and Closes the movieclip with an animation.
   */
  public void close(){
    float width = this.getWidthXY(TransformSpace.RELATIVE_TO_PARENT);
    Animation closeAnim = new Animation("Window Fade", new MultiPurposeInterpolator(width, 1, 350, 0.2f, 0.5f, 1), this);
    closeAnim.addAnimationListener(new IAnimationListener(){
      public void processAnimationEvent(AnimationEvent ae) {
//        float delta = ae.getAnimation().getInterpolator().getCurrentStepDelta();
        switch (ae.getId()) {
        case AnimationEvent.ANIMATION_STARTED:
        case AnimationEvent.ANIMATION_UPDATED:
          float currentVal = ae.getAnimation().getInterpolator().getCurrentValue();
          setWidthXYRelativeToParent(currentVal);
          break;
        case AnimationEvent.ANIMATION_ENDED:
          setVisible(false);
          destroy();
          break
        default:
          break;
        }//switch
      }//processanimation
    });
    closeAnim.start();
  }
View Full Code Here

TOP

Related Classes of org.mt4j.util.animation.Animation

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.