Package org.jdesktop.animation.timing

Examples of org.jdesktop.animation.timing.Animator


            if (template != null) {
                if (controller != null && controller.isRunning()) {
                    controller.stop();
                }

                controller = new Animator(300,
                        new PropertySetter(display, "control1",
                        point2dInterpolator, display.getControl1(),
                        template.getControl1()));
                controller.setResolution(10);
                controller.addTarget(new PropertySetter(display, "control2",
View Full Code Here


   
    KeyTimes  keyTimes   = new KeyTimes(times);
      KeyValues keyValues = KeyValues.create(values);
    KeyFrames keyFrames = new KeyFrames(keyValues, keyTimes,  new SplineInterpolator(1.00f, 0.00f, 0.00f, 1.00f));
   
    animation = new Animator1000,
                  1
                  Animator.RepeatBehavior.LOOP,
                  new PropertySetter(this, "factor", keyFrames) );
   
    m_LastTimeStamp = animation.getTotalElapsedTime();
View Full Code Here

        LoadAnimationPanel loadAnimationPanel = new LoadAnimationPanel();

        add(loadAnimationPanel);
        loadAnimationPanel.setAnimating(true);

        Animator fadeOutAnimator = null;
        Animator fadeInAnimator = null;
        try {
            loadAnimationPanel.setAnimating(false);
            fadeOutAnimator = new Animator(400,
                    new FadeOut(DemoXPanel.this,
                            loadAnimationPanel, demoPanel));
            fadeOutAnimator.setAcceleration(.2f);
            fadeOutAnimator.setDeceleration(.3f);
            fadeInAnimator = new Animator(400,
                    new PropertySetter(DemoXPanel.this, "alpha", 0.3f, 1.0f));
            TimingTrigger.addTrigger(fadeOutAnimator, fadeInAnimator, TimingTriggerEvent.STOP);
            fadeOutAnimator.start();
        } catch (Exception ignore) {
            if (fadeOutAnimator != null) fadeOutAnimator.stop();
            if (fadeInAnimator != null) fadeInAnimator.stop();
            if (loadAnimationPanel != null)
               loadAnimationPanel.setAnimating(false);
           
            System.err.println(ignore);
            ignore.printStackTrace();
View Full Code Here

            // remind(aim): get from resource map
            message = "demo loading";

            PropertySetter rotator = new PropertySetter(this, "triState", 0, 3);
            animator = new Animator(500, Animator.INFINITE,
                    Animator.RepeatBehavior.LOOP, rotator);
            // Don't animate gears if loading is quick
            animator.setStartDelay(200);
        }
View Full Code Here

     * cannot be found for propertyName.
     */
    public static Animator createAnimator(int duration, Object object,
            String propertyName, KeyFrames keyFrames) {
        PropertySetter ps = new PropertySetter(object, propertyName, keyFrames);
        Animator animator = new Animator(duration, ps);
        return animator;
    }
View Full Code Here

     * cannot be found for propertyName.
     */
    public static <T> Animator createAnimator(int duration,
            Object object, String propertyName, T... params) {
        PropertySetter ps = new PropertySetter(object, propertyName, params);
        Animator animator = new Animator(duration, ps);
        return animator;
    }
View Full Code Here

    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

      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

  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

   
    // 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

TOP

Related Classes of org.jdesktop.animation.timing.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.