package gui;
import gui.actions.ActionManager;
import gui.listeners.MainMenuListener;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
@SuppressWarnings("serial")
public class Menu extends JMenuBar{
private JMenu fileMenu;
private JMenu editMenu;
private JMenu helpMenu;
public Menu() {
fileMenu = new JMenu("File");
editMenu = new JMenu("Edit");
helpMenu = new JMenu("Help");
fileMenu.setMnemonic('f');
editMenu.setMnemonic('e');
helpMenu.setMnemonic('h');
add(fileMenu);
add(editMenu);
add(helpMenu);
fileMenu.add(ActionManager.getInstance().getNewFileAction());
fileMenu.add(ActionManager.getInstance().getOpenFileAction());
fileMenu.add(ActionManager.getInstance().getSaveAction());
fileMenu.add(ActionManager.getInstance().getSaveAsAction());
fileMenu.addSeparator();
fileMenu.add(ActionManager.getInstance().getQuitAction());
editMenu.add(ActionManager.getInstance().getUndoAction());
editMenu.add(ActionManager.getInstance().getRedoAction());
editMenu.addSeparator();
editMenu.add(ActionManager.getInstance().getDeleteAction());
editMenu.add(ActionManager.getInstance().getMoveAction());
editMenu.add(ActionManager.getInstance().getResizeAction());
helpMenu.add(ActionManager.getInstance().getAboutAction());
MainMenuListener mml = new MainMenuListener();
fileMenu.addMenuListener(mml);
editMenu.addMenuListener(mml);
helpMenu.addMenuListener(mml);
}
}