*
* @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;
}