Package org.jdesktop.animation.timing

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


        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

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

        // calculate X and Y positions
        positionX = (int) ((screenWidth / 2) - (frame.getWidth() / 2));
        positionY = (int) ((screenHeight - frame.getHeight()) - DISTANCE);

        // set the first animator handler
        animatorHandlerOnShow = new Animator(ANIMATIONSPEED, 1, Animator.RepeatBehavior.LOOP, this);
        animatorHandlerOnShow.start();
    }
View Full Code Here

        // the current frame
        if (animationFrame == AnimationFrame.ONSHOW) {
            animationFrame = AnimationFrame.ONDISPLAY;

            // create a new animator
            animatorHandlerOnDisplay = new Animator(DURATION, 1, Animator.RepeatBehavior.LOOP, this);

            // start this new animator
            animatorHandlerOnDisplay.start();

            // start the panel timer for the animated logo
            frame.panel.animationTimer.start();
        } else {

            // if the animation finished the second part,
            // change the current frame
            if (animationFrame == AnimationFrame.ONDISPLAY) {
                animationFrame = AnimationFrame.ONCLOSE;

                // create a new animator
                animatorHandlerOnClose = new Animator(ANIMATIONSPEED, 1, Animator.RepeatBehavior.LOOP, this);

                // start this new animator
                animatorHandlerOnClose.start();
            } else {
View Full Code Here

       
        public void setBackground(final Color col) {
            if (animator != null && animator.isRunning()) {
                animator.cancel();
            }
            animator = new Animator(150, new PropertySetter(AbstractGraphNodeUi2D.this, "background", col));
            animator.addTarget(new TimingTargetAdapter() {
               
                @Override
                public void end() {
                    animator = null;
View Full Code Here

        }
        animateTransition(visible);
    }
   
    private void animateTransition(boolean visible) {
        Animator animator = createAnimator();
        if (visible) {
            animator.addTarget(new TimingTargetAdapter() {

                @Override
                public void timingEvent(float fraction) {
                    currentAlpha = (int) (alpha * fraction);
                    repaint();
                }

                @Override
                public void end() {
                    currentAlpha = alpha;
                }
            });
        } else {
            final int alphaStart = currentAlpha;
            animator.addTarget(new TimingTargetAdapter() {

                @Override
                public void timingEvent(float fraction) {
                    int diff = (int) (fraction * alphaStart);
                    currentAlpha = alphaStart - diff;
                    repaint();
                }

                @Override
                public void end() {
                    currentAlpha = -1;
                }
            });
        }
        animator.start();
    }
View Full Code Here

        }
        animator.start();
    }

    protected Animator createAnimator() {
        Animator animator = new Animator(150);
        animator.setResolution(25);
        animator.setAcceleration(0.3f);
        animator.setDeceleration(0.2f);
        return animator;
    }
View Full Code Here

            this(panel, 3000);
        }
       
        public AnimatorImpl(KongaPanel panel, int duration) {
            this.panel = panel;
            worker = new Animator(duration, this);
            worker.setAcceleration(0.3f);
            worker.setDeceleration(0.2f);
            max = 1.f;
        }
View Full Code Here

        this.overlay = overlay;
        this.endPoint = endPoint;
    }

    public void start() {
        Animator anim = new Animator(150, new Worker());
        anim.setAcceleration(0.2f);
        anim.setDeceleration(0.3f);
        anim.start();
    }
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.