public static JMenuBar initJmolMenu(JFrame frame,
			AbstractAlignmentJmol parent, AFPChain afpChain,
			MultipleAlignment msa) {

		JMenuBar menu = new JMenuBar();

/// FILE MENU
		JMenu file= new JMenu("File");
		file.setMnemonic(KeyEvent.VK_F);
		file.getAccessibleContext().setAccessibleDescription("File Menu");
		//Load
		if (parent != null){
			JMenuItem loadF = getLoadMenuItem();
			loadF.addActionListener(new MyAlignmentLoadListener());
			file.add(loadF);
		}
		//Save
		JMenuItem saveF = getSaveAlignmentMenuItem(afpChain, msa);
		file.add(saveF);
		//Open PDB
		JMenuItem openPDB = getShowPDBMenuItem();
		file.add(openPDB);
		//Open Import
		JMenuItem openI = getOpenPDBMenuItem();
		file.add(openI);
		//Export
		if (parent != null){
			JMenuItem exportI =  getExportPDBMenuItem(parent);
			file.add(exportI);
		}
		//Open DBI
		JMenuItem openDBI = getDBResultMenuItem();
		file.add(openDBI);
		file.addSeparator();
		//Print
		if ( parent != null){
			JMenuItem print = getPrintMenuItem();
			print.addActionListener(parent.getJmolPanel());
			file.add(print);
		}
		file.addSeparator();
		//Close Frame
		JMenuItem closeI = getCloseMenuItem(frame);
		file.add(closeI);
		//Exit
		JMenuItem exitI = getExitMenuItem();
		file.add(exitI);

		menu.add(file);

/// ALIGN MENU
		JMenu align = new JMenu("Align");
		align.setMnemonic(KeyEvent.VK_A);
		//new Pairwise alignment
		JMenuItem pairI = getPairwiseAlignmentMenuItem();
		align.add(pairI);
		//new Multiple alignment
		JMenuItem multI = getMultipleAlignmentMenuItem();
		align.add(multI);

		menu.add(align);

/// VIEW MENU
		JMenu view = new JMenu("View");
		view.getAccessibleContext().setAccessibleDescription("View Menu");
		view.setMnemonic(KeyEvent.VK_V);

		if ( parent != null){
			//Alignment Panel
			JMenuItem apI = MenuCreator.getIcon(parent,ALIGNMENT_PANEL);
			apI.setMnemonic(KeyEvent.VK_M);
			apI.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, keyMask));
			view.add(apI);
			//Text Format
			JMenuItem textI = MenuCreator.getIcon(parent,TEXT_ONLY);
			textI.setMnemonic(KeyEvent.VK_T);
			view.add(textI);
			//Alignment Pairs
			JMenuItem pairsI = MenuCreator.getIcon(parent,PAIRS_ONLY);
			pairsI.setMnemonic(KeyEvent.VK_P);
			view.add(pairsI);
			//FatCat Format
			JMenuItem textF = MenuCreator.getIcon(parent,FATCAT_TEXT);
			textF.setMnemonic(KeyEvent.VK_F);
			view.add(textF);
			//Distance Matrices
			JMenuItem distMax = new  JMenuItem(DIST_MATRICES);
			distMax.setMnemonic(KeyEvent.VK_D);
			distMax.addActionListener(new MyDistMaxListener(parent));
			view.add(distMax);
			//Dot Plot - only if the alignment was an afpChain
			if (afpChain != null){
				JMenuItem dotplot = new JMenuItem(DOT_PLOT);
				dotplot.setMnemonic(KeyEvent.VK_O);
				dotplot.addActionListener(new DotPlotListener(afpChain));
				view.add(dotplot);
			}
			//Phylogenetics - only if it is a MultipleAlignment
			if (afpChain == null){
				JMenuItem tree = getIcon(parent, PHYLOGENETIC_TREE);
				tree.setMnemonic(KeyEvent.VK_T);
				view.add(tree);
			}
		}
		menu.add(view);

/// HELP MENU
		JMenu about = new JMenu("Help");
		about.setMnemonic(KeyEvent.VK_H);

		JMenuItem helpM = getHelpMenuItem();
		about.add(helpM);

		JMenuItem aboutM = getAboutMenuItem();
		about.add(aboutM);

		menu.add(Box.createGlue());
		menu.add(about);

		return menu;
	}
public static JMenuBar initJmolMenu ( JFrame frame , AbstractAlignmentJmol parent , AFPChain afpChain , MultipleAlignment msa ) { JMenuBar menu = new JMenuBar ( ) ; JMenu file = new JMenu ( "File" ) ; file . setMnemonic ( KeyEvent . VK_F ) ; file . getAccessibleContext ( ) . setAccessibleDescription ( "File Menu" ) ; if ( parent != null ) { JMenuItem loadF = getLoadMenuItem ( ) ; loadF . addActionListener ( new MyAlignmentLoadListener ( ) ) ; file . add ( loadF ) ; } JMenuItem saveF = getSaveAlignmentMenuItem ( afpChain , msa ) ; file . add ( saveF ) ; JMenuItem openPDB = getShowPDBMenuItem ( ) ; file . add ( openPDB ) ; JMenuItem openI = getOpenPDBMenuItem ( ) ; file . add ( openI ) ; if ( parent != null ) { JMenuItem exportI = getExportPDBMenuItem ( parent ) ; file . add ( exportI ) ; } JMenuItem openDBI = getDBResultMenuItem ( ) ; file . add ( openDBI ) ; file . addSeparator ( ) ; if ( parent != null ) { JMenuItem print = getPrintMenuItem ( ) ; print . addActionListener ( parent . getJmolPanel ( ) ) ; file . add ( print ) ; } file . addSeparator ( ) ; JMenuItem closeI = getCloseMenuItem ( frame ) ; file . add ( closeI ) ; JMenuItem exitI = getExitMenuItem ( ) ; file . add ( exitI ) ; menu . add ( file ) ; JMenu align = new JMenu ( "Align" ) ; align . setMnemonic ( KeyEvent . VK_A ) ; JMenuItem pairI = getPairwiseAlignmentMenuItem ( ) ; align . add ( pairI ) ; JMenuItem multI = getMultipleAlignmentMenuItem ( ) ; align . add ( multI ) ; menu . add ( align ) ; JMenu view = new JMenu ( "View" ) ; view . getAccessibleContext ( ) . setAccessibleDescription ( "View Menu" ) ; view . setMnemonic ( KeyEvent . VK_V ) ; if ( parent != null ) { JMenuItem apI = MenuCreator . getIcon ( parent , ALIGNMENT_PANEL ) ; apI . setMnemonic ( KeyEvent . VK_M ) ; apI . setAccelerator ( KeyStroke . getKeyStroke ( KeyEvent . VK_M , keyMask ) ) ; view . add ( apI ) ; JMenuItem textI = MenuCreator . getIcon ( parent , TEXT_ONLY ) ; textI . setMnemonic ( KeyEvent . VK_T ) ; view . add ( textI ) ; JMenuItem pairsI = MenuCreator . getIcon ( parent , PAIRS_ONLY ) ; pairsI . setMnemonic ( KeyEvent . VK_P ) ; view . add ( pairsI ) ; JMenuItem textF = MenuCreator . getIcon ( parent , FATCAT_TEXT ) ; textF . setMnemonic ( KeyEvent . VK_F ) ; view . add ( textF ) ; JMenuItem distMax = new JMenuItem ( DIST_MATRICES ) ; distMax . setMnemonic ( KeyEvent . VK_D ) ; distMax . addActionListener ( new MyDistMaxListener ( parent ) ) ; view . add ( distMax ) ; if ( afpChain != null ) { JMenuItem dotplot = new JMenuItem ( DOT_PLOT ) ; dotplot . setMnemonic ( KeyEvent . VK_O ) ; dotplot . addActionListener ( new DotPlotListener ( afpChain ) ) ; view . add ( dotplot ) ; } if ( afpChain == null ) { JMenuItem tree = getIcon ( parent , PHYLOGENETIC_TREE ) ; tree . setMnemonic ( KeyEvent . VK_T ) ; view . add ( tree ) ; } } menu . add ( view ) ; JMenu about = new JMenu ( "Help" ) ; about . setMnemonic ( KeyEvent . VK_H ) ; JMenuItem helpM = getHelpMenuItem ( ) ; about . add ( helpM ) ; JMenuItem aboutM = getAboutMenuItem ( ) ; about . add ( aboutM ) ; menu . add ( Box . createGlue ( ) ) ; menu . add ( about ) ; return menu ; }
Provide a JMenuBar that can be added to a JFrame containing
a JmolPanel. The alignment has to be either an AFPChain or a
MultipleAlignment: set the other parameter to null.<p>
Menus included:
<ul><li>File: open, save, export, import, exit.
<li>Align: new pairwise alignment, new multiple alignment.
<li>View: aligment panel, aligned pairs, text format,
FatCat format, distance matrices, dot plot.
<li>Help
</ul>

@return a JMenuBar