Package com.alee.utils.swing

Examples of com.alee.utils.swing.WebTimer


    public WebFadeDialog ()
    {
        super ();

        updater = new WebTimer ( "WebFadeDialog.updater", StyleConstants.fastAnimationDelay, this );
        addWindowFocusListener ( this );
        addWindowListener ( this );
    }
View Full Code Here


                stopAnimator ();
                if ( painter == null &&
                        animate && ( rolloverShine || rolloverDecoratedOnly || rolloverShadeOnly ) )
                {
                    animator = new WebTimer ( "WebButtonUI.fadeInTimer", StyleConstants.fastAnimationDelay, new ActionListener ()
                    {
                        @Override
                        public void actionPerformed ( final ActionEvent e )
                        {
                            transparency += 0.075f;
                            if ( transparency >= 1f )
                            {
                                transparency = 1f;
                                animator.stop ();
                            }
                            updateTransparentShineColor ();
                            if ( c.isEnabled () )
                            {
                                c.repaint ();
                            }
                        }
                    } );
                    animator.start ();
                }
                else
                {
                    transparency = 1f;
                    updateTransparentShineColor ();
                    c.repaint ();
                }

                refresh ( c );
            }

            @Override
            public void mouseExited ( final MouseEvent e )
            {
                mousePoint = e.getPoint ();

                stopAnimator ();
                if ( painter == null &&
                        animate && ( rolloverShine || rolloverDecoratedOnly || rolloverShadeOnly ) )
                {
                    animator = new WebTimer ( "WebButtonUI.fadeOutTimer", StyleConstants.fastAnimationDelay, new ActionListener ()
                    {
                        @Override
                        public void actionPerformed ( final ActionEvent e )
                        {
                            transparency -= 0.075f;
View Full Code Here

            if ( showLoad )
            {
                ProgressLayer.this.setVisible ( true );

                stopOpacityAnimator ();
                opacityAnimator = new WebTimer ( "WebProgressOverlay.opacityAnimator", StyleConstants.animationDelay, new ActionListener ()
                {
                    @Override
                    public void actionPerformed ( final ActionEvent e )
                    {
                        if ( opacity < 128 )
                        {
                            opacity += 8;
                        }
                        else
                        {
                            opacity = 128;
                            opacityAnimator.stop ();
                        }
                    }
                } );
                opacityAnimator.start ();

                stopAnimator ();
                animator = new WebTimer ( "WebProgressOverlay.animator", StyleConstants.avgAnimationDelay, new ActionListener ()
                {
                    @Override
                    public void actionPerformed ( final ActionEvent e )
                    {
                        if ( loadProgress < getProgressWidth () * 2 )
                        {
                            loadProgress += speed;
                        }
                        else
                        {
                            loadProgress = 0;
                        }
                        if ( ProgressLayer.this.isVisible () )
                        {
                            ProgressLayer.this.repaint ();
                        }
                    }
                } );
                animator.start ();
            }
            else
            {
                stopOpacityAnimator ();
                opacityAnimator =
                        new WebTimer ( "WebProgressOverlay.opacityAnimator", StyleConstants.avgAnimationDelay, new ActionListener ()
                        {
                            @Override
                            public void actionPerformed ( final ActionEvent e )
                            {
                                if ( opacity > 0 )
View Full Code Here

        };
        slider.addChangeListener ( changeListener );

        // todo Requires optimizations
        // Rollover animator
        rolloverTimer = new WebTimer ( "WebProgressBarUI.animator", 40, new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                if ( rollover && rolloverDarkness < MAX_DARKNESS )
View Full Code Here

            actualTransitionEffect = transitionEffects.get ( MathUtils.random ( transitionEffects.size () ) );
        }

        // Starting new transition
        final long animationDelay = actualTransitionEffect != null ? actualTransitionEffect.getAnimationDelay () : 0;
        animator = new WebTimer ( "ImageTransition.animator", animationDelay, this );

        // Starting transition
        fireTransitionStarted ();
        animator.start ();
    }
View Full Code Here

        // Updating border and icon
        updateBorder ();
        updateIcon ( radioButton );

        // Background fade animation
        bgTimer = new WebTimer ( "WebRadioButtonUI.bgUpdater", 40, new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                if ( rollover && bgDarkness < MAX_DARKNESS )
                {
                    bgDarkness++;
                    c.repaint ();
                }
                else if ( !rollover && bgDarkness > 0 )
                {
                    bgDarkness--;
                    c.repaint ();
                }
                else
                {
                    bgTimer.stop ();
                }
            }
        } );
        mouseAdapter = new MouseAdapter ()
        {
            @Override
            public void mouseEntered ( final MouseEvent e )
            {
                rollover = true;
                if ( isAnimated () )
                {
                    bgTimer.start ();
                }
                else
                {
                    bgDarkness = MAX_DARKNESS;
                    c.repaint ();
                }
            }

            @Override
            public void mouseExited ( final MouseEvent e )
            {
                rollover = false;
                if ( isAnimated () )
                {
                    bgTimer.start ();
                }
                else
                {
                    bgDarkness = 0;
                    c.repaint ();
                }
            }
        };
        radioButton.addMouseListener ( mouseAdapter );

        // Selection changes animation
        checkTimer = new WebTimer ( "WebRadioButtonUI.iconUpdater", 40, new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                if ( checking && checkIcon < CHECK_STATES.size () - 1 )
View Full Code Here

            if ( progressBar.isEnabled () )
            {
                if ( progressBar.isIndeterminate () )
                {
                    animationLocation = 0;
                    animator = new WebTimer ( "WebProgressBarUI.animator", StyleConstants.animationDelay, new ActionListener ()
                    {
                        @Override
                        public void actionPerformed ( final ActionEvent e )
                        {
                            if ( animationLocation < indeterminateStep * 2 - 1 )
                            {
                                animationLocation++;
                            }
                            else
                            {
                                animationLocation = 0;
                            }
                            SwingUtilities.invokeLater ( new Runnable ()
                            {
                                @Override
                                public void run ()
                                {
                                    progressBar.repaint ();
                                }
                            } );
                        }
                    } );
                    animator.setUseEventDispatchThread ( false );
                }
                else
                {
                    animationLocation = -determinateAnimationWidth;
                    animator = new WebTimer ( "WebProgressBarUI.animator", StyleConstants.animationDelay, new ActionListener ()
                    {
                        @Override
                        public void actionPerformed ( final ActionEvent e )
                        {
                            if ( animationLocation < getProgressWidth () )
View Full Code Here

    /**
     * Initializes switch animator.
     */
    private void createAnimator ()
    {
        animator = new WebTimer ( "WebSwitch.animator", StyleConstants.maxAnimationDelay, new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                // Updating gripper location
View Full Code Here

            // Restarting timer
            if ( randomizer != null )
            {
                randomizer.stop ();
            }
            randomizer = new WebTimer ( "BlocksTransitionEffect.randomizer", 50 );
            randomizer.addActionListener ( new ActionListener ()
            {
                @Override
                public void actionPerformed ( final ActionEvent e )
                {
View Full Code Here

     * Installs rollover listeners.
     */
    protected void installRolloverListeners ()
    {
        // Background fade animation
        bgTimer = new WebTimer ( "WebCheckBoxUI.bgUpdater", UPDATE_DELAY, new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                if ( rollover && bgDarkness < MAX_DARKNESS )
View Full Code Here

TOP

Related Classes of com.alee.utils.swing.WebTimer

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.