menuSaveAs = new JMenuItem ("Save As");
menuSaveAs = new JMenuItem ("Save As...");
    protected JMenuBar createMenus ()    {        HashMap mnemonics = new HashMap();        int mask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();        JMenuBar menuBar = new JMenuBar ();        JMenu menuLib = new JMenu ("Library");	mnemonics.put( menuLib, new Integer( KeyEvent.VK_L ) );                NewAction newAction=new NewAction ( mnemonics );        menuLib.add (newAction);        menuLib.getItem (menuLib.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_N, mask));                OpenAction openAction=new OpenAction ( mnemonics );        menuLib.add (openAction);        menuLib.getItem (menuLib.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_O, mask));                saveAction=new SaveAction ( mnemonics );        menuLib.add (saveAction);        menuLib.getItem (menuLib.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_S, mask));                menuSaveAs = new JMenuItem ("Save As");	mnemonics.put( menuSaveAs, new Integer( KeyEvent.VK_A) );        menuSaveAs.addActionListener (new ActionListener ()        {            public void actionPerformed (ActionEvent e)            {                saveFrameAs ();            }        });        menuSaveAs.setEnabled (false);        menuLib.add (menuSaveAs);                menuLib.addSeparator();        newSceneAction=new NewSceneAction( mnemonics );        menuLib.add(newSceneAction);                transferSceneAction=new TransferSceneAction( mnemonics );        menuLib.add(transferSceneAction);        menuLib.addSeparator();                sortAction=new SortAction ( mnemonics );        menuLib.add (sortAction);                searchAction=new SearchAction ( mnemonics );        menuLib.add (searchAction);                dupAction=new DeleteDuplicatesAction ( mnemonics );        menuLib.add (dupAction);        menuLib.addSeparator();        final ExitAction exitAction=new ExitAction ( mnemonics );        if (!MacUtils.isMac())	  menuLib.add (exitAction);        menuBar.add (menuLib);                JMenu menuPatch = new JMenu ("Patch");	mnemonics.put( menuPatch, new Integer(KeyEvent.VK_P) );        copyAction=new CopyAction ( mnemonics );        menuPatch.add (copyAction);        menuPatch.getItem (menuPatch.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_C, mask));        cutAction=new CutAction ( mnemonics );        menuPatch.add (cutAction);        menuPatch.getItem (menuPatch.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_X, mask));        pasteAction=new PasteAction ( mnemonics );        menuPatch.add (pasteAction);        menuPatch.getItem (menuPatch.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_V, mask));        deleteAction=new DeleteAction ( mnemonics );        menuPatch.add (deleteAction);        menuPatch.addSeparator();        importAction=new ImportAction ( mnemonics );        menuPatch.add (importAction);        exportAction=new ExportAction ( mnemonics );        menuPatch.add (exportAction);        importAllAction=new ImportAllAction ( mnemonics );        menuPatch.add (importAllAction);        menuPatch.addSeparator();        sendAction=new SendAction ( mnemonics );        menuPatch.add (sendAction);        menuPatch.getItem (menuPatch.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_T, mask));        sendToAction=new SendToAction ( mnemonics );        menuPatch.add (sendToAction);               storeAction=new StoreAction ( mnemonics );        menuPatch.add (storeAction);        receiveAction=new GetAction( mnemonics );        menuPatch.add(receiveAction);                     // phil@muqus.com        menuPatch.addSeparator();        playAction=new PlayAction ( mnemonics );        menuPatch.add (playAction);        menuPatch.getItem (menuPatch.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_P, mask));        editAction=new EditAction ( mnemonics );        menuPatch.add (editAction);        menuPatch.getItem (menuPatch.getItemCount ()-1).setAccelerator (        KeyStroke.getKeyStroke (KeyEvent.VK_E, mask));        menuPatch.addSeparator();        reassignAction=new ReassignAction( mnemonics ); 	menuPatch.add (reassignAction);        crossBreedAction=new CrossBreedAction ( mnemonics );        menuPatch.add (crossBreedAction);        newPatchAction=new NewPatchAction ( mnemonics );        menuPatch.add (newPatchAction);        extractAction=new ExtractAction ( mnemonics );        menuPatch.add (extractAction);        menuBar.add (menuPatch);        	final PrefsAction prefsAction=new PrefsAction ( mnemonics );	if (!MacUtils.isMac()) {	  JMenu menuConfig = new JMenu ("Config");	  mnemonics.put( menuConfig, new Integer( KeyEvent.VK_C) );	  menuConfig.add (prefsAction);	  // NoteChooserAction noteChooserAction=new NoteChooserAction ();	  // menuConfig.add (noteChooserAction); -- replaced by NoteChooserConfigPanel - emenaker 2003.03.17	  menuBar.add (menuConfig);	}		// Moved "Synths" and "Midi Monitor" to a "Window" menu - emenaker 2003.03.24        		JMenu menuWindow = new JMenu ("Window");		mnemonics.put (menuWindow, new Integer(KeyEvent.VK_C));		JMenuItem menuSynths = new JMenuItem ("Synths");		mnemonics.put (menuSynths, new Integer(KeyEvent.VK_S));		menuSynths.addActionListener (new ActionListener ()		{			public void actionPerformed (ActionEvent e)			{				SynthConfigDialog scd= new SynthConfigDialog (PatchEdit.this);				scd.show ();			}		}		);		menuWindow.add (menuSynths);		monitorAction=new MonitorAction ( mnemonics );		menuWindow.add (monitorAction);		menuBar.add (menuWindow);                JMenu menuHelp = new JMenu ("Help");	mnemonics.put( menuHelp, new Integer(KeyEvent.VK_H) );        final AboutAction aboutAction = new AboutAction( mnemonics );       	if (!MacUtils.isMac())	  menuHelp.add (aboutAction);        docsAction = new DocsAction( mnemonics );	menuHelp.add(docsAction);        menuBar.add (menuHelp);                menuPatchPopup=new JPopupMenu ();        menuPatchPopup.add (playAction);        menuPatchPopup.add (editAction);        menuPatchPopup.addSeparator();        menuPatchPopup.add (reassignAction);        menuPatchPopup.add (storeAction);        menuPatchPopup.add (sendAction);        menuPatchPopup.add (sendToAction);        menuPatchPopup.addSeparator();        menuPatchPopup.add (cutAction);        menuPatchPopup.add (copyAction);        menuPatchPopup.add (pasteAction);                JButton b;        toolBar = new JToolBar ();        toolBar.setPreferredSize (new Dimension (500, 35));        toolBar.setFloatable (true);        b=toolBar.add (newAction);        b.setToolTipText ("New Library");        b.setIcon (loadIcon ("images/New24.gif"));        b.setText (null);        b=toolBar.add (openAction);        b.setToolTipText ("Open Library");        b.setIcon (loadIcon ("images/Open24.gif"));        b.setText (null);        b=toolBar.add (saveAction);        b.setToolTipText ("Save Library");        b.setIcon (loadIcon ("images/Save24.gif"));        b.setText (null);        toolBar.addSeparator ();        b=toolBar.add (copyAction);        b.setToolTipText ("Copy Patch");        b.setIcon (loadIcon ("images/Copy24.gif"));        b.setText (null);        b=toolBar.add (cutAction);        b.setToolTipText ("Cut Patch");        b.setIcon (loadIcon ("images/Cut24.gif"));        b.setText (null);        b=toolBar.add (pasteAction);        b.setToolTipText ("Paste Patch");        b.setIcon (loadIcon ("images/Paste24.gif"));        b.setText (null);        b=toolBar.add (importAction);        b.setToolTipText ("Import Patch");        b.setIcon (loadIcon ("images/Import24.gif"));        b.setText (null);        b=toolBar.add (exportAction);        b.setToolTipText ("Export Patch");        b.setIcon (loadIcon ("images/Export24.gif"));        b.setText (null);        toolBar.addSeparator ();        b=toolBar.add (playAction);        b.setToolTipText ("Play Patch");        b.setIcon (loadIcon ("images/Volume24.gif"));        b.setText (null);        b=toolBar.add (storeAction);        b.setToolTipText ("Store Patch");        b.setIcon (loadIcon ("images/ComposeMail24.gif"));        b.setText (null);        b=toolBar.add (editAction);        b.setToolTipText ("Edit Patch");        b.setIcon (loadIcon ("images/Edit24.gif"));        b.setText (null);        toolBar.addSeparator ();        NextFaderAction nextFaderAction = new NextFaderAction ( mnemonics );        b=toolBar.add (nextFaderAction);        b.setToolTipText ("Go to Next Fader Bank");        b.setIcon (loadIcon ("images/Forward24.gif"));        b.setText (null);                                        getContentPane ().add (toolBar,BorderLayout.NORTH);        toolBar.setVisible (true); //necessary as of kestrel        	if (!MacUtils.isMac())	  setMnemonics( mnemonics );	MacUtils.init( new ApplicationAdapter () {	    public void handleAbout(ApplicationEvent e) {	      final ActionEvent event = 		new ActionEvent(e.getSource(),0,"About");	      // opens dialog, so I think we need to do this to avoid deadlock	      SwingUtilities.invokeLater(new Runnable () {		  public void run () {		    try {		      aboutAction.actionPerformed(event);		    } catch (Exception e) {}		  }		});	      e.setHandled(true);	    }	    public void handleOpenFile(ApplicationEvent e) {	      final File file = new File(e.getFilename());	      SwingUtilities.invokeLater(new Runnable () {		  public void run () {		    try {		      openFrame(file);		    } catch (Exception e) {}		  }		});	      e.setHandled(true);	    }	    public void handlePreferences(ApplicationEvent e) {	      e.setHandled(true);	      final ActionEvent event = 		new ActionEvent(e.getSource(),0,"Preferences");	      SwingUtilities.invokeLater(new Runnable () {		  public void run () {		    try {		      prefsAction.actionPerformed(event);		    } catch (Exception e) {}		  }		});	    }	    public void handleQuit(ApplicationEvent e) {	      exitAction.actionPerformed(new ActionEvent(e.getSource(),0,							 "Exit"));	      e.setHandled(true);	    }	  } );        return menuBar;    }