Examples of Animator


Examples of org.jdesktop.animation.timing.Animator

    public static <T> Animator createAnimator(int duration,
            Object object, String propertyName,
            Evaluator evaluator, T... params) {
        PropertySetter ps = new PropertySetter(object, propertyName, evaluator,
                params);
        Animator animator = new Animator(duration, ps);
        return animator;
    }
View Full Code Here

Examples of org.jdesktop.animation.timing.Animator

      label.setSize(dim);
      label.setPreferredSize(dim);
      label.setMinimumSize(dim);
      label.setMaximumSize(dim);
      label.setVisible(false);
    Animator anim = PropertySetter.createAnimator(2500, label, "location",
            from, to);
    anim.addTarget(new TimingTarget(){
      @Override
      public void begin() {
        label.setVisible(true);
      }
     
      @Override
      public void end() {
        jPanel.remove(label);
            label.setVisible(false);

            jPanel.validate();
            jPanel.repaint();
      }
     
      @Override
      public void repeat() {
       
      }
     
      @Override
      public void timingEvent(float fraction) {
       
      }
    });
    anim.start();
  }
View Full Code Here

Examples of org.jdesktop.animation.timing.Animator

  public abstract Component getComponent();

  public final void cast(final Component component, Point from, Point to,
      final Container container, final boolean toEnemy) {
    Animator anim = PropertySetter.createAnimator(2000, component, "location",
        from, to);
    anim.addTarget(new TimingTarget() {

      @Override
      public void timingEvent(float fraction) {
        // not needed
      }

      @Override
      public void repeat() {
        // not needed
      }

      @Override
      public void end() {
        container.remove(component);
        component.setVisible(false);
        if(toEnemy)
          IHM.getInstance().updateEnemyPV(getDamage());
        else
          IHM.getInstance().updateHarryPV(getDamage());
        container.validate();
        container.repaint();
        Game.getInstance().casting = false;
      }

      @Override
      public void begin() {
        component.setVisible(true);
      }
    });
    anim.setDeceleration(0.25f);
    anim.start();
  }
View Full Code Here

Examples of org.jdesktop.animation.timing.Animator

   
    // create, configure and start an animator on the painter's
    // horizontal location
    @Action
    public void slideTextIn() {
        Animator animator = new Animator(800,
                new PropertySetter(textImagePainter, "x", getWidth(), 30));
        animator.setStartDelay(800);
        animator.setAcceleration(.2f);
        animator.setDeceleration(.5f);
        animator.start();
        // </snip>
    }
View Full Code Here

Examples of org.jdesktop.animation.timing.Animator

        animator.start();
        // </snip>
    }
   
    public void slideTextOut() {
        Animator animator = new Animator(600,
                new PropertySetter(textImagePainter, "x", textImagePainter.getX(), -getWidth()));
        animator.setStartDelay(10);
        animator.setAcceleration(.5f);
        animator.setDeceleration(.2f);
        animator.start();       
    }
View Full Code Here

Examples of org.jdesktop.animation.timing.Animator

        add(messageLayer, JLayeredPane.POPUP_LAYER);
        revalidate();
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Animator animator = new Animator(2000,
                        new PropertySetter(messageAlpha, "alpha", 0.0f, finalAlpha));
                animator.setStartDelay(200);
                animator.setAcceleration(.2f);
                animator.setDeceleration(.5f);
                animator.start();
            }
        });
    }
View Full Code Here

Examples of org.jdesktop.animation.timing.Animator

    /**
     * Fades out and removes the current message component
     */
    public void hideMessageLayer() {
        if (messageLayer != null && messageLayer.isShowing()) {
            Animator animator = new Animator(500,
                    new PropertySetter(messageAlpha, "alpha", messageAlpha.getAlpha(), 0.0f) {
                        public void end() {
                            remove(messageLayer);
                            revalidate();
                        }
                    });
            animator.setStartDelay(300);
            animator.setAcceleration(.2f);
            animator.setDeceleration(.5f);
            animator.start();
        }
    }
View Full Code Here

Examples of org.jdesktop.core.animation.timing.Animator

        controller.setBackground(to);
        repaint(controller);
      }
    };
   
    Animator animator = new Animator.Builder().addTarget(tt).setDuration(100, TimeUnit.MILLISECONDS).build();
    controller.setAnimator(animator);
    animator.start();
  }
View Full Code Here

Examples of org.jdesktop.core.animation.timing.Animator

        controller.setOffsetAnimator(null);
      }
    };
   
    Interpolator interpol = new AccelerationInterpolator(0.0, 0.1);
    Animator animator = new Animator.Builder().addTarget(timingTarget).setInterpolator(interpol).setDuration(250, TimeUnit.MILLISECONDS).build();
    controller.setOffsetAnimator(animator);
    animator.start();
    System.out.println("Started: " + System.currentTimeMillis());
  }
View Full Code Here

Examples of org.jdesktop.core.animation.timing.Animator

        controller.setBackgroundAnimator(null);
      }
    };
   
    Interpolator interpol = new AccelerationInterpolator(0.0, 0.1);
    Animator animator = new Animator.Builder().addTarget(timingTarget).setInterpolator(interpol).setDuration(100, TimeUnit.MILLISECONDS).build();
    controller.setBackgroundAnimator(animator);
    animator.start();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.