Package com.alee.laf.scroll

Examples of com.alee.laf.scroll.WebScrollPane


                // Image file viewer
                final WebImage image = new WebImage ();
                image.setIcon ( ImageUtils.loadImage ( getEntryInputStream ( entry ) ) );

                // Image scroll
                final WebScrollPane imageScroll = new WebScrollPane ( image, false );
                imageScroll.setVerticalScrollBarPolicy ( WebScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
                imageScroll.setHorizontalScrollBarPolicy ( WebScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS );
                return imageScroll;
            }
            else
            {
                // Source code viewer
View Full Code Here


                final Rectangle vr = contentPanel.getVisibleRect ();
                contentPanel.scrollRectToVisible ( new Rectangle ( vr.x + e.getWheelRotation () * 25, vr.y, vr.width, vr.height ) );
            }
        } );

        scroll = new WebScrollPane ( contentPanel, false )
        {
            @Override
            public Dimension getPreferredSize ()
            {
                final Dimension ps = super.getPreferredSize ();
View Full Code Here

                            {
                                setSelectedPath ( ( File ) list.getSelectedValue () );
                            }
                        }
                    } );
                    listScroll = new WebScrollPane ( list );
                    listScroll.setShadeWidth ( 0 );
                    //                    listScroll.setHorizontalScrollBarPolicy (
                    //                            WebScrollPane.HORIZONTAL_SCROLLBAR_NEVER );
                    autocompleteDialog.getContentPane ().add ( listScroll, BorderLayout.CENTER );
View Full Code Here

    private void initializeViewer ()
    {
        componentViewer = new WebPanel ( new VerticalFlowLayout ( VerticalFlowLayout.TOP, 0, 15, true, false ) );
        componentViewer.setMargin ( 10 );

        final WebScrollPane previewScroll = new WebScrollPane ( componentViewer, false );
        previewScroll.setScrollBarStyleId ( "preview-scroll" );
        previewScroll.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS );

        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 ) );
        addViewComponent ( "JScrollBar in JScrollPane", sp, sp, false );

        //

        final String[] comboData =
View Full Code Here

                                                commitChanges.run ();
                                            }
                                        }
                                    } );

                                    final WebScrollPane scrollPane = new WebScrollPane ( historyList, false, false );
                                    scrollPane.setOpaque ( false );
                                    scrollPane.getViewport ().setOpaque ( false );
                                    scrollPane.setShadeWidth ( 0 );

                                    final WebScrollBar vsb = scrollPane.getWebVerticalScrollBar ();
                                    vsb.setMargin ( WebComboBoxStyle.scrollBarMargin );
                                    vsb.setPaintButtons ( WebComboBoxStyle.scrollBarButtonsVisible );
                                    vsb.setPaintTrack ( WebComboBoxStyle.scrollBarTrackVisible );
                                    LafUtils.setScrollBarStyleId ( scrollPane, "combo-box" );
View Full Code Here

                updateToolbarControlsState ();
            }
        } );

        // Tree scroll
        final WebScrollPane treeScroll = new WebScrollPane ( fileTree );
        treeScroll.setPreferredWidth ( 400 );

        // Panel content
        setLayout ( new BorderLayout ( 0, 3 ) );
        add ( contolsToolbar, BorderLayout.NORTH );
        final WebPanel panel = new WebPanel ( new BorderLayout ( 0, 1 ) );
View Full Code Here

                    fileButton.requestFocusInWindow ();
                }
            }
        } );

        final WebScrollPane listScroll = new WebScrollPane ( list );
        listScroll.setShadeWidth ( 0 );
        listScroll.setDrawFocus ( false );
        window.add ( listScroll );

        window.applyComponentOrientation ( getComponentOrientation () );
        window.pack ();

        final Point los = fileButton.getLocationOnScreen ();
        final Insets bi = list.getWebListCellRenderer ().getBorder ().getBorderInsets ( list );
        if ( getComponentOrientation ().isLeftToRight () )
        {
            window.setLocation ( los.x + fileButton.getInsets ().left - listScroll.getInsets ().left -
                    bi.left, los.y + fileButton.getHeight () + 2 );
        }
        else
        {
            window.setLocation ( los.x + fileButton.getWidth () - fileButton.getInsets ().right -
                    listScroll.getWidth () + listScroll.getInsets ().right + bi.right, los.y + fileButton.getHeight () + 2 );
        }

        window.setVisible ( true );

        list.requestFocusInWindow ();
View Full Code Here

        setLayout ( new TableLayout ( new double[][]{ { RULER_LENGTH, TableLayout.PREFERRED, TableLayout.FILL },
                { RULER_LENGTH, TableLayout.PREFERRED, TableLayout.FILL } } ) );

        setFont ( new JLabel ().getFont ().deriveFont ( 10f ) );

        view = new WebScrollPane ( this, false );

        final NinePatchEditorMouseAdapter npema = new NinePatchEditorMouseAdapter ();
        addMouseListener ( npema );
        addMouseMotionListener ( npema );
        addMouseWheelListener ( npema );
View Full Code Here

    public WebScrollPane getView ( final boolean withBorder )
    {
        if ( view == null )
        {
            view = new WebScrollPane ( WebImageGallery.this, withBorder )
            {
                @Override
                public Dimension getPreferredSize ()
                {
                    final int columns = Math.min ( images.size (), preferredColumnCount );
View Full Code Here

    private DictionariesTree dictionariesTree;

    public static void main ( String[] args )
    {
        WebLookAndFeel.install ();
        TestFrame.show ( new WebScrollPane ( new LanguageEditor ()
        {
            {
                for ( Dictionary d : LanguageManager.getDictionaries () )
                {
                    loadDictionary ( d );
View Full Code Here

TOP

Related Classes of com.alee.laf.scroll.WebScrollPane

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.