*/
@Override
public Component getPreview ( final WebLookAndFeelDemo owner )
{
type = new WebComboBox ( DynamicMenuType.values (), DynamicMenuType.shutter );
final GroupPanel tg = new GroupPanel ( 5, new WebLabel ( "Display animation:" ), type );
hidingType = new WebComboBox ( DynamicMenuType.values (), DynamicMenuType.star );
final GroupPanel htg = new GroupPanel ( 5, new WebLabel ( "Hide animation:" ), hidingType );
radius = new WebTextField ( new IntTextDocument (), "70", 4 );
final GroupPanel rg = new GroupPanel ( 5, new WebLabel ( "Menu radius:" ), radius );
itemsAmount = new WebTextField ( new IntTextDocument (), "5", 4 );
final GroupPanel iag = new GroupPanel ( 5, new WebLabel ( "Items amount:" ), itemsAmount );
drawBorder = new WebCheckBox ( "Show custom border", true );
final WebPanel clickPanel = new WebPanel ( true );
clickPanel.setWebColoredBackground ( false );
clickPanel.setShadeWidth ( 20 );
clickPanel.setBackground ( Color.WHITE );
clickPanel.add ( new WebLabel ( "Click with left mouse button here to show menu", WebLabel.CENTER ) );
clickPanel.addMouseListener ( new MouseAdapter ()
{
@Override
public void mousePressed ( final MouseEvent e )
{
if ( SwingUtils.isLeftMouseButton ( e ) )
{
createMenu ().showMenu ( e.getComponent (), e.getPoint () );
}
}
} );
final GroupPanel controls = new GroupPanel ( 15, tg, htg, rg, iag, drawBorder );
final AlignPanel alignPanel = new AlignPanel ( controls, SwingConstants.CENTER, SwingConstants.CENTER );
return new GroupPanel ( GroupingType.fillLast, 10, false, alignPanel, clickPanel ).setMargin ( 10 );
}