Package com.alee.laf.panel

Examples of com.alee.laf.panel.WebPanel


        else
        {
            setTitle ( title );
        }

        container = new WebPanel ( new BorderLayout ( 5, 5 ) );
        container.setMargin ( 10, 10, 10, 10 );
        container.setOpaque ( false );
        add ( container, BorderLayout.CENTER );

        // Creating label with single space to hold label height on pack
View Full Code Here


     * @param component tab content
     * @return tabbed pane separator
     */
    private Component createTabSeparator ( final Component component )
    {
        final WebPanel content = new WebPanel ();
        content.add ( new TabAreaSeparator (), BorderLayout.NORTH );
        content.add ( component, BorderLayout.CENTER );
        return content;
    }
View Full Code Here

     *
     * @return general tab content
     */
    private Component createGeneralTab ()
    {
        final WebPanel content = new WebPanel ( new VerticalFlowLayout ( 30, 30 ) );
        content.setMargin ( 60, 70, 60, 70 );
        content.setUndecorated ( false );
        content.setWebColoredBackground ( true );
        content.setPaintSides ( false, false, false, false );

        content.add ( createLibraryVersionPanel () );
        content.add ( new WebSeparator ( false, WebSeparator.HORIZONTAL ) );
        content.add ( createJavaVersionPanel () );
        content.add ( new WebSeparator ( false, WebSeparator.HORIZONTAL ) );
        content.add ( createOsVersionPanel () );

        return content;
    }
View Full Code Here

            // Retrieving additional data for used libraries
            final String librariesDataText = FileUtils.readToString ( structure.getEntryInputStream ( librariesDataFile ) );
            final Map<String, String> librariesData = parseUrls ( librariesDataText );

            // Parsing available libraries info
            final WebPanel librariesPanel = new WebPanel ( new VerticalFlowLayout ( 0, 5 ) );
            librariesPanel.setMargin ( 5 );
            for ( final JarEntry child : licensesFolder.getChilds () )
            {
                if ( child.getName ().endsWith ( ".txt" ) )
                {
                    final String data = librariesData.get ( child.getName () );
                    final int i = data.indexOf ( LIBRARY_DATA_SEPARATOR );
                    final String name = data.substring ( 0, i );
                    final String url = data.substring ( i + LIBRARY_DATA_SEPARATOR.length () );

                    final WebLabel nameLabel = new WebLabel ( name );
                    SwingUtils.setBoldFont ( nameLabel );

                    // Library license file
                    final WebLinkLabel fileLink = new WebLinkLabel ( child.getName () );
                    fileLink.setLink ( new Runnable ()
                    {
                        @Override
                        public void run ()
                        {
                            try
                            {
                                final String license = FileUtils.readToString ( structure.getEntryInputStream ( child ) );
                                final WebPopup licensePopup = new WebPopup ();
                                final WebTextArea textArea = new WebTextArea ( license );
                                textArea.setEditable ( false );
                                licensePopup.add ( new WebScrollPane ( textArea, false ) );
                                licensePopup.showPopupAsModal ( fileLink, true, true );
                                HotkeyManager.registerHotkey ( textArea, Hotkey.ESCAPE, new HotkeyRunnable ()
                                {
                                    @Override
                                    public void run ( final KeyEvent e )
                                    {
                                        licensePopup.hidePopup ();
                                    }
                                } );
                            }
                            catch ( final IOException e )
                            {
                                Log.error ( this, e );
                            }
                        }
                    } );
                    final WebLabel licenseLabel = new WebLabel ();
                    licenseLabel.setLanguage ( "weblaf.info.libraries.license" );
                    final GroupPanel fileLinkPanel = new GroupPanel ( 5, licenseLabel, fileLink );

                    // Library site URL
                    final WebLinkLabel urlLink = new WebLinkLabel ( url );
                    urlLink.setLink ( url, false );
                    final WebLabel siteLabel = new WebLabel ();
                    siteLabel.setLanguage ( "weblaf.info.libraries.site" );
                    final GroupPanel urlLinkPanel = new GroupPanel ( 5, siteLabel, urlLink );

                    // Single library panel
                    final GroupPanel libraryPanel = new GroupPanel ( false, nameLabel, fileLinkPanel, urlLinkPanel );
                    libraryPanel.setUndecorated ( false );
                    libraryPanel.setMargin ( 5 );
                    libraryPanel.setPreferredWidth ( 0 );
                    librariesPanel.add ( libraryPanel );
                }
            }

            // Libraries panel scroll
            final WebScrollPane scrollPane = new WebScrollPane ( librariesPanel, false );
View Full Code Here

        setRound ( StyleConstants.smallRound );
        setLayout ( new BorderLayout ( 0, 0 ) );
        putClientProperty ( SwingUtils.HANDLES_ENABLE_STATE, true );

        // Main layout
        final WebPanel centerPanel = new WebPanel ();
        centerPanel.setOpaque ( false );
        add ( centerPanel, BorderLayout.CENTER );

        // Header panel
        final WebPanel header = new WebPanel ();
        header.setOpaque ( false );
        add ( header, BorderLayout.NORTH );

        previousSkip = WebButton.createIconWebButton ( previousSkipIcon, StyleConstants.smallRound, true );
        previousSkip.setDrawFocus ( false );
        previousSkip.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                changeYear ( -1 );
            }
        } );

        previous = WebButton.createIconWebButton ( previousIcon, StyleConstants.smallRound, true );
        previous.setDrawFocus ( false );
        previous.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                changeMonth ( -1 );
            }
        } );

        final WebPanel leftHeader = new WebPanel ( new BorderLayout () );
        leftHeader.setOpaque ( false );
        leftHeader.add ( previousSkip, BorderLayout.WEST );
        leftHeader.add ( previous, BorderLayout.EAST );
        header.add ( leftHeader, BorderLayout.WEST );

        titlePanel = new ComponentTransition ( createTitleLabel () );
        titlePanel.setOpaque ( false );
        titlePanel.setTransitionEffect ( new FadeTransitionEffect () );
        titlePanel.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                if ( SwingUtilities.isLeftMouseButton ( e ) )
                {
                    setShownDate ( new Date () );
                }
            }
        } );
        header.add ( titlePanel, BorderLayout.CENTER );

        next = WebButton.createIconWebButton ( nextIcon, StyleConstants.smallRound, true );
        next.setDrawFocus ( false );
        next.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                changeMonth ( 1 );
            }
        } );

        nextSkip = WebButton.createIconWebButton ( nextSkipIcon, StyleConstants.smallRound, true );
        nextSkip.setDrawFocus ( false );
        nextSkip.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                changeYear ( 1 );
            }
        } );

        final WebPanel rightHeader = new WebPanel ( new BorderLayout () );
        rightHeader.setOpaque ( false );
        rightHeader.add ( next, BorderLayout.WEST );
        rightHeader.add ( nextSkip, BorderLayout.EAST );
        header.add ( rightHeader, BorderLayout.EAST );

        // Week days
        weekHeaders = new WebPanel ();
        weekHeaders.setUndecorated ( false );
        weekHeaders.setPaintSides ( true, false, true, false );
        weekHeaders.setShadeWidth ( 0 );
        weekHeaders.setOpaque ( false );
        weekHeaders.setMargin ( StyleConstants.shadeWidth, StyleConstants.shadeWidth - 1, StyleConstants.shadeWidth + 1,
View Full Code Here

     *
     * @return created month panel
     */
    protected WebPanel createMonthPanel ()
    {
        final WebPanel monthDays = new WebPanel ();
        monthDays.setOpaque ( false );
        monthDays.setMargin ( StyleConstants.shadeWidth - 1, StyleConstants.shadeWidth - 1, StyleConstants.shadeWidth - 1,
                StyleConstants.shadeWidth - 1 );
        final TableLayout layout = new TableLayout ( new double[][]{
                { TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED,
                        TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL,
                        TableLayout.PREFERRED, TableLayout.FILL },
                { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL } } );
        layout.setHGap ( 0 );
        layout.setVGap ( 0 );
        monthDays.setLayout ( layout );
        return monthDays;
    }
View Full Code Here

    protected void switchMonth ( final boolean animate )
    {
        if ( animate )
        {
            // Creating new dates panel
            final WebPanel newMonthDays = createMonthPanel ();
            updateMonth ( newMonthDays );

            // Setting collapse transition effects
            final boolean ltr = getComponentOrientation ().isLeftToRight ();
View Full Code Here

        //        painter.setShadeTransparency ( WebPopOverStyle.shadeTransparency );
        //        painter.setCornerWidth ( WebPopOverStyle.cornerWidth );
        //        painter.setTransparency ( WebPopOverStyle.transparency );
        //        painter.setPopupStyle ( PopupStyle.simple );

        container = new WebPanel ( /*painter*/ );
        container.setStyleId ( "pop-over" );
        setContentPane ( container );

        final ComponentMoveAdapter moveAdapter = new ComponentMoveAdapter ()
        {
View Full Code Here

     *
     * @return south panel content
     */
    protected Component createSouthContent ()
    {
        final WebPanel southPanel = new WebPanel ();
        southPanel.setLayout ( new ToolbarLayout ( 4 ) );
        southPanel.setOpaque ( false );
        southPanel.setMargin ( 0, 4, 4, 4 );
        add ( southPanel, BorderLayout.SOUTH );

        final WebLabel selectedFilesLabel = new WebLabel ();
        selectedFilesLabel.setLanguage ( "weblaf.filechooser.files.selected" );
        selectedFilesLabel.setDrawShade ( true );
        selectedFilesLabel.setMargin ( 0, 4, 0, 0 );
        southPanel.add ( selectedFilesLabel );

        selectedFilesViewField = new WebFileChooserField ( false );
        selectedFilesViewField.setShowRemoveButton ( false );
        selectedFilesViewField.setShowFileShortName ( true );
        selectedFilesViewField.setFilesDropEnabled ( false );

        selectedFilesTextField = new WebTextField ( 0, true );
        selectedFilesTextField.addCaretListener ( new CaretListener ()
        {
            @Override
            public void caretUpdate ( final CaretEvent e )
            {
                // No need to specify files, they will be calculated when needed
                updateApproveButtonState ( null );
            }
        } );
        selectedFilesTextField.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                // Try to approve selection
                approveButton.doClick ( 0 );
            }
        } );

        selectedFilesPanel = new WebPanel ( chooserType == FileChooserType.save ? selectedFilesTextField : selectedFilesViewField );
        southPanel.add ( selectedFilesPanel, ToolbarLayout.FILL );

        fileFilters = new WebComboBox ();
        fileFilters.setRenderer ( new DefaultFileFilterListCellRenderer () );
        fileFilters.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                setActiveFileFilter ( ( AbstractFileFilter ) fileFilters.getSelectedItem (), false );
            }
        } );

        approveButton = new WebButton ( "", APPROVE_ICON );
        //        approveButton.addHotkey ( WebFileChooserPanel.this, Hotkey.CTRL_ENTER ).setHotkeyDisplayWay ( TooltipWay.up );
        approveButton.setRolloverShine ( StyleConstants.highlightControlButtons );
        approveButton.setShineColor ( StyleConstants.greenHighlight );
        approveButton.putClientProperty ( GroupPanel.FILL_CELL, true );
        approveButton.setEnabled ( false );
        approveButton.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                fireApproveAction ( e );
            }
        } );

        cancelButton = new WebButton ( "", CANCEL_ICON );
        cancelButton.setLanguage ( "weblaf.filechooser.cancel" );
        //        cancelButton.addHotkey ( WebFileChooserPanel.this, Hotkey.ESCAPE ).setHotkeyDisplayWay ( TooltipWay.up );
        cancelButton.setRolloverShine ( StyleConstants.highlightControlButtons );
        cancelButton.setShineColor ( StyleConstants.redHighlight );
        cancelButton.putClientProperty ( GroupPanel.FILL_CELL, true );
        cancelButton.addActionListener ( new ActionListener ()
        {
            @Override
            public void actionPerformed ( final ActionEvent e )
            {
                fireCancelAction ( e );
            }
        } );

        controlsPanel = new WebPanel ();
        updateControls ();
        southPanel.add ( controlsPanel, ToolbarLayout.END );

        // For proper equal sizing of control buttons
        SwingUtils.equalizeComponentsSize ( approveButton, cancelButton );
        final PropertyChangeListener pcl = new PropertyChangeListener ()
        {
            @Override
            public void propertyChange ( final PropertyChangeEvent e )
            {
                approveButton.setPreferredSize ( null );
                cancelButton.setPreferredSize ( null );
                SwingUtils.equalizeComponentsSize ( approveButton, cancelButton );
                southPanel.revalidate ();
            }
        };
        approveButton.addPropertyChangeListener ( AbstractButton.TEXT_CHANGED_PROPERTY, pcl );
        cancelButton.addPropertyChangeListener ( AbstractButton.TEXT_CHANGED_PROPERTY, pcl );

View Full Code Here

        if ( files.isEmpty () )
        {
            return;
        }

        final WebPanel all = new WebPanel ( new BorderLayout ( 0, 5 ) );
        all.add ( new WebLabel ( LanguageManager.get ( "weblaf.filechooser.delete.confirm.text" ) ), BorderLayout.NORTH );

        final WebPanel deleteFilesPanel = new WebPanel ( new VerticalFlowLayout ( VerticalFlowLayout.TOP, 0, 5, true, false ) );
        deleteFilesPanel.setMargin ( 3 );
        deleteFilesPanel.setBackground ( Color.WHITE );
        for ( final File file : files )
        {
            deleteFilesPanel.add ( new WebLabel ( file.getName (), FileUtils.getFileIcon ( file ), WebLabel.LEFT ) );
        }
        final WebScrollPane scroll = new WebScrollPane ( deleteFilesPanel )
        {
            @Override
            public Dimension getPreferredSize ()
View Full Code Here

TOP

Related Classes of com.alee.laf.panel.WebPanel

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.