Package com.alee.extended.menu

Examples of com.alee.extended.menu.WebDynamicMenu


     *
     * @return new dynamic menu
     */
    protected WebDynamicMenu createMenu ()
    {
        final WebDynamicMenu menu = new WebDynamicMenu ();
        menu.setType ( ( DynamicMenuType ) type.getSelectedItem () );
        menu.setHideType ( ( DynamicMenuType ) hidingType.getSelectedItem () );
        menu.setRadius ( Integer.parseInt ( radius.getText () ) );
        menu.setStepProgress ( 0.06f );

        final int amount = Integer.parseInt ( itemsAmount.getText () );
        for ( int i = 0; i < amount; i++ )
        {
            final int number = i;
            final ImageIcon icon = loadIcon ( ( i % 10 + 1 ) + ".png" );
            final WebDynamicMenuItem item = new WebDynamicMenuItem ( icon, new ActionListener ()
            {
                @Override
                public void actionPerformed ( final ActionEvent e )
                {
                    final WebLookAndFeelDemo p = WebLookAndFeelDemo.getInstance ();
                    NotificationManager.showInnerNotification ( p, "Menu #" + number + " clicked", icon ).setDisplayTime ( 3000 );
                }
            } );
            item.setMargin ( new Insets ( 8, 8, 8, 8 ) );
            item.setPaintBorder ( drawBorder.isSelected () );
            menu.addItem ( item );
        }

        return menu;
    }
View Full Code Here

TOP

Related Classes of com.alee.extended.menu.WebDynamicMenu

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.