Examples of CenterPanel


Examples of com.alee.extended.panel.CenterPanel

        final WebProgressBar overlay = new WebProgressBar ();
        overlay.setPreferredProgressWidth ( 100 );
        overlay.setStringPainted ( true );

        // Additional centering panel that soaks mouse events to prevent textarea interactions
        final CenterPanel centeredOverlay = new CenterPanel ( overlay );
        centeredOverlay.setVisible ( false );
        EmptyMouseAdapter.install ( centeredOverlay );
        overlayPanel.addOverlay ( centeredOverlay );

        // Overlayed text area
        final WebTextArea component = new WebTextArea ();
        component.setColumns ( 20 );
        component.setRows ( 3 );
        component.setLineWrap ( true );
        component.setWrapStyleWord ( true );
        component.addMouseListener ( new MouseAdapter ()
        {
            private String toAdd = "";
            private int step = 5;

            @Override
            public void mousePressed ( MouseEvent e )
            {
                // Block action on disabled state
                if ( !component.isEnabled () )
                {
                    return;
                }

                // Updating string to write
                if ( toAdd.length () == 0 )
                {
                    toAdd = ExamplesManager.createSmallString ();
                }

                // Disabling textarea editing
                component.setEditable ( false );
                component.setSelectionStart ( component.getText ().length () );
                component.setSelectionEnd ( component.getText ().length () );
                component.setCaretPosition ( component.getText ().length () );

                // Initializing progress
                overlay.setMinimum ( 0 );
                overlay.setValue ( 0 );
                overlay.setMaximum ( toAdd.length () );

                // Displaying overlay
                centeredOverlay.setVisible ( true );

                // Starting update thread
                new Thread ( new Runnable ()
                {
                    @Override
                    public void run ()
                    {
                        while ( toAdd.length () > 0 )
                        {
                            final int left = Math.min ( step, toAdd.length () );
                            SwingUtils.invokeAndWaitSafely ( new Runnable ()
                            {
                                @Override
                                public void run ()
                                {
                                    component.append ( toAdd.substring ( 0, left ) );
                                    overlay.setValue ( overlay.getValue () + left );
                                }
                            } );
                            toAdd = toAdd.substring ( left );
                            ThreadUtils.sleepSafely ( 50 );
                        }
                        SwingUtilities.invokeLater ( new Runnable ()
                        {
                            @Override
                            public void run ()
                            {
                                // Hiding overlay
                                centeredOverlay.setVisible ( false );

                                // Enabling textarea editing
                                component.setEditable ( false );
                            }
                        } );
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

                    }
                } );
            }
        }

        return new GroupPanel ( 10, imagesPanel, new CenterPanel ( reloadView ) );
    }
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

            {
                switchView.setEnabled ( true );
            }
        } );

        return new GroupPanel ( 10, componentTransition, new CenterPanel ( switchView ) );
    }
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

                    public void actionPerformed ( final ActionEvent e )
                    {
                        notificationPopup.hidePopup ();
                    }
                } );
                final CenterPanel centerPanel = new CenterPanel ( button, false, true );
                notificationPopup.setContent ( new GroupPanel ( 2, label, centerPanel ) );

                NotificationManager.showNotification ( notificationPopup );
            }
        } );
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

            {
                switchView.setEnabled ( true );
            }
        } );

        return new GroupPanel ( 10, componentTransition, new CenterPanel ( switchView ) );
    }
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

                    setVisible ( false );
                }
            };
            login.addActionListener ( listener );
            cancel.addActionListener ( listener );
            content.add ( new CenterPanel ( new GroupPanel ( 5, login, cancel ) ), "0,2,1,2" );
            SwingUtils.equalizeComponentsWidths ( login, cancel );

            add ( content );

            HotkeyManager.registerHotkey ( this, login, Hotkey.ESCAPE );
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

                    }
                } );
            }
        }

        return new GroupPanel ( 10, imagesPanel, new CenterPanel ( buttonGroup ) );
    }
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

            {
                switchView.setEnabled ( true );
            }
        } );

        return new GroupPanel ( 10, componentTransition, new CenterPanel ( switchView ) );
    }
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

            public void mousePressed ( final MouseEvent e )
            {
                owner.showLegend ( featureState, fs );
            }
        } );
        return new CenterPanel ( featureState, true, true );
    }
View Full Code Here

Examples of com.alee.extended.panel.CenterPanel

            {
                owner.showSource ( classType );
            }
        } );

        return new CenterPanel ( sourceButton, false, true );
    }
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.