Examples of WebProgressDialog


Examples of com.alee.extended.window.WebProgressDialog

        {
            @Override
            public void actionPerformed ( ActionEvent e )
            {
                // Load dialog
                final WebProgressDialog progress = new WebProgressDialog ( owner, "Some progress" );
                progress.setText ( "Loading something..." );

                // Starting updater thread
                new Thread ( new Runnable ()
                {
                    @Override
                    public void run ()
                    {
                        for ( int i = 0; i <= 100; i++ )
                        {
                            ThreadUtils.sleepSafely ( 50 );
                            progress.setProgress ( i );
                            if ( i == 25 )
                            {
                                progress.setText ( "1/4 done" );
                            }
                            else if ( i == 50 )
                            {
                                progress.setText ( "Half done" );
                            }
                            else if ( i == 75 )
                            {
                                progress.setText ( "3/4 done" );
                            }
                        }
                        progress.setText ( "Done! Closing in 3..." );
                        ThreadUtils.sleepSafely ( 1000 );
                        progress.setText ( "Done! Closing in 2..." );
                        ThreadUtils.sleepSafely ( 1000 );
                        progress.setText ( "Done! Closing in 1..." );
                        ThreadUtils.sleepSafely ( 1000 );
                        progress.setVisible ( false );
                    }
                } ).start ();

                // Displaying dialog
                progress.setModal ( true );
                progress.setVisible ( true );
            }
        } );
        return new GroupPanel ( showModalLoad );
    }
View Full Code Here

Examples of com.alee.extended.window.WebProgressDialog

        // Base content pane
        final WebPanel contentPane = new WebPanel ();

        // Exampler loading dialog
        final WebProgressDialog progress = createProgressDialog ();
        progress.addWindowListener ( new WindowAdapter ()
        {
            @Override
            public void windowClosed ( final WindowEvent e )
            {
                // Stop loading demo on dialog close
                System.exit ( 0 );
            }
        } );
        progress.setVisible ( true );

        // Loading default demo dialog settings
        progress.setText ( "Configuring demo..." );
        setTitle ( getDemoTitle () );
        setIconImages ( WebLookAndFeel.getImages () );
        setLayout ( new BorderLayout () );
        HotkeyManager.installShowAllHotkeysAction ( getRootPane (), Hotkey.F1 );

        // Creating main content
        exampleTabs = ExamplesManager.createExampleTabs ( WebLookAndFeelDemo.this, progress );

        // Jar class structure creation
        sourceViewer = new SourceViewer ( ExamplesManager.createJarStructure ( progress ) );

        // Content
        containerTransition = new ComponentTransition ( exampleTabs );
        containerTransition.setTransitionEffect ( new FadeTransitionEffect () );
        containerTransition.addTransitionListener ( new TransitionAdapter ()
        {
            @Override
            public void transitionFinished ()
            {
                // To show back tooltip once
                if ( !isSourceTipShownOnce () && containerTransition.getContent () == sourceViewer )
                {
                    // Marking the fact we already seen this tip
                    setSourceTipShownOnce ();

                    // Showing helpful tip
                    TooltipManager.showOneTimeTooltip ( locationBreadcrumb.getComponent ( 0 ), null, infoIcon,
                            "You can go back to demos at anytime " + "using this breadcrumb", TooltipWay.up );
                }
            }
        } );

        contentPane.add ( containerTransition, BorderLayout.CENTER );

        // Status bar
        contentPane.add ( createStatusBar (), BorderLayout.SOUTH );
        exampleTabs.setSelectedIndex ( 0 );

        // Base content
        appearanceTransition = new ComponentTransition ( createBackgroundPanel () )
        {
            @Override
            public Dimension getPreferredSize ()
            {
                return contentPane.getPreferredSize ();
            }
        };
        final CurtainTransitionEffect effect = new CurtainTransitionEffect ();
        effect.setDirection ( Direction.down );
        effect.setType ( CurtainType.fade );
        appearanceTransition.setTransitionEffect ( effect );
        appearanceTransition.addAncestorListener ( new AncestorAdapter ()
        {
            @Override
            public void ancestorAdded ( final AncestorEvent event )
            {
                appearanceTransition.delayTransition ( 1000, contentPane );
            }
        } );
        appearanceTransition.addTransitionListener ( new TransitionAdapter ()
        {
            @Override
            public void transitionFinished ()
            {
                // Search tip
                if ( !isSearchTipShownOnce () )
                {
                    setSearchTipShownOnce ();

                    final JRootPane rootPane = WebLookAndFeelDemo.this.getRootPane ();
                    final WebCustomTooltip searchTip = TooltipManager
                            .showOneTimeTooltip ( rootPane, new Point ( rootPane.getWidth () / 2, 0 ), SlidingSearch.searchIcon,
                                    "You can quickly navigate through components using search (Ctrl+F)", TooltipWay.down );

                    final HotkeyInfo searchTipHide = HotkeyManager.registerHotkey ( Hotkey.CTRL_F, new HotkeyRunnable ()
                    {
                        @Override
                        public void run ( final KeyEvent e )
                        {
                            searchTip.closeTooltip ();
                        }
                    } );
                    searchTip.addTooltipListener ( new TooltipAdapter ()
                    {
                        @Override
                        public void tooltipDestroyed ()
                        {
                            HotkeyManager.unregisterHotkey ( searchTipHide );
                        }
                    } );
                }
            }
        } );
        add ( appearanceTransition, BorderLayout.CENTER );

        // Search
        installSearch ();

        // Finishing load text
        progress.setText ( "Starting demo..." );

        // Creating a small delay to not blink with windows too fast
        ThreadUtils.sleepSafely ( 500 );

        // Configuring demo window
        pack ();
        setLocationRelativeTo ( null );
        setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );

        // Displaying demo
        progress.setVisible ( false );
    }
View Full Code Here

Examples of com.alee.extended.window.WebProgressDialog

    }

    private WebProgressDialog createProgressDialog ()
    {
        // Progress dialog
        final WebProgressDialog progress = new WebProgressDialog ( null, "Loading showcase..." );
        progress.setIconImages ( WebLookAndFeel.getImages () );
        progress.setShowProgressBar ( false );

        final IconProgress loadedIcons = new IconProgress ();

        final List<ExampleGroup> eg = ExamplesManager.getExampleGroups ();
        final Insets m = loadedIcons.getInsets ();
        final int w = m.left + eg.size () * 16 + ( eg.size () - 1 ) * 2 + m.right;
        final int h = m.top + 16 + m.bottom;
        loadedIcons.setPreferredSize ( new Dimension ( w, h ) );

        progress.setMiddleComponent ( loadedIcons );

        return progress;
    }
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.