Package com.alee.utils.swing

Examples of com.alee.utils.swing.WebTimer


        setOpaque ( false );
        setFocusable ( true );

        figuresQueue.add ( new Figure () );

        keyTimer = new WebTimer ( "Tetris.keyTimer", 60, new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                if ( gameRunning )
                {
                    if ( action.equals ( Action.down ) )
                    {
                        performOneTick ();
                        repaint ();
                    }
                }
            }
        } );
        keyTimer.setInitialDelay ( 0 );

        pusher = new WebTimer ( "Tetris.gameTimer", getTickTime (), null )
        {
            @Override
            public WebTimer start ()
            {
                gameRunning = true;
View Full Code Here


            @Override
            public void caretUpdate ( final CaretEvent e )
            {
                if ( classSearchHintsDelay == null )
                {
                    classSearchHintsDelay = new WebTimer ( 500, new ActionListener ()
                    {
                        @Override
                        public void actionPerformed ( final ActionEvent e )
                        {
                            updateHints ();
View Full Code Here

                }
                else
                {
                    if ( rolloverAnimator == null )
                    {
                        rolloverAnimator = new WebTimer ( StyleConstants.avgAnimationDelay, new ActionListener ()
                        {
                            @Override
                            public void actionPerformed ( final ActionEvent e )
                            {
                                if ( rolloverState > 0f )
View Full Code Here

                // Launching scheduler if it is not yet launched
                if ( groupSaveScheduler == null || !groupSaveScheduler.isRunning () )
                {
                    if ( groupSaveScheduler == null )
                    {
                        groupSaveScheduler = new WebTimer ( "SettingsManager.groupSaveScheduler", saveOnChangeDelay, new ActionListener ()
                        {
                            @Override
                            public void actionPerformed ( final ActionEvent e )
                            {
                                synchronized ( saveOnChangeLock )
View Full Code Here

     * @param listener system file listener
     * @param delay    delay between checks for changes
     */
    public static WebTimer trackFile ( final File file, final SystemFileListener listener, final long delay )
    {
        final WebTimer tracker = new WebTimer ( "File tracker - " + file.getName (), delay, 0 );
        tracker.addActionListener ( new ActionListener ()
        {
            private Long lastModified = null;

            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                if ( file.exists () )
                {
                    final long lm = file.lastModified ();
                    if ( lastModified != lm )
                    {
                        listener.modified ( file );
                        lastModified = lm;
                    }
                }
                else
                {
                    listener.unbound ( file );
                    tracker.stop ();
                }
            }
        } );
        tracker.setUseDaemonThread ( true );
        return tracker;
    }
View Full Code Here

    {
        // Hiding standart tooltips
        for ( final Component component : CollectionUtils.copy ( webTooltips.keySet () ) )
        {
            // Stopping any timers
            final WebTimer timer = timers.get ( component );
            if ( timer != null )
            {
                timer.stop ();
            }

            // Closing tooltips
            final List<WebCustomTooltip> list = webTooltips.get ( component );
            if ( list != null && list.size () > 0 )
View Full Code Here

        // Creating listeners for component if they aren't created yet
        if ( !timers.containsKey ( component ) || !adapters.containsKey ( component ) )
        {
            // Tooltip pop timer
            final WebTimer showTips = new WebTimer ( "TooltipManager.displayTimer", delay );
            showTips.addActionListener ( new ActionListener ()
            {
                @Override
                public void actionPerformed ( final ActionEvent e )
                {
                    final Window wa = SwingUtils.getWindowAncestor ( component );
                    if ( wa != null && wa.isActive () )
                    {
                        showTooltips ( component, false );
                    }
                }
            } );
            showTips.setRepeats ( false );
            timers.put ( component, showTips );

            // Show/hide listener
            final MouseAdapter mouseAdapter = new MouseAdapter ()
            {
                @Override
                public void mouseEntered ( final MouseEvent e )
                {
                    // Component ancestor window
                    final Window window = SwingUtils.getWindowAncestor ( component );

                    // Starting show timer if needed
                    if ( window.isShowing () && window.isActive () )
                    {
                        showTips.start ();
                    }
                }

                @Override
                public void mouseExited ( final MouseEvent e )
                {
                    cancelTooltips ();
                }

                @Override
                public void mousePressed ( final MouseEvent e )
                {
                    cancelTooltips ();
                }

                @Override
                public void mouseReleased ( final MouseEvent e )
                {
                    cancelTooltips ();
                }

                private void cancelTooltips ()
                {
                    // Hiding component tooltips
                    showTips.stop ();
                    hideTooltips ( component );
                }
            };
            component.addMouseListener ( mouseAdapter );
            adapters.put ( component, mouseAdapter );
View Full Code Here

        // Components placement on tooltip
        setLayout ( new BorderLayout ( 6, 6 ) );
        add ( tooltip, BorderLayout.CENTER );

        // Fade in-out timer
        fadeTimer = new WebTimer ( "WebCustomTooltip.fade", 1000 / fadeFps );
        fadeTimer.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
View Full Code Here

        setStateIcons ();
        fireCollapsing ();

        if ( animate && isShowing () )
        {
            animator = new WebTimer ( "WebCollapsiblePane.collapseTimer", StyleConstants.fastAnimationDelay, new ActionListener ()
            {
                @Override
                public void actionPerformed ( final ActionEvent e )
                {
                    if ( transitionProgress > 0f )
View Full Code Here

        fireExpanding ();

        if ( animate && isShowing () )
        {
            animator = new WebTimer ( "WebCollapsiblePane.expandTimer", StyleConstants.fastAnimationDelay, new ActionListener ()
            {
                @Override
                public void actionPerformed ( final ActionEvent e )
                {
                    if ( transitionProgress < 1f )
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.