Package com.alee.laf.label

Examples of com.alee.laf.label.WebLabel


     * @param options notification selectable options
     * @return displayed notification
     */
    public static WebInnerNotification showInnerNotification ( final String content, final Icon icon, final NotificationOption... options )
    {
        return showInnerNotification ( SwingUtils.getAvailableWindow (), new WebLabel ( content ), icon, options );
    }
View Full Code Here


     * @return displayed notification
     */
    public static WebInnerNotification showInnerNotification ( final Component showFor, final String content,
                                                               final NotificationOption... options )
    {
        return showInnerNotification ( showFor, new WebLabel ( content ), NotificationIcon.information.getIcon (), options );
    }
View Full Code Here

     * @return displayed notification
     */
    public static WebInnerNotification showInnerNotification ( final Component showFor, final String content, final Icon icon,
                                                               final NotificationOption... options )
    {
        return showInnerNotification ( showFor, new WebLabel ( content ), icon, options );
    }
View Full Code Here

            // File name label
            final String actualFileName = FileUtils.getDisplayFileName ( file );
            final String displayFileName =
                    showFileExtensions || file.isDirectory () ? actualFileName : FileUtils.getFileNamePart ( actualFileName );
            final String absolutePath = file.getAbsolutePath ();
            final WebLabel fileName = new WebLabel ( showFileShortName ? displayFileName : absolutePath );
            fileName.setIcon ( showFileIcon ? FileUtils.getFileIcon ( file, false ) : null );
            fileName.setMargin ( 0, 0, 0, 2 );
            add ( fileName, BorderLayout.CENTER );

            addMouseListener ( new MouseAdapter ()
            {
                private boolean showShortName = showFileShortName;

                @Override
                public void mousePressed ( final MouseEvent e )
                {
                    FilePlate.this.requestFocusInWindow ();
                    if ( SwingUtilities.isRightMouseButton ( e ) )
                    {
                        if ( multiSelectionEnabled )
                        {
                            showShortName = !showShortName;
                            fileName.setText ( showShortName ? displayFileName : absolutePath );
                        }
                        else
                        {
                            setShowFileShortName ( !isShowFileShortName () );
                        }
View Full Code Here

        final WebBreadcrumb updateBreadcrumb = new WebBreadcrumb ( false );
        updateBreadcrumb.setEncloseLastElement ( false );

        final ImageIcon updateIcon = new ImageIcon ( StyleEditor.class.getResource ( "icons/editor/update.png" ) );
        final WebLabel delayLabel = new WebLabel ( "Skin update delay:", updateIcon );
        final WebTextField delayField = new WebTextField ( new IntTextDocument (), "" + updateDelay, 3 );
        delayField.setShadeWidth ( 0 );
        delayField.setHorizontalAlignment ( WebTextField.CENTER );
        delayField.getDocument ().addDocumentListener ( new IntDocumentChangeListener ()
        {
            @Override
            public void documentChanged ( final Integer newValue, final DocumentEvent e )
            {
                updateDelay = newValue != null ? newValue : updateDelay;
                if ( updateDelay < 0 )
                {
                    updateDelay = 0;
                }
            }
        } );
        final WebLabel msLabel = new WebLabel ( "ms" ).setMargin ( 4 );
        final WebBreadcrumbPanel panel = new WebBreadcrumbPanel ();
        panel.setLayout ( new HorizontalFlowLayout ( 4, false ) );
        panel.add ( delayLabel, new CenterPanel ( delayField, false, true ), msLabel );
        updateBreadcrumb.add ( panel );
View Full Code Here

        split.setLeftComponent ( new GroupPanel ( GroupingType.fillLast, 0, false, toolBar, previewScroll ) );

        //

        final WebLabel label = new WebLabel ( "Just a label", WebLookAndFeel.getIcon ( 16 ) );
        addViewComponent ( "JLabel", label, label, true );

        //

        final WebScrollBar hsb = new WebScrollBar ( WebScrollBar.HORIZONTAL, 45, 10, 0, 100 );
        addViewComponent ( "JScrollBar (horizontal)", hsb, hsb, false );

        //

        final WebScrollBar vsb = new WebScrollBar ( WebScrollBar.VERTICAL, 45, 10, 0, 100 ).setPreferredHeight ( 100 );
        addViewComponent ( "JScrollBar (vertical)", vsb, vsb, true );

        //

        final WebLabel scrollComponent = new WebLabel ();
        scrollComponent.setPreferredSize ( new Dimension ( 1000, 600 ) );
        scrollComponent.setFocusable ( true );
        scrollComponent.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                scrollComponent.requestFocusInWindow ();
            }
        } );

        final WebScrollPane sp = new WebScrollPane ( scrollComponent );
        sp.setPreferredSize ( new Dimension ( 1, 100 ) );
View Full Code Here

    private void addViewComponent ( final String title, final JComponent displayedView, final JComponent view, final boolean center )
    {
        final SupportedComponent type = SupportedComponent.getComponentTypeByUIClassID ( view.getUIClassID () );

        final WebLabel titleLabel = new WebLabel ( title, type.getIcon () ).setMargin ( 0, 7, 3, 0 );

        final WebPanel boundsPanel = new WebPanel ( displayedView );
        boundsPanel.setStyleId ( "empty-border" );
        boundsPanels.add ( boundsPanel );

        final WebPanel viewPanel = new WebPanel ( center ? new CenterPanel ( boundsPanel ) : boundsPanel );
        viewPanel.setStyleId ( "inner-shade" );

        final WebPanel container = new WebPanel ( new BorderLayout ( 0, 0 ) );
        container.add ( titleLabel, BorderLayout.NORTH );
        container.add ( viewPanel, BorderLayout.CENTER );
        componentViewer.add ( container );

        titleLabel.addMouseListener ( new MouseAdapter ()
        {
            @Override
            public void mousePressed ( final MouseEvent e )
            {
                viewPanel.setVisible ( !viewPanel.isVisible () );
View Full Code Here

            {
                specialComponent = ( Component ) special;
            }
            else
            {
                specialComponent = new WebLabel ( special.toString () );
            }
            controls.add ( specialComponent, BorderLayout.WEST );
        }
        updateCenterer ();
    }
View Full Code Here

            {
                container.add ( ( Component ) message, BorderLayout.CENTER );
            }
            else
            {
                container.add ( new WebLabel ( message.toString () ), BorderLayout.CENTER );
            }
        }

        // Update window
        if ( updateWindow )
View Full Code Here

     * @return new default title component with specified icon and text
     */
    protected JComponent createDefaultTitleComponent ( final Icon icon, final String title )
    {
        // todo RTL orientation support
        final WebLabel defaultTitle;
        if ( titlePanePostion == LEFT )
        {
            defaultTitle = new WebVerticalLabel ( title, icon, WebLabel.LEADING, false );
        }
        else if ( titlePanePostion == RIGHT )
        {
            defaultTitle = new WebVerticalLabel ( title, icon, WebLabel.LEADING, true );
        }
        else
        {
            defaultTitle = new WebLabel ( title, icon, WebLabel.LEADING );
        }
        defaultTitle.setDrawShade ( true );
        return defaultTitle;
    }
View Full Code Here

TOP

Related Classes of com.alee.laf.label.WebLabel

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.