com.alee.laf.menu.WebMenu Java Examples

The following examples show how to use com.alee.laf.menu.WebMenu. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MenuBar.java    From lnk2pwn with MIT License 6 votes vote down vote up
@PostConstruct	
private void initComponents() {
    WebMenu menu = new WebMenu("File");
    menu.setIcon(IconFactory.getIcon("file.png"));
    
    WebMenuItem about = new WebMenuItem("About");
    about.setIcon(IconFactory.getIcon("about.png"));
    about.addActionListener(showAboutDialogAction);
    
    WebMenuItem exit = new WebMenuItem("Exit");
    exit.setIcon(IconFactory.getIcon("exit.png"));
    exit.addActionListener(exitAction);
    
    menu.add(about);
    menu.add(new WebSeparator());
    menu.add(exit);		
    
    this.add(menu);
}
 
Example #2
Source File: Menu.java    From Spade with GNU General Public License v3.0 6 votes vote down vote up
public static WebMenuBar createMenuBar()
{
	// M.E.I. MenuBar
	WebMenuBar menuBar = new WebMenuBar();
	//menuBar.setMenuBarStyle(MenuBarStyle.standalone);
	
	// Main Menus
	menuBar.add(createFileMenu());
	menuBar.add(createEditMenu());
	menuBar.add(createViewMenu());
	
	// Editing Menus
	menuBar.add((Spade.main.effects.operations = new WebMenu("Image")));
	menuBar.add((Spade.main.tools.toolsMenu = new WebMenu("Tools")));
	menuBar.add((Spade.main.effects.effects = new WebMenu("Effects")));
	menuBar.add((Spade.main.effects.generators = new WebMenu("Generators")));
	
	// Info Menus
	menuBar.add(createWindowMenu());
	menuBar.add(createHelpMenu());
	
	return menuBar;
}
 
Example #3
Source File: MenuGenerator.java    From weblaf with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void setLanguagePrefix ( @Nullable final String prefix )
{
    // Perform default actions
    super.setLanguagePrefix ( prefix );

    // Update menu language if any prefix is set
    final WebMenu menu = getMenu ();
    final String text = menu.getLanguage ();
    final String languageKey = getLanguageKey ( text );
    if ( languageKey != null )
    {
        menu.setLanguage ( languageKey );
    }
    else
    {
        menu.removeLanguage ();
        menu.setText ( text );
    }
}
 
Example #4
Source File: Menu.java    From Spade with GNU General Public License v3.0 5 votes vote down vote up
private static WebMenu createWindowMenu()
{
	WebMenu window = new WebMenu("Window");
	
	window.add(createDialogsMenu());
	
	return window;
}
 
Example #5
Source File: InfoMenuBar.java    From Spade with GNU General Public License v3.0 5 votes vote down vote up
public WebMenuBar createInfoMenuBar()
{
	WebMenuBar menuBar = new WebMenuBar();
	menuBar.setMenuBarStyle(MenuBarStyle.standalone);
	
	WebMenuBar left = new WebMenuBar();
	left.setUndecorated(true);
	left.setLayout(new GridLayout(1, 0));
	
	left.setBackground(PaintCanvas.TRANSPARENT);
	
	scale = new WebMenu("");
	saved = new WebMenu("");
	size = new WebMenu("");
	coords = new WebMenu("");
	
	left.add(new WebMenu());
	left.add(coords);
	left.add(size);
	left.add(scale);
	
	left.add(saved);
	
	menuBar.setLayout(new BorderLayout());
	menuBar.add(left, BorderLayout.CENTER);
	
	// Check if the MemoryWatcher should be activated.
	if(System.getProperty("DmemoryWatcherFlag") != null)
	{
		memoryWatcher = new MemoryWatcher();
		menuBar.add(memoryWatcher, BorderLayout.EAST);
	}
	
	return menuBar;
}
 
Example #6
Source File: MenuGenerator.java    From weblaf with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Constructs new {@link MenuGenerator} using {@link WebMenu} with the specified settings.
 *
 * @param id   {@link StyleId}
 * @param text {@link WebMenu} text
 * @param icon {@link WebMenu} {@link Icon}
 */
public MenuGenerator ( @NotNull final StyleId id, @Nullable final String text, @Nullable final Icon icon )
{
    this ( new WebMenu ( id, text, icon ) );
}
 
Example #7
Source File: MenuGenerator.java    From weblaf with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Constructs new {@link MenuGenerator} using {@link WebMenu} with the specified settings.
 *
 * @param id     {@link StyleId}
 * @param action {@link WebMenu} {@link Action}
 */
public MenuGenerator ( @NotNull final StyleId id, @NotNull final Action action )
{
    this ( new WebMenu ( id, action ) );
}
 
Example #8
Source File: MenuGenerator.java    From weblaf with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Constructs new {@link MenuGenerator} using the specified {@link WebMenu}.
 *
 * @param menu {@link WebMenu}
 */
public MenuGenerator ( @NotNull final WebMenu menu )
{
    super ( menu );
}