Merge branch 'Jalview-JS/develop' into merge_js_develop
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.jbgui;
22
23 import java.awt.BorderLayout;
24 import java.awt.Color;
25 import java.awt.GridLayout;
26 import java.awt.event.ActionEvent;
27 import java.awt.event.ActionListener;
28 import java.awt.event.FocusAdapter;
29 import java.awt.event.FocusEvent;
30 import java.awt.event.InputEvent;
31 import java.awt.event.KeyEvent;
32 import java.awt.event.MouseAdapter;
33 import java.awt.event.MouseEvent;
34 import java.io.IOException;
35 import java.util.HashMap;
36 import java.util.Map;
37
38 import javax.swing.BorderFactory;
39 import javax.swing.ButtonGroup;
40 import javax.swing.JCheckBoxMenuItem;
41 import javax.swing.JInternalFrame;
42 import javax.swing.JLabel;
43 import javax.swing.JMenu;
44 import javax.swing.JMenuBar;
45 import javax.swing.JMenuItem;
46 import javax.swing.JPanel;
47 import javax.swing.JRadioButtonMenuItem;
48 import javax.swing.JTabbedPane;
49 import javax.swing.KeyStroke;
50 import javax.swing.event.ChangeEvent;
51 import javax.swing.event.MenuEvent;
52 import javax.swing.event.MenuListener;
53
54 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
55 import jalview.analysis.GeneticCodeI;
56 import jalview.analysis.GeneticCodes;
57 import jalview.api.SplitContainerI;
58 import jalview.bin.Cache;
59 import jalview.gui.JvSwingUtils;
60 import jalview.gui.Preferences;
61 import jalview.hmmer.HmmerCommand;
62 import jalview.io.FileFormatException;
63 import jalview.io.FileFormats;
64 import jalview.schemes.ResidueColourScheme;
65 import jalview.util.MessageManager;
66 import jalview.util.Platform;
67
68
69 @SuppressWarnings("serial")
70 public class GAlignFrame extends JInternalFrame
71 {
72   protected JMenuBar alignFrameMenuBar = new JMenuBar();
73
74   protected JMenuItem closeMenuItem = new JMenuItem();
75
76   public JMenu webService = new JMenu();// BH 2019 was protected, but not
77                                         // sufficient for AlignFrame thread run
78     // JBP - followed suite for these other service related GUI elements.
79     // TODO: check we really need these to be public
80   public JMenu hmmerMenu = new JMenu();
81
82   public JMenuItem webServiceNoServices;
83
84   protected JCheckBoxMenuItem viewBoxesMenuItem = new JCheckBoxMenuItem();
85
86   protected JCheckBoxMenuItem viewTextMenuItem = new JCheckBoxMenuItem();
87
88   protected JMenu sortByAnnotScore = new JMenu();
89
90   public JLabel statusBar = new JLabel(); // BH 2019 was protected, but not
91                                           // sufficient for
92                                           // AlignFrame.printWriter
93
94   protected JMenu outputTextboxMenu = new JMenu();
95
96   protected JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem();
97
98   protected JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem();
99
100   protected JCheckBoxMenuItem showNonconservedMenuItem = new JCheckBoxMenuItem();
101
102   protected JMenuItem undoMenuItem = new JMenuItem();
103
104   protected JMenuItem redoMenuItem = new JMenuItem();
105
106   protected JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem();
107
108   protected JCheckBoxMenuItem renderGapsMenuItem = new JCheckBoxMenuItem();
109
110   public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem();
111
112   JMenuItem copy = new JMenuItem();
113
114   JMenuItem cut = new JMenuItem();
115
116   JMenu pasteMenu = new JMenu();
117
118   protected JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem();
119
120   protected JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem();
121
122   protected JCheckBoxMenuItem scaleLeft = new JCheckBoxMenuItem();
123
124   protected JCheckBoxMenuItem scaleRight = new JCheckBoxMenuItem();
125
126   protected JCheckBoxMenuItem applyToAllGroups;
127
128   protected JMenu colourMenu = new JMenu();
129
130   protected JMenuItem textColour;
131
132   protected JCheckBoxMenuItem conservationMenuItem;
133
134   protected JMenuItem modifyConservation;
135
136   protected JCheckBoxMenuItem abovePIDThreshold;
137
138   protected JMenuItem modifyPID;
139
140   protected JRadioButtonMenuItem annotationColour;
141
142   protected JMenu sortByTreeMenu = new JMenu();
143
144   protected JMenu sort = new JMenu();
145
146   protected JMenuItem calculateTree = new JMenuItem();
147
148   protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem();
149
150   protected JCheckBoxMenuItem showNpFeatsMenuitem = new JCheckBoxMenuItem();
151
152   protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem();
153
154   protected JMenu showTranslation = new JMenu();
155
156   protected JMenuItem showReverse = new JMenuItem();
157
158   protected JMenuItem showReverseComplement = new JMenuItem();
159
160   protected JMenu showProducts = new JMenu();
161
162   protected JMenuItem runGroovy = new JMenuItem();
163
164   protected JMenuItem loadVcf;
165
166   protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
167
168   protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem();
169
170   protected JCheckBoxMenuItem listenToViewSelections = new JCheckBoxMenuItem();
171
172   protected JPanel statusPanel = new JPanel();
173
174   protected JMenuItem showAllSeqAnnotations = new JMenuItem();
175
176   protected JMenuItem hideAllSeqAnnotations = new JMenuItem();
177
178   protected JMenuItem showAllAlAnnotations = new JMenuItem();
179
180   protected JMenuItem hideAllAlAnnotations = new JMenuItem();
181
182   protected JCheckBoxMenuItem showComplementMenuItem = new JCheckBoxMenuItem();
183
184   protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem();
185
186   protected JTabbedPane tabbedPane = new JTabbedPane();
187
188   protected JMenuItem reload = new JMenuItem();
189
190   protected JMenu formatMenu = new JMenu();
191
192   protected JCheckBoxMenuItem idRightAlign = new JCheckBoxMenuItem();
193
194   protected JCheckBoxMenuItem centreColumnLabelsMenuItem = new JCheckBoxMenuItem();
195
196   protected JCheckBoxMenuItem followHighlightMenuItem = new JCheckBoxMenuItem();
197
198   protected JMenuItem gatherViews = new JMenuItem();
199
200   protected JMenuItem expandViews = new JMenuItem();
201
202   protected JCheckBoxMenuItem showGroupConsensus = new JCheckBoxMenuItem();
203
204   protected JCheckBoxMenuItem showGroupConservation = new JCheckBoxMenuItem();
205
206   protected JCheckBoxMenuItem showConsensusHistogram = new JCheckBoxMenuItem();
207
208   protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem();
209
210   protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
211
212   protected JCheckBoxMenuItem showInformationHistogram = new JCheckBoxMenuItem();
213
214   protected JCheckBoxMenuItem showHMMSequenceLogo = new JCheckBoxMenuItem();
215
216   protected JCheckBoxMenuItem normaliseHMMSequenceLogo = new JCheckBoxMenuItem();
217
218   protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
219
220   protected JMenuItem openFeatureSettings;
221
222   private SequenceAnnotationOrder annotationSortOrder;
223
224   private boolean showAutoCalculatedAbove = false;
225
226   private Map<KeyStroke, JMenuItem> accelerators = new HashMap<>();
227
228   private SplitContainerI splitFrame;
229
230   public GAlignFrame()
231   {
232     try
233     {
234
235       // for Web-page embedding using id=align-frame-div
236       setName(Platform.getAppID("alignment"));
237
238
239       jbInit();
240       setJMenuBar(alignFrameMenuBar);
241
242       // dynamically fill save as menu with available formats
243       for (String ff : FileFormats.getInstance().getWritableFormats(true))
244       {
245         JMenuItem item = new JMenuItem(ff);
246
247         item.addActionListener(new ActionListener()
248         {
249           @Override
250           public void actionPerformed(ActionEvent e)
251           {
252             outputText_actionPerformed(e.getActionCommand());
253           }
254         });
255
256         outputTextboxMenu.add(item);
257       }
258     } catch (Exception e)
259     {
260       System.err.println(e.toString());
261     }
262
263     if (Platform.allowMnemonics()) // was "not mac and not JS"
264     {
265       closeMenuItem.setMnemonic('C');
266       outputTextboxMenu.setMnemonic('T');
267       undoMenuItem.setMnemonic('Z');
268       redoMenuItem.setMnemonic('0');
269       copy.setMnemonic('C');
270       cut.setMnemonic('U');
271       pasteMenu.setMnemonic('P');
272       reload.setMnemonic('R');
273     }
274   }
275
276   private void jbInit() throws Exception
277   {
278     initColourMenu();
279   
280     JMenuItem saveAs = new JMenuItem(
281             MessageManager.getString("action.save_as"));
282     ActionListener al = new ActionListener()
283     {
284       @Override
285       public void actionPerformed(ActionEvent e)
286       {
287         saveAs_actionPerformed();
288       }
289     };
290   
291     // FIXME getDefaultToolkit throws an exception in Headless mode
292     KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S, Platform.SHORTCUT_KEY_MASK | InputEvent.SHIFT_DOWN_MASK,
293             false);
294     addMenuActionAndAccelerator(keyStroke, saveAs, al);
295   
296     closeMenuItem.setText(MessageManager.getString("action.close"));
297     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_W, Platform.SHORTCUT_KEY_MASK, false);
298     al = new ActionListener()
299     {
300       @Override
301       public void actionPerformed(ActionEvent e)
302       {
303         closeMenuItem_actionPerformed(false);
304       }
305     };
306     addMenuActionAndAccelerator(keyStroke, closeMenuItem, al);
307   
308     JMenu editMenu = new JMenu(MessageManager.getString("action.edit"));
309     JMenu viewMenu = new JMenu(MessageManager.getString("action.view"));
310     JMenu annotationsMenu = new JMenu(
311             MessageManager.getString("action.annotations"));
312     JMenu showMenu = new JMenu(MessageManager.getString("action.show"));
313     colourMenu.setText(MessageManager.getString("action.colour"));
314     JMenu calculateMenu = new JMenu(
315             MessageManager.getString("action.calculate"));
316     webService.setText(MessageManager.getString("action.web_service"));
317
318     initHMMERMenu();
319
320     JMenuItem selectAllSequenceMenuItem = new JMenuItem(
321             MessageManager.getString("action.select_all"));
322     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_A,
323             Platform.SHORTCUT_KEY_MASK, false);
324     al = new ActionListener()
325     {
326       @Override
327       public void actionPerformed(ActionEvent e)
328       {
329         selectAllSequenceMenuItem_actionPerformed(e);
330       }
331     };
332     addMenuActionAndAccelerator(keyStroke, selectAllSequenceMenuItem, al);
333   
334     JMenuItem deselectAllSequenceMenuItem = new JMenuItem(
335             MessageManager.getString("action.deselect_all"));
336     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
337     al = new ActionListener()
338     {
339       @Override
340       public void actionPerformed(ActionEvent e)
341       {
342         deselectAllSequenceMenuItem_actionPerformed(e);
343       }
344     };
345     addMenuActionAndAccelerator(keyStroke, deselectAllSequenceMenuItem, al);
346   
347     JMenuItem invertSequenceMenuItem = new JMenuItem(
348             MessageManager.getString("action.invert_sequence_selection"));
349     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I,
350             Platform.SHORTCUT_KEY_MASK, false);
351     al = new ActionListener()
352     {
353       @Override
354       public void actionPerformed(ActionEvent e)
355       {
356         invertSequenceMenuItem_actionPerformed(e);
357       }
358     };
359     addMenuActionAndAccelerator(keyStroke, invertSequenceMenuItem, al);
360   
361     JMenuItem grpsFromSelection = new JMenuItem(
362             MessageManager.getString("action.make_groups_selection"));
363     grpsFromSelection.addActionListener(new ActionListener()
364     {
365       @Override
366       public void actionPerformed(ActionEvent e)
367       {
368         makeGrpsFromSelection_actionPerformed(e);
369       }
370     });
371     JMenuItem expandAlignment = new JMenuItem(
372             MessageManager.getString("action.view_flanking_regions"));
373     expandAlignment.setToolTipText(
374             MessageManager.getString("label.view_flanking_regions"));
375     expandAlignment.addActionListener(new ActionListener()
376     {
377       @Override
378       public void actionPerformed(ActionEvent e)
379       {
380         expand_newalign(e);
381       }
382     });
383     JMenuItem remove2LeftMenuItem = new JMenuItem(
384             MessageManager.getString("action.remove_left"));
385     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_L,
386             Platform.SHORTCUT_KEY_MASK, false);
387     al = new ActionListener()
388     {
389       @Override
390       public void actionPerformed(ActionEvent e)
391       {
392         remove2LeftMenuItem_actionPerformed(e);
393       }
394     };
395     addMenuActionAndAccelerator(keyStroke, remove2LeftMenuItem, al);
396   
397     JMenuItem remove2RightMenuItem = new JMenuItem(
398             MessageManager.getString("action.remove_right"));
399     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_R,
400             Platform.SHORTCUT_KEY_MASK, false);
401     al = new ActionListener()
402     {
403       @Override
404       public void actionPerformed(ActionEvent e)
405       {
406         remove2RightMenuItem_actionPerformed(e);
407       }
408     };
409     addMenuActionAndAccelerator(keyStroke, remove2RightMenuItem, al);
410   
411     JMenuItem removeGappedColumnMenuItem = new JMenuItem(
412             MessageManager.getString("action.remove_empty_columns"));
413     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_E,
414             Platform.SHORTCUT_KEY_MASK, false);
415     al = new ActionListener()
416     {
417       @Override
418       public void actionPerformed(ActionEvent e)
419       {
420         removeGappedColumnMenuItem_actionPerformed(e);
421       }
422     };
423     addMenuActionAndAccelerator(keyStroke, removeGappedColumnMenuItem, al);
424   
425     JMenuItem removeAllGapsMenuItem = new JMenuItem(
426             MessageManager.getString("action.remove_all_gaps"));
427     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_E,
428             Platform.SHORTCUT_KEY_MASK
429                     | InputEvent.SHIFT_DOWN_MASK,
430             false);
431     al = new ActionListener()
432     {
433       @Override
434       public void actionPerformed(ActionEvent e)
435       {
436         removeAllGapsMenuItem_actionPerformed(e);
437       }
438     };
439     addMenuActionAndAccelerator(keyStroke, removeAllGapsMenuItem, al);
440   
441     JMenuItem justifyLeftMenuItem = new JMenuItem(
442             MessageManager.getString("action.left_justify_alignment"));
443     justifyLeftMenuItem.addActionListener(new ActionListener()
444     {
445       @Override
446       public void actionPerformed(ActionEvent e)
447       {
448         justifyLeftMenuItem_actionPerformed(e);
449       }
450     });
451     JMenuItem justifyRightMenuItem = new JMenuItem(
452             MessageManager.getString("action.right_justify_alignment"));
453     justifyRightMenuItem.addActionListener(new ActionListener()
454     {
455       @Override
456       public void actionPerformed(ActionEvent e)
457       {
458         justifyRightMenuItem_actionPerformed(e);
459       }
460     });
461     viewBoxesMenuItem.setText(MessageManager.getString("action.boxes"));
462     viewBoxesMenuItem.setState(true);
463     viewBoxesMenuItem.addActionListener(new ActionListener()
464     {
465       @Override
466       public void actionPerformed(ActionEvent e)
467       {
468         viewBoxesMenuItem_actionPerformed(e);
469       }
470     });
471     viewTextMenuItem.setText(MessageManager.getString("action.text"));
472     viewTextMenuItem.setState(true);
473     viewTextMenuItem.addActionListener(new ActionListener()
474     {
475       @Override
476       public void actionPerformed(ActionEvent e)
477       {
478         viewTextMenuItem_actionPerformed(e);
479       }
480     });
481     showNonconservedMenuItem
482             .setText(MessageManager.getString("label.show_non_conserved"));
483     showNonconservedMenuItem.setState(false);
484     showNonconservedMenuItem.addActionListener(new ActionListener()
485     {
486       @Override
487       public void actionPerformed(ActionEvent e)
488       {
489         showUnconservedMenuItem_actionPerformed(e);
490       }
491     });
492     JMenuItem sortPairwiseMenuItem = new JMenuItem(
493             MessageManager.getString("action.by_pairwise_id"));
494     sortPairwiseMenuItem.addActionListener(new ActionListener()
495     {
496       @Override
497       public void actionPerformed(ActionEvent e)
498       {
499         sortPairwiseMenuItem_actionPerformed(e);
500       }
501     });
502     JMenuItem sortIDMenuItem = new JMenuItem(
503             MessageManager.getString("action.by_id"));
504     sortIDMenuItem.addActionListener(new ActionListener()
505     {
506       @Override
507       public void actionPerformed(ActionEvent e)
508       {
509         sortIDMenuItem_actionPerformed(e);
510       }
511     });
512     JMenuItem sortLengthMenuItem = new JMenuItem(
513             MessageManager.getString("action.by_length"));
514     sortLengthMenuItem.addActionListener(new ActionListener()
515     {
516       @Override
517       public void actionPerformed(ActionEvent e)
518       {
519         sortLengthMenuItem_actionPerformed(e);
520       }
521     });
522     JMenuItem sortGroupMenuItem = new JMenuItem(
523             MessageManager.getString("action.by_group"));
524     sortGroupMenuItem.addActionListener(new ActionListener()
525     {
526       @Override
527       public void actionPerformed(ActionEvent e)
528       {
529         sortGroupMenuItem_actionPerformed(e);
530       }
531     });
532     JMenuItem sortEValueMenuItem = new JMenuItem(
533             MessageManager.getString("action.by_evalue"));
534     sortEValueMenuItem.addActionListener(new ActionListener()
535     {
536       @Override
537       public void actionPerformed(ActionEvent e)
538       {
539         sortEValueMenuItem_actionPerformed(e);
540       }
541     });
542     JMenuItem sortBitScoreMenuItem = new JMenuItem(
543             MessageManager.getString("action.by_bit_score"));
544     sortBitScoreMenuItem.addActionListener(new ActionListener()
545     {
546       @Override
547       public void actionPerformed(ActionEvent e)
548       {
549         sortBitScoreMenuItem_actionPerformed(e);
550       }
551     });
552   
553     JMenuItem removeRedundancyMenuItem = new JMenuItem(
554             MessageManager.getString("action.remove_redundancy"));
555     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_D,
556             Platform.SHORTCUT_KEY_MASK, false);
557     al = new ActionListener()
558     {
559       @Override
560       public void actionPerformed(ActionEvent e)
561       {
562         removeRedundancyMenuItem_actionPerformed(e);
563       }
564     };
565     addMenuActionAndAccelerator(keyStroke, removeRedundancyMenuItem, al);
566
567     JMenuItem filterByEValue = new JMenuItem(
568             MessageManager.getString("action.filter_by_evalue"));
569     filterByEValue.addActionListener(new ActionListener()
570     {
571       @Override
572       public void actionPerformed(ActionEvent e)
573       {
574         filterByEValue_actionPerformed();
575       }
576
577     });
578
579     JMenuItem filterByScore = new JMenuItem(
580             MessageManager.getString("action.filter_by_score"));
581     filterByScore.addActionListener(new ActionListener()
582     {
583       @Override
584       public void actionPerformed(ActionEvent e)
585       {
586         filterByScore_actionPerformed();
587       }
588
589     });
590   
591     JMenuItem pairwiseAlignmentMenuItem = new JMenuItem(
592             MessageManager.getString("action.pairwise_alignment"));
593     pairwiseAlignmentMenuItem.addActionListener(new ActionListener()
594     {
595       @Override
596       public void actionPerformed(ActionEvent e)
597       {
598         pairwiseAlignmentMenuItem_actionPerformed(e);
599       }
600     });
601   
602     this.getContentPane().setLayout(new BorderLayout());
603     alignFrameMenuBar.setFont(new java.awt.Font("Verdana", 0, 11));
604     statusBar.setBackground(Color.white);
605     statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
606     statusBar.setBorder(BorderFactory.createLineBorder(Color.black));
607     statusBar.setText(MessageManager.getString("label.status_bar"));
608
609     outputTextboxMenu
610             .setText(MessageManager.getString("label.out_to_textbox"));
611
612
613     annotationPanelMenuItem.setActionCommand("");
614     annotationPanelMenuItem
615             .setText(MessageManager.getString("label.show_annotations"));
616     annotationPanelMenuItem
617             .setState(Cache.getDefault("SHOW_ANNOTATIONS", true));
618     annotationPanelMenuItem.addActionListener(new ActionListener()
619     {
620       @Override
621       public void actionPerformed(ActionEvent e)
622       {
623         annotationPanelMenuItem_actionPerformed(e);
624       }
625     });
626     showAllAlAnnotations.setText(
627             MessageManager.getString("label.show_all_al_annotations"));
628     final boolean isAnnotationPanelShown = annotationPanelMenuItem
629             .getState();
630     showAllAlAnnotations.setEnabled(isAnnotationPanelShown);
631     showAllAlAnnotations.addActionListener(new ActionListener()
632     {
633       @Override
634       public void actionPerformed(ActionEvent e)
635       {
636         showAllAnnotations_actionPerformed(false, true);
637       }
638     });
639     hideAllAlAnnotations.setText(
640             MessageManager.getString("label.hide_all_al_annotations"));
641     hideAllAlAnnotations.setEnabled(isAnnotationPanelShown);
642     hideAllAlAnnotations.addActionListener(new ActionListener()
643     {
644       @Override
645       public void actionPerformed(ActionEvent e)
646       {
647         hideAllAnnotations_actionPerformed(false, true);
648       }
649     });
650     showAllSeqAnnotations.setText(
651             MessageManager.getString("label.show_all_seq_annotations"));
652     showAllSeqAnnotations.setEnabled(isAnnotationPanelShown);
653     showAllSeqAnnotations.addActionListener(new ActionListener()
654     {
655       @Override
656       public void actionPerformed(ActionEvent e)
657       {
658         showAllAnnotations_actionPerformed(true, false);
659       }
660     });
661     hideAllSeqAnnotations.setText(
662             MessageManager.getString("label.hide_all_seq_annotations"));
663     hideAllSeqAnnotations.setEnabled(isAnnotationPanelShown);
664     hideAllSeqAnnotations.addActionListener(new ActionListener()
665     {
666       @Override
667       public void actionPerformed(ActionEvent e)
668       {
669         hideAllAnnotations_actionPerformed(true, false);
670       }
671     });
672     SequenceAnnotationOrder sortAnnotationsBy = SequenceAnnotationOrder
673             .valueOf(Cache.getDefault(Preferences.SORT_ANNOTATIONS,
674                     SequenceAnnotationOrder.NONE.name()));
675     final JCheckBoxMenuItem sortAnnBySequence = new JCheckBoxMenuItem(
676             MessageManager.getString("label.sort_annotations_by_sequence"));
677     final JCheckBoxMenuItem sortAnnByLabel = new JCheckBoxMenuItem(
678             MessageManager.getString("label.sort_annotations_by_label"));
679
680
681     sortAnnBySequence.setSelected(
682             sortAnnotationsBy == SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
683     sortAnnBySequence.addActionListener(new ActionListener()
684     {
685       @Override
686       public void actionPerformed(ActionEvent e)
687       {
688         boolean newState = sortAnnBySequence.getState();
689         sortAnnByLabel.setSelected(false);
690         setAnnotationSortOrder(
691                 newState ? SequenceAnnotationOrder.SEQUENCE_AND_LABEL
692                         : SequenceAnnotationOrder.NONE);
693         sortAnnotations_actionPerformed();
694       }
695     });
696     sortAnnByLabel.setSelected(
697             sortAnnotationsBy == SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
698     sortAnnByLabel.addActionListener(new ActionListener()
699     {
700       @Override
701       public void actionPerformed(ActionEvent e)
702       {
703         boolean newState = sortAnnByLabel.getState();
704         sortAnnBySequence.setSelected(false);
705         setAnnotationSortOrder(
706                 newState ? SequenceAnnotationOrder.LABEL_AND_SEQUENCE
707                         : SequenceAnnotationOrder.NONE);
708         sortAnnotations_actionPerformed();
709       }
710     });
711     colourTextMenuItem = new JCheckBoxMenuItem(
712             MessageManager.getString("label.colour_text"));
713     colourTextMenuItem.addActionListener(new ActionListener()
714     {
715       @Override
716       public void actionPerformed(ActionEvent e)
717       {
718         colourTextMenuItem_actionPerformed(e);
719       }
720     });
721   
722     JMenuItem htmlMenuItem = new JMenuItem(
723             MessageManager.getString("label.html"));
724     htmlMenuItem.addActionListener(new ActionListener()
725     {
726       @Override
727       public void actionPerformed(ActionEvent e)
728       {
729         htmlMenuItem_actionPerformed(e);
730       }
731     });
732   
733     JMenuItem createBioJS = new JMenuItem(
734             MessageManager.getString("label.biojs_html_export"));
735     createBioJS.addActionListener(new java.awt.event.ActionListener()
736     {
737       @Override
738       public void actionPerformed(ActionEvent e)
739       {
740         bioJSMenuItem_actionPerformed(e);
741       }
742     });
743   
744     JMenuItem overviewMenuItem = new JMenuItem(
745             MessageManager.getString("label.overview_window"));
746     overviewMenuItem.addActionListener(new ActionListener()
747     {
748       @Override
749       public void actionPerformed(ActionEvent e)
750       {
751         overviewMenuItem_actionPerformed(e);
752       }
753     });
754   
755     undoMenuItem.setEnabled(false);
756     undoMenuItem.setText(MessageManager.getString("action.undo"));
757     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_Z,
758             Platform.SHORTCUT_KEY_MASK, false);
759     al = new ActionListener()
760     {
761       @Override
762       public void actionPerformed(ActionEvent e)
763       {
764         undoMenuItem_actionPerformed(e);
765       }
766     };
767     addMenuActionAndAccelerator(keyStroke, undoMenuItem, al);
768   
769     redoMenuItem.setEnabled(false);
770     redoMenuItem.setText(MessageManager.getString("action.redo"));
771     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_Y,
772             Platform.SHORTCUT_KEY_MASK, false);
773     al = new ActionListener()
774     {
775       @Override
776       public void actionPerformed(ActionEvent e)
777       {
778         redoMenuItem_actionPerformed(e);
779       }
780     };
781     addMenuActionAndAccelerator(keyStroke, redoMenuItem, al);
782   
783     wrapMenuItem.setText(MessageManager.getString("label.wrap"));
784     wrapMenuItem.addActionListener(new ActionListener()
785     {
786       @Override
787       public void actionPerformed(ActionEvent e)
788       {
789         wrapMenuItem_actionPerformed(e);
790       }
791     });
792   
793     JMenuItem printMenuItem = new JMenuItem(
794             MessageManager.getString("action.print"));
795     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_P,
796             Platform.SHORTCUT_KEY_MASK, false);
797     al = new ActionListener()
798     {
799       @Override
800       public void actionPerformed(ActionEvent e)
801       {
802         printMenuItem_actionPerformed(e);
803       }
804     };
805     addMenuActionAndAccelerator(keyStroke, printMenuItem, al);
806   
807     renderGapsMenuItem
808             .setText(MessageManager.getString("action.show_gaps"));
809     renderGapsMenuItem.setState(true);
810     renderGapsMenuItem.addActionListener(new ActionListener()
811     {
812       @Override
813       public void actionPerformed(ActionEvent e)
814       {
815         renderGapsMenuItem_actionPerformed(e);
816       }
817     });
818   
819     JMenuItem findMenuItem = new JMenuItem(
820             MessageManager.getString("action.find"));
821     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_F,
822             Platform.SHORTCUT_KEY_MASK, false);
823     findMenuItem.setToolTipText(JvSwingUtils.wrapTooltip(true,
824             MessageManager.getString("label.find_tip")));
825     al = new ActionListener()
826     {
827       @Override
828       public void actionPerformed(ActionEvent e)
829       {
830         findMenuItem_actionPerformed(e);
831       }
832     };
833     addMenuActionAndAccelerator(keyStroke, findMenuItem, al);
834
835     showSeqFeatures.setText(
836             MessageManager.getString("label.show_sequence_features"));
837
838     showSeqFeatures.addActionListener(new ActionListener()
839     {
840       @Override
841       public void actionPerformed(ActionEvent actionEvent)
842       {
843         showSeqFeatures_actionPerformed(actionEvent);
844       }
845     });
846     /*
847      * showSeqFeaturesHeight.setText("Vary Sequence Feature Height");
848      * showSeqFeaturesHeight.addActionListener(new ActionListener() { public
849      * void actionPerformed(ActionEvent actionEvent) {
850      * showSeqFeaturesHeight_actionPerformed(actionEvent); } });
851      */
852     showDbRefsMenuitem
853             .setText(MessageManager.getString("label.show_database_refs"));
854     showDbRefsMenuitem.addActionListener(new ActionListener()
855     {
856   
857       @Override
858       public void actionPerformed(ActionEvent e)
859       {
860         showDbRefs_actionPerformed(e);
861       }
862   
863     });
864     showNpFeatsMenuitem.setText(
865             MessageManager.getString("label.show_non_positional_features"));
866     showNpFeatsMenuitem.addActionListener(new ActionListener()
867     {
868   
869       @Override
870       public void actionPerformed(ActionEvent e)
871       {
872         showNpFeats_actionPerformed(e);
873       }
874   
875     });
876     showGroupConservation
877             .setText(MessageManager.getString("label.group_conservation"));
878     showGroupConservation.addActionListener(new ActionListener()
879     {
880   
881       @Override
882       public void actionPerformed(ActionEvent e)
883       {
884         showGroupConservation_actionPerformed(e);
885       }
886   
887     });
888
889     showGroupConsensus
890             .setText(MessageManager.getString("label.group_consensus"));
891     showGroupConsensus.addActionListener(new ActionListener()
892     {
893   
894       @Override
895       public void actionPerformed(ActionEvent e)
896       {
897         showGroupConsensus_actionPerformed(e);
898       }
899   
900     });
901     showConsensusHistogram.setText(
902             MessageManager.getString("label.show_consensus_histogram"));
903     showConsensusHistogram.addActionListener(new ActionListener()
904     {
905   
906       @Override
907       public void actionPerformed(ActionEvent e)
908       {
909         showConsensusHistogram_actionPerformed(e);
910       }
911   
912     });
913     showSequenceLogo
914             .setText(MessageManager.getString("label.show_consensus_logo"));
915     showSequenceLogo.addActionListener(new ActionListener()
916     {
917   
918       @Override
919       public void actionPerformed(ActionEvent e)
920       {
921         showSequenceLogo_actionPerformed(e);
922       }
923   
924     });
925     normaliseSequenceLogo
926             .setText(MessageManager.getString("label.norm_consensus_logo"));
927     normaliseSequenceLogo.addActionListener(new ActionListener()
928     {
929   
930       @Override
931       public void actionPerformed(ActionEvent e)
932       {
933         normaliseSequenceLogo_actionPerformed(e);
934       }
935   
936     });
937     applyAutoAnnotationSettings
938             .setText(MessageManager.getString("label.apply_all_groups"));
939     applyAutoAnnotationSettings.setState(false);
940     applyAutoAnnotationSettings.setVisible(true);
941     applyAutoAnnotationSettings.addActionListener(new ActionListener()
942     {
943       @Override
944       public void actionPerformed(ActionEvent e)
945       {
946         applyAutoAnnotationSettings_actionPerformed(e);
947       }
948     });
949   
950     ButtonGroup buttonGroup = new ButtonGroup();
951     final JRadioButtonMenuItem showAutoFirst = new JRadioButtonMenuItem(
952             MessageManager.getString("label.show_first"));
953     final JRadioButtonMenuItem showAutoLast = new JRadioButtonMenuItem(
954             MessageManager.getString("label.show_last"));
955     buttonGroup.add(showAutoFirst);
956     buttonGroup.add(showAutoLast);
957     final boolean autoFirst = Cache
958             .getDefault(Preferences.SHOW_AUTOCALC_ABOVE, false);
959     showAutoFirst.setSelected(autoFirst);
960     setShowAutoCalculatedAbove(autoFirst);
961     showAutoFirst.addActionListener(new ActionListener()
962     {
963       @Override
964       public void actionPerformed(ActionEvent e)
965       {
966         setShowAutoCalculatedAbove(showAutoFirst.isSelected());
967         sortAnnotations_actionPerformed();
968       }
969     });
970     showAutoLast.setSelected(!showAutoFirst.isSelected());
971     showAutoLast.addActionListener(new ActionListener()
972     {
973       @Override
974       public void actionPerformed(ActionEvent e)
975       {
976         setShowAutoCalculatedAbove(!showAutoLast.isSelected());
977         sortAnnotations_actionPerformed();
978       }
979     });
980   
981     JMenuItem deleteGroups = new JMenuItem(
982             MessageManager.getString("action.undefine_groups"));
983     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_U,
984             Platform.SHORTCUT_KEY_MASK, false);
985     al = new ActionListener()
986     {
987       @Override
988       public void actionPerformed(ActionEvent e)
989       {
990         deleteGroups_actionPerformed(e);
991       }
992     };
993     addMenuActionAndAccelerator(keyStroke, deleteGroups, al);
994   
995     JMenuItem annotationColumn = new JMenuItem(
996             MessageManager.getString("action.select_by_annotation"));
997     annotationColumn.addActionListener(new ActionListener()
998     {
999       @Override
1000       public void actionPerformed(ActionEvent e)
1001       {
1002         annotationColumn_actionPerformed(e);
1003       }
1004     });
1005   
1006     JMenuItem createGroup = new JMenuItem(
1007             MessageManager.getString("action.create_group"));
1008     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G,
1009             Platform.SHORTCUT_KEY_MASK, false);
1010     al = new ActionListener()
1011     {
1012       @Override
1013       public void actionPerformed(ActionEvent e)
1014       {
1015         createGroup_actionPerformed(e);
1016       }
1017     };
1018     addMenuActionAndAccelerator(keyStroke, createGroup, al);
1019   
1020     JMenuItem unGroup = new JMenuItem(
1021             MessageManager.getString("action.remove_group"));
1022     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G,
1023             Platform.SHORTCUT_KEY_MASK
1024                     | InputEvent.SHIFT_DOWN_MASK,
1025             false);
1026     al = new ActionListener()
1027     {
1028       @Override
1029       public void actionPerformed(ActionEvent e)
1030       {
1031         unGroup_actionPerformed(e);
1032       }
1033     };
1034     addMenuActionAndAccelerator(keyStroke, unGroup, al);
1035   
1036     copy.setText(MessageManager.getString("action.copy"));
1037     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_C,
1038             Platform.SHORTCUT_KEY_MASK, false);
1039
1040     al = new ActionListener()
1041     {
1042       @Override
1043       public void actionPerformed(ActionEvent e)
1044       {
1045         copy_actionPerformed();
1046       }
1047     };
1048     addMenuActionAndAccelerator(keyStroke, copy, al);
1049   
1050     cut.setText(MessageManager.getString("action.cut"));
1051     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_X,
1052             Platform.SHORTCUT_KEY_MASK, false);
1053     al = new ActionListener()
1054     {
1055       @Override
1056       public void actionPerformed(ActionEvent e)
1057       {
1058         cut_actionPerformed();
1059       }
1060     };
1061     addMenuActionAndAccelerator(keyStroke, cut, al);
1062   
1063     JMenuItem delete = new JMenuItem(
1064             MessageManager.getString("action.delete"));
1065     delete.addActionListener(new ActionListener()
1066     {
1067       @Override
1068       public void actionPerformed(ActionEvent e)
1069       {
1070         delete_actionPerformed();
1071       }
1072     });
1073   
1074     pasteMenu.setText(MessageManager.getString("action.paste"));
1075     JMenuItem pasteNew = new JMenuItem(
1076             MessageManager.getString("label.to_new_alignment"));
1077     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_V,
1078             Platform.SHORTCUT_KEY_MASK
1079                     | InputEvent.SHIFT_DOWN_MASK,
1080             false);
1081     al = new ActionListener()
1082     {
1083       @Override
1084       public void actionPerformed(ActionEvent e)
1085       {
1086         try
1087         {
1088           pasteNew_actionPerformed(e);
1089         } catch (IOException | InterruptedException e1)
1090         {
1091           // TODO Auto-generated catch block
1092           e1.printStackTrace();
1093         }
1094       }
1095     };
1096     addMenuActionAndAccelerator(keyStroke, pasteNew, al);
1097   
1098     JMenuItem pasteThis = new JMenuItem(
1099             MessageManager.getString("label.to_this_alignment"));
1100     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_V,
1101             Platform.SHORTCUT_KEY_MASK, false);
1102     al = new ActionListener()
1103     {
1104       @Override
1105       public void actionPerformed(ActionEvent e)
1106       {
1107         try
1108         {
1109           pasteThis_actionPerformed(e);
1110         } catch (IOException | InterruptedException e1)
1111         {
1112           // TODO Auto-generated catch block
1113           e1.printStackTrace();
1114         }
1115       }
1116     };
1117     addMenuActionAndAccelerator(keyStroke, pasteThis, al);
1118   
1119     JMenuItem createPNG = new JMenuItem("PNG");
1120     createPNG.addActionListener(new ActionListener()
1121     {
1122       @Override
1123       public void actionPerformed(ActionEvent e)
1124       {
1125         createPNG(null);
1126       }
1127     });
1128     createPNG.setActionCommand(
1129             MessageManager.getString("label.save_png_image"));
1130     JMenuItem font = new JMenuItem(MessageManager.getString("action.font"));
1131     font.addActionListener(new ActionListener()
1132     {
1133       @Override
1134       public void actionPerformed(ActionEvent e)
1135       {
1136         font_actionPerformed(e);
1137       }
1138     });
1139     seqLimits.setText(
1140             MessageManager.getString("label.show_sequence_limits"));
1141     seqLimits.setState(jalview.bin.Cache.getDefault("SHOW_JVSUFFIX", true));
1142     seqLimits.addActionListener(new ActionListener()
1143     {
1144       @Override
1145       public void actionPerformed(ActionEvent e)
1146       {
1147         seqLimit_actionPerformed(e);
1148       }
1149     });
1150     JMenuItem epsFile = new JMenuItem("EPS");
1151     epsFile.addActionListener(new ActionListener()
1152     {
1153       @Override
1154       public void actionPerformed(ActionEvent e)
1155       {
1156         createEPS(null);
1157       }
1158     });
1159   
1160     JMenuItem createSVG = new JMenuItem("SVG");
1161     createSVG.addActionListener(new ActionListener()
1162     {
1163       @Override
1164       public void actionPerformed(ActionEvent e)
1165       {
1166         createSVG(null);
1167       }
1168     });
1169   
1170     JMenuItem loadTreeMenuItem = new JMenuItem(
1171             MessageManager.getString("label.load_associated_tree"));
1172     loadTreeMenuItem.setActionCommand(
1173             MessageManager.getString("label.load_tree_for_sequence_set"));
1174     loadTreeMenuItem.addActionListener(new ActionListener()
1175     {
1176       @Override
1177       public void actionPerformed(ActionEvent e)
1178       {
1179         loadTreeMenuItem_actionPerformed(e);
1180       }
1181     });
1182   
1183     scaleAbove.setVisible(false);
1184     scaleAbove.setText(MessageManager.getString("action.scale_above"));
1185     scaleAbove.addActionListener(new ActionListener()
1186     {
1187       @Override
1188       public void actionPerformed(ActionEvent e)
1189       {
1190         scaleAbove_actionPerformed(e);
1191       }
1192     });
1193     scaleLeft.setVisible(false);
1194     scaleLeft.setSelected(true);
1195     scaleLeft.setText(MessageManager.getString("action.scale_left"));
1196     scaleLeft.addActionListener(new ActionListener()
1197     {
1198       @Override
1199       public void actionPerformed(ActionEvent e)
1200       {
1201         scaleLeft_actionPerformed(e);
1202       }
1203     });
1204     scaleRight.setVisible(false);
1205     scaleRight.setSelected(true);
1206     scaleRight.setText(MessageManager.getString("action.scale_right"));
1207     scaleRight.addActionListener(new ActionListener()
1208     {
1209       @Override
1210       public void actionPerformed(ActionEvent e)
1211       {
1212         scaleRight_actionPerformed(e);
1213       }
1214     });
1215     centreColumnLabelsMenuItem.setVisible(true);
1216     centreColumnLabelsMenuItem.setState(false);
1217     centreColumnLabelsMenuItem.setText(
1218             MessageManager.getString("label.centre_column_labels"));
1219     centreColumnLabelsMenuItem.addActionListener(new ActionListener()
1220     {
1221       @Override
1222       public void actionPerformed(ActionEvent e)
1223       {
1224         centreColumnLabels_actionPerformed(e);
1225       }
1226     });
1227     followHighlightMenuItem.setVisible(true);
1228     followHighlightMenuItem.setState(true);
1229     followHighlightMenuItem
1230             .setText(MessageManager.getString("label.automatic_scrolling"));
1231     followHighlightMenuItem.addActionListener(new ActionListener()
1232     {
1233   
1234       @Override
1235       public void actionPerformed(ActionEvent e)
1236       {
1237         followHighlight_actionPerformed();
1238       }
1239   
1240     });
1241   
1242     sortByTreeMenu
1243             .setText(MessageManager.getString("action.by_tree_order"));
1244     sort.setText(MessageManager.getString("action.sort"));
1245     sort.addMenuListener(new MenuListener()
1246     {
1247       @Override
1248       public void menuSelected(MenuEvent e)
1249       {
1250         enableSortMenuOptions();
1251       }
1252
1253       @Override
1254       public void menuDeselected(MenuEvent e)
1255       {
1256       }
1257
1258       @Override
1259       public void menuCanceled(MenuEvent e)
1260       {
1261       }
1262     });
1263     sortByTreeMenu.addMenuListener(new MenuListener()
1264     {
1265       @Override
1266       public void menuSelected(MenuEvent e)
1267       {
1268         buildTreeSortMenu();
1269       }
1270   
1271       @Override
1272       public void menuDeselected(MenuEvent e)
1273       {
1274       }
1275   
1276       @Override
1277       public void menuCanceled(MenuEvent e)
1278       {
1279       }
1280     });
1281     sortByAnnotScore
1282             .setText(MessageManager.getString("label.sort_by_score"));
1283     sort.add(sortByAnnotScore);
1284     sort.addMenuListener(new javax.swing.event.MenuListener()
1285     {
1286   
1287       @Override
1288       public void menuCanceled(MenuEvent e)
1289       {
1290       }
1291   
1292       @Override
1293       public void menuDeselected(MenuEvent e)
1294       {
1295       }
1296   
1297       @Override
1298       public void menuSelected(MenuEvent e)
1299       {
1300         buildSortByAnnotationScoresMenu();
1301       }
1302     });
1303     sortByAnnotScore.setVisible(false);
1304
1305     calculateTree
1306             .setText(MessageManager.getString("action.calculate_tree_pca"));
1307
1308     padGapsMenuitem.setText(MessageManager.getString("label.pad_gaps"));
1309     padGapsMenuitem
1310             .setState(jalview.bin.Cache.getDefault("PAD_GAPS", false));
1311     padGapsMenuitem.addActionListener(new ActionListener()
1312     {
1313       @Override
1314       public void actionPerformed(ActionEvent e)
1315       {
1316         padGapsMenuitem_actionPerformed(e);
1317       }
1318     });
1319     JMenuItem vamsasStore = new JMenuItem(
1320             MessageManager.getString("label.vamsas_store"));
1321     vamsasStore.setVisible(false);
1322     vamsasStore.addActionListener(new ActionListener()
1323     {
1324       @Override
1325       public void actionPerformed(ActionEvent e)
1326       {
1327         vamsasStore_actionPerformed(e);
1328       }
1329     });
1330
1331     /*
1332      * Translate as cDNA with sub-menu of translation tables
1333      */
1334     showTranslation
1335             .setText(MessageManager.getString("label.translate_cDNA"));
1336     boolean first = true;
1337     for (final GeneticCodeI table : GeneticCodes.getInstance()
1338             .getCodeTables())
1339     {
1340       JMenuItem item = new JMenuItem(table.getId() + " " + table.getName());
1341       showTranslation.add(item);
1342       item.addActionListener(new ActionListener()
1343       {
1344         @Override
1345         public void actionPerformed(ActionEvent e)
1346         {
1347           showTranslation_actionPerformed(table);
1348         }
1349       });
1350       if (first)
1351       {
1352         showTranslation.addSeparator();
1353       }
1354       first = false;
1355     }
1356
1357     showReverse.setText(MessageManager.getString("label.reverse"));
1358     showReverse.addActionListener(new ActionListener()
1359     {
1360       @Override
1361       public void actionPerformed(ActionEvent e)
1362       {
1363         showReverse_actionPerformed(false);
1364       }
1365     });
1366     showReverseComplement
1367             .setText(MessageManager.getString("label.reverse_complement"));
1368     showReverseComplement.addActionListener(new ActionListener()
1369     {
1370       @Override
1371       public void actionPerformed(ActionEvent e)
1372       {
1373         showReverse_actionPerformed(true);
1374       }
1375     });
1376   
1377     JMenuItem extractScores = new JMenuItem(
1378             MessageManager.getString("label.extract_scores"));
1379     extractScores.addActionListener(new ActionListener()
1380     {
1381       @Override
1382       public void actionPerformed(ActionEvent e)
1383       {
1384         extractScores_actionPerformed(e);
1385       }
1386     });
1387     extractScores.setVisible(true);
1388     // JBPNote: TODO: make gui for regex based score extraction
1389   
1390     // for show products actions see AlignFrame.canShowProducts
1391     showProducts.setText(MessageManager.getString("label.get_cross_refs"));
1392   
1393     runGroovy.setText(MessageManager.getString("label.run_groovy"));
1394     runGroovy.setToolTipText(
1395             MessageManager.getString("label.run_groovy_tip"));
1396     runGroovy.addActionListener(new ActionListener()
1397     {
1398       @Override
1399       public void actionPerformed(ActionEvent e)
1400       {
1401         runGroovy_actionPerformed();
1402       }
1403     });
1404
1405     openFeatureSettings = new JMenuItem(
1406             MessageManager.getString("action.feature_settings"));
1407     openFeatureSettings.addActionListener(new ActionListener()
1408     {
1409       @Override
1410       public void actionPerformed(ActionEvent e)
1411       {
1412         featureSettings_actionPerformed(e);
1413       }
1414     });
1415
1416     /*
1417      * add sub-menu of database we can fetch from
1418      */
1419     JMenuItem fetchSequence = new JMenuItem(
1420             MessageManager.getString("label.fetch_sequences"));
1421     fetchSequence.addActionListener(new ActionListener()
1422     {
1423       @Override
1424       public void actionPerformed(ActionEvent e)
1425       {
1426         fetchSequence_actionPerformed();
1427       }
1428     });
1429   
1430     JMenuItem associatedData = new JMenuItem(
1431             MessageManager.getString("label.load_features_annotations"));
1432     associatedData.addActionListener(new ActionListener()
1433     {
1434       @Override
1435       public void actionPerformed(ActionEvent e)
1436       {
1437         try
1438         {
1439           associatedData_actionPerformed(e);
1440         } catch (IOException | InterruptedException e1)
1441         {
1442           // TODO Auto-generated catch block
1443           e1.printStackTrace();
1444         }
1445       }
1446     });
1447     loadVcf = new JMenuItem(
1448             MessageManager.getString("label.load_vcf_file"));
1449     loadVcf.setToolTipText(MessageManager.getString("label.load_vcf"));
1450     loadVcf.addActionListener(new ActionListener()
1451     {
1452       @Override
1453       public void actionPerformed(ActionEvent e)
1454       {
1455         loadVcf_actionPerformed();
1456       }
1457     });
1458     autoCalculate.setText(
1459             MessageManager.getString("label.autocalculate_consensus"));
1460     autoCalculate.setState(
1461             jalview.bin.Cache.getDefault("AUTO_CALC_CONSENSUS", true));
1462     autoCalculate.addActionListener(new ActionListener()
1463     {
1464       @Override
1465       public void actionPerformed(ActionEvent e)
1466       {
1467         autoCalculate_actionPerformed(e);
1468       }
1469     });
1470     sortByTree.setText(
1471             MessageManager.getString("label.sort_alignment_new_tree"));
1472     sortByTree.setToolTipText("<html>" + MessageManager.getString(
1473             "label.enable_automatically_sort_alignment_when_open_new_tree"));
1474     sortByTree
1475             .setState(jalview.bin.Cache.getDefault("SORT_BY_TREE", false));
1476     sortByTree.addActionListener(new ActionListener()
1477     {
1478       @Override
1479       public void actionPerformed(ActionEvent e)
1480       {
1481         sortByTreeOption_actionPerformed(e);
1482       }
1483     });
1484
1485     listenToViewSelections.setText(
1486             MessageManager.getString("label.listen_for_selections"));
1487     listenToViewSelections
1488             .setToolTipText("<html>" + MessageManager.getString(
1489                     "label.selections_mirror_selections_made_same_sequences_other_views"));
1490     listenToViewSelections.setState(false);
1491     listenToViewSelections.addActionListener(new ActionListener()
1492     {
1493       @Override
1494       public void actionPerformed(ActionEvent e)
1495       {
1496         listenToViewSelections_actionPerformed(e);
1497       }
1498     });
1499   
1500     JMenu addSequenceMenu = new JMenu(
1501             MessageManager.getString("label.add_sequences"));
1502     JMenuItem addFromFile = new JMenuItem(
1503             MessageManager.getString("label.from_file"));
1504     addFromFile.addActionListener(new ActionListener()
1505     {
1506       @Override
1507       public void actionPerformed(ActionEvent e)
1508       {
1509         addFromFile_actionPerformed(e);
1510       }
1511     });
1512     JMenuItem addFromText = new JMenuItem(
1513             MessageManager.getString("label.from_textbox"));
1514     addFromText.addActionListener(new ActionListener()
1515     {
1516       @Override
1517       public void actionPerformed(ActionEvent e)
1518       {
1519         addFromText_actionPerformed(e);
1520       }
1521     });
1522     JMenuItem addFromURL = new JMenuItem(
1523             MessageManager.getString("label.from_url"));
1524     addFromURL.addActionListener(new ActionListener()
1525     {
1526       @Override
1527       public void actionPerformed(ActionEvent e)
1528       {
1529         addFromURL_actionPerformed(e);
1530       }
1531     });
1532     JMenuItem exportFeatures = new JMenuItem(
1533             MessageManager.getString("label.export_features"));
1534     exportFeatures.addActionListener(new ActionListener()
1535     {
1536       @Override
1537       public void actionPerformed(ActionEvent e)
1538       {
1539         exportFeatures_actionPerformed(e);
1540       }
1541     });
1542     JMenuItem exportAnnotations = new JMenuItem(
1543             MessageManager.getString("label.export_annotations"));
1544     exportAnnotations.addActionListener(new ActionListener()
1545     {
1546       @Override
1547       public void actionPerformed(ActionEvent e)
1548       {
1549         exportAnnotations_actionPerformed(e);
1550       }
1551     });
1552     statusPanel.setLayout(new GridLayout());
1553     JMenuItem showAllSeqs = new JMenuItem(
1554             MessageManager.getString("label.all_sequences"));
1555     showAllSeqs.setToolTipText(
1556             MessageManager.getString("label.toggle_sequence_visibility"));
1557     showAllSeqs.addActionListener(new ActionListener()
1558     {
1559       @Override
1560       public void actionPerformed(ActionEvent e)
1561       {
1562         showAllSeqs_actionPerformed(e);
1563       }
1564     });
1565     JMenuItem showAllColumns = new JMenuItem(
1566             MessageManager.getString("label.all_columns"));
1567     showAllColumns.setToolTipText(
1568             MessageManager.getString("label.toggle_columns_visibility"));
1569     showAllColumns.addActionListener(new ActionListener()
1570     {
1571       @Override
1572       public void actionPerformed(ActionEvent e)
1573       {
1574         showAllColumns_actionPerformed(e);
1575       }
1576     });
1577     JMenu hideMenu = new JMenu(MessageManager.getString("action.hide"));
1578     JMenuItem hideSelSequences = new JMenuItem(
1579             MessageManager.getString("label.selected_sequences"));
1580     hideSelSequences.setToolTipText(
1581             MessageManager.getString("label.toggle_sequence_visibility"));
1582     hideSelSequences.addActionListener(new ActionListener()
1583     {
1584       @Override
1585       public void actionPerformed(ActionEvent e)
1586       {
1587         hideSelSequences_actionPerformed(e);
1588       }
1589     });
1590     JMenuItem hideSelColumns = new JMenuItem(
1591             MessageManager.getString("label.selected_columns"));
1592     hideSelColumns.setToolTipText(
1593             MessageManager.getString("label.toggle_columns_visibility"));
1594     hideSelColumns.addActionListener(new ActionListener()
1595     {
1596       @Override
1597       public void actionPerformed(ActionEvent e)
1598       {
1599         hideSelColumns_actionPerformed(e);
1600       }
1601     });
1602     JMenuItem hideAllSelection = new JMenuItem(
1603             MessageManager.getString("label.selected_region"));
1604     hideAllSelection.addActionListener(new ActionListener()
1605     {
1606       @Override
1607       public void actionPerformed(ActionEvent e)
1608       {
1609         hideAllSelection_actionPerformed(e);
1610       }
1611     });
1612     // TODO: should be hidden if no selection exists.
1613     JMenuItem hideAllButSelection = new JMenuItem(
1614             MessageManager.getString("label.all_but_selected_region"));
1615     hideAllButSelection.addActionListener(new ActionListener()
1616     {
1617       @Override
1618       public void actionPerformed(ActionEvent e)
1619       {
1620         hideAllButSelection_actionPerformed(e);
1621       }
1622     });
1623     JMenuItem showAllhidden = new JMenuItem(
1624             MessageManager.getString("label.all_sequences_columns"));
1625     showAllhidden.setToolTipText(MessageManager
1626             .getString("label.toggles_visibility_hidden_selected_regions"));
1627     showAllhidden.addActionListener(new ActionListener()
1628     {
1629       @Override
1630       public void actionPerformed(ActionEvent e)
1631       {
1632         showAllhidden_actionPerformed(e);
1633       }
1634     });
1635     hiddenMarkers.setText(
1636             MessageManager.getString("action.show_hidden_markers"));
1637     hiddenMarkers.addActionListener(new ActionListener()
1638     {
1639       @Override
1640       public void actionPerformed(ActionEvent e)
1641       {
1642         hiddenMarkers_actionPerformed(e);
1643       }
1644     });
1645   
1646     JMenuItem invertColSel = new JMenuItem(
1647             MessageManager.getString("action.invert_column_selection"));
1648     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I,
1649             Platform.SHORTCUT_KEY_MASK
1650                     | InputEvent.ALT_DOWN_MASK,
1651             false);
1652     al = new ActionListener()
1653     {
1654       @Override
1655       public void actionPerformed(ActionEvent e)
1656       {
1657         invertColSel_actionPerformed(e);
1658       }
1659     };
1660     addMenuActionAndAccelerator(keyStroke, invertColSel, al);
1661   
1662     showComplementMenuItem.setVisible(false);
1663     showComplementMenuItem.addActionListener(new ActionListener()
1664     {
1665       @Override
1666       public void actionPerformed(ActionEvent e)
1667       {
1668         showComplement_actionPerformed(showComplementMenuItem.getState());
1669       }
1670     });
1671   
1672     tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()
1673     {
1674       @Override
1675       public void stateChanged(ChangeEvent evt)
1676       {
1677         JTabbedPane pane = (JTabbedPane) evt.getSource();
1678         int sel = pane.getSelectedIndex();
1679         tabSelectionChanged(sel);
1680       }
1681     });
1682     tabbedPane.addMouseListener(new MouseAdapter()
1683     {
1684       @Override
1685       public void mousePressed(MouseEvent e)
1686       {
1687         if (e.isPopupTrigger()) // Mac
1688         {
1689           tabbedPane_mousePressed(e);
1690         }
1691       }
1692   
1693       @Override
1694       public void mouseReleased(MouseEvent e)
1695       {
1696         if (e.isPopupTrigger()) // Windows
1697         {
1698           tabbedPane_mousePressed(e);
1699         }
1700       }
1701     });
1702     tabbedPane.addFocusListener(new FocusAdapter()
1703     {
1704       @Override
1705       public void focusGained(FocusEvent e)
1706       {
1707         tabbedPane_focusGained(e);
1708       }
1709     });
1710   
1711     JMenuItem save = new JMenuItem(MessageManager.getString("action.save"));
1712     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S,
1713             Platform.SHORTCUT_KEY_MASK, false);
1714     al = new ActionListener()
1715     {
1716       @Override
1717       public void actionPerformed(ActionEvent e)
1718       {
1719         save_actionPerformed(e);
1720       }
1721     };
1722     addMenuActionAndAccelerator(keyStroke, save, al);
1723   
1724     reload.setEnabled(false);
1725     reload.setText(MessageManager.getString("action.reload"));
1726     reload.addActionListener(new ActionListener()
1727     {
1728       @Override
1729       public void actionPerformed(ActionEvent e)
1730       {
1731         reload_actionPerformed(e);
1732       }
1733     });
1734   
1735     JMenuItem newView = new JMenuItem(
1736             MessageManager.getString("action.new_view"));
1737     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_T,
1738             Platform.SHORTCUT_KEY_MASK, false);
1739     al = new ActionListener()
1740     {
1741       @Override
1742       public void actionPerformed(ActionEvent e)
1743       {
1744         newView_actionPerformed(e);
1745       }
1746     };
1747     addMenuActionAndAccelerator(keyStroke, newView, al);
1748   
1749     tabbedPane.setToolTipText("<html><i>"
1750             + MessageManager.getString("label.rename_tab_eXpand_reGroup")
1751             + "</i></html>");
1752   
1753     formatMenu.setText(MessageManager.getString("action.format"));
1754     JMenu selectMenu = new JMenu(MessageManager.getString("action.select"));
1755
1756     idRightAlign.setText(
1757             MessageManager.getString("label.right_align_sequence_id"));
1758     idRightAlign.addActionListener(new ActionListener()
1759     {
1760       @Override
1761       public void actionPerformed(ActionEvent e)
1762       {
1763         idRightAlign_actionPerformed(e);
1764       }
1765     });
1766   
1767     gatherViews.setEnabled(false);
1768     gatherViews.setText(MessageManager.getString("action.gather_views"));
1769     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, 0, false);
1770     al = new ActionListener()
1771     {
1772       @Override
1773       public void actionPerformed(ActionEvent e)
1774       {
1775         gatherViews_actionPerformed(e);
1776       }
1777     };
1778     addMenuActionAndAccelerator(keyStroke, gatherViews, al);
1779   
1780     expandViews.setEnabled(false);
1781     expandViews.setText(MessageManager.getString("action.expand_views"));
1782     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_X, 0, false);
1783     al = new ActionListener()
1784     {
1785       @Override
1786       public void actionPerformed(ActionEvent e)
1787       {
1788         expandViews_actionPerformed(e);
1789       }
1790     };
1791     addMenuActionAndAccelerator(keyStroke, expandViews, al);
1792   
1793     JMenuItem pageSetup = new JMenuItem(
1794             MessageManager.getString("action.page_setup"));
1795     pageSetup.addActionListener(new ActionListener()
1796     {
1797       @Override
1798       public void actionPerformed(ActionEvent e)
1799       {
1800         pageSetup_actionPerformed(e);
1801       }
1802     });
1803     JMenuItem alignmentProperties = new JMenuItem(
1804             MessageManager.getString("label.alignment_props"));
1805     alignmentProperties.addActionListener(new ActionListener()
1806     {
1807       @Override
1808       public void actionPerformed(ActionEvent actionEvent)
1809       {
1810         alignmentProperties();
1811       }
1812     });
1813     JMenuItem selectHighlighted = new JMenuItem(
1814             MessageManager.getString("action.select_highlighted_columns"));
1815     selectHighlighted.setToolTipText(JvSwingUtils.wrapTooltip(true, 
1816             MessageManager.getString("tooltip.select_highlighted_columns")));
1817     al = new ActionListener()
1818     {
1819       @Override
1820       public void actionPerformed(ActionEvent actionEvent)
1821       {
1822         selectHighlightedColumns_actionPerformed(actionEvent);
1823       }
1824     };
1825     JMenuItem Filter = new JMenuItem(
1826             MessageManager.getString("action.select_highlighted_columns"));
1827     selectHighlighted.setToolTipText(
1828             MessageManager.getString("tooltip.select_highlighted_columns"));
1829     al = new ActionListener()
1830     {
1831       @Override
1832       public void actionPerformed(ActionEvent actionEvent)
1833       {
1834         selectHighlightedColumns_actionPerformed(actionEvent);
1835       }
1836     };
1837     selectHighlighted.addActionListener(al);
1838     JMenu tooltipSettingsMenu = new JMenu(
1839             MessageManager.getString("label.sequence_id_tooltip"));
1840     JMenu autoAnnMenu = new JMenu(
1841             MessageManager.getString("label.autocalculated_annotation"));
1842   
1843     JMenu exportImageMenu = new JMenu(
1844             MessageManager.getString("label.export_image"));
1845     JMenu fileMenu = new JMenu(MessageManager.getString("action.file"));
1846     alignFrameMenuBar.add(fileMenu);
1847     alignFrameMenuBar.add(editMenu);
1848     alignFrameMenuBar.add(selectMenu);
1849     alignFrameMenuBar.add(viewMenu);
1850     alignFrameMenuBar.add(annotationsMenu);
1851     alignFrameMenuBar.add(formatMenu);
1852     alignFrameMenuBar.add(colourMenu);
1853     alignFrameMenuBar.add(calculateMenu);
1854     alignFrameMenuBar.add(webService);
1855     if (!Platform.isJS())
1856     {
1857       alignFrameMenuBar.add(hmmerMenu);
1858     }
1859   
1860     fileMenu.add(fetchSequence);
1861     fileMenu.add(addSequenceMenu);
1862     fileMenu.add(reload);
1863     fileMenu.addSeparator();
1864     fileMenu.add(vamsasStore);
1865     fileMenu.add(save);
1866     fileMenu.add(saveAs);
1867     fileMenu.add(outputTextboxMenu);
1868     fileMenu.add(pageSetup);
1869     fileMenu.add(printMenuItem);
1870     fileMenu.addSeparator();
1871     fileMenu.add(exportImageMenu);
1872     fileMenu.add(exportFeatures);
1873     fileMenu.add(exportAnnotations);
1874     fileMenu.add(loadTreeMenuItem);
1875     fileMenu.add(associatedData);
1876     if (!Platform.isJS())
1877     {
1878       fileMenu.add(loadVcf);
1879     }
1880     fileMenu.addSeparator();
1881     fileMenu.add(closeMenuItem);
1882   
1883     pasteMenu.add(pasteNew);
1884     pasteMenu.add(pasteThis);
1885     editMenu.add(undoMenuItem);
1886     editMenu.add(redoMenuItem);
1887     editMenu.add(cut);
1888     editMenu.add(copy);
1889     editMenu.add(pasteMenu);
1890     editMenu.add(delete);
1891     editMenu.addSeparator();
1892     editMenu.add(remove2LeftMenuItem);
1893     editMenu.add(remove2RightMenuItem);
1894     editMenu.add(removeGappedColumnMenuItem);
1895     editMenu.add(removeAllGapsMenuItem);
1896     editMenu.add(removeRedundancyMenuItem);
1897     editMenu.addSeparator();
1898     // dont add these yet in the CVS build - they cannot be undone!
1899     // Excluded from Jalview 2.5 release - undo needs to be implemented.
1900     // editMenu.add(justifyLeftMenuItem);
1901     // editMenu.add(justifyRightMenuItem);
1902     // editMenu.addSeparator();
1903     editMenu.add(padGapsMenuitem);
1904     editMenu.addSeparator();
1905     editMenu.add(filterByEValue);
1906     editMenu.add(filterByScore);
1907   
1908     showMenu.add(showAllColumns);
1909     showMenu.add(showAllSeqs);
1910     showMenu.add(showAllhidden);
1911     hideMenu.add(hideSelColumns);
1912     hideMenu.add(hideSelSequences);
1913     hideMenu.add(hideAllSelection);
1914     hideMenu.add(hideAllButSelection);
1915     viewMenu.add(newView);
1916     viewMenu.add(expandViews);
1917     viewMenu.add(gatherViews);
1918     viewMenu.addSeparator();
1919     viewMenu.add(showMenu);
1920     viewMenu.add(hideMenu);
1921     viewMenu.add(showComplementMenuItem);
1922     viewMenu.addSeparator();
1923     viewMenu.add(followHighlightMenuItem);
1924     viewMenu.addSeparator();
1925     viewMenu.add(showSeqFeatures);
1926     // viewMenu.add(showSeqFeaturesHeight);
1927     viewMenu.add(openFeatureSettings);
1928     tooltipSettingsMenu.add(showDbRefsMenuitem);
1929     tooltipSettingsMenu.add(showNpFeatsMenuitem);
1930     viewMenu.add(tooltipSettingsMenu);
1931     viewMenu.addSeparator();
1932     viewMenu.add(alignmentProperties);
1933     viewMenu.addSeparator();
1934     viewMenu.add(overviewMenuItem);
1935   
1936     annotationsMenu.add(annotationPanelMenuItem);
1937     annotationsMenu.addSeparator();
1938     annotationsMenu.add(showAllAlAnnotations);
1939     annotationsMenu.add(hideAllAlAnnotations);
1940     annotationsMenu.addSeparator();
1941     annotationsMenu.add(showAllSeqAnnotations);
1942     annotationsMenu.add(hideAllSeqAnnotations);
1943     annotationsMenu.add(sortAnnBySequence);
1944     annotationsMenu.add(sortAnnByLabel);
1945     annotationsMenu.addSeparator();
1946     autoAnnMenu.add(showAutoFirst);
1947     autoAnnMenu.add(showAutoLast);
1948     autoAnnMenu.addSeparator();
1949     autoAnnMenu.add(applyAutoAnnotationSettings);
1950     autoAnnMenu.add(showConsensusHistogram);
1951     autoAnnMenu.add(showSequenceLogo);
1952     autoAnnMenu.add(normaliseSequenceLogo);
1953     autoAnnMenu.addSeparator();
1954     autoAnnMenu.add(showGroupConservation);
1955     autoAnnMenu.add(showGroupConsensus);
1956     annotationsMenu.add(autoAnnMenu);
1957
1958     sort.add(sortIDMenuItem);
1959     sort.add(sortLengthMenuItem);
1960     sort.add(sortGroupMenuItem);
1961     sort.add(sortPairwiseMenuItem);
1962     sort.add(sortEValueMenuItem);
1963     sort.add(sortBitScoreMenuItem);
1964     sort.add(sortByTreeMenu);
1965     calculateMenu.add(sort);
1966     calculateMenu.add(calculateTree);
1967     calculateMenu.addSeparator();
1968     calculateMenu.add(pairwiseAlignmentMenuItem);
1969     calculateMenu.addSeparator();
1970     calculateMenu.add(showTranslation);
1971     calculateMenu.add(showReverse);
1972     calculateMenu.add(showReverseComplement);
1973     calculateMenu.add(showProducts);
1974     calculateMenu.add(autoCalculate);
1975     calculateMenu.add(sortByTree);
1976     calculateMenu.addSeparator();
1977     calculateMenu.add(expandAlignment);
1978     calculateMenu.add(extractScores);
1979     if (!Platform.isJS())
1980     {
1981       calculateMenu.addSeparator();
1982       calculateMenu.add(runGroovy);
1983     }
1984     webServiceNoServices = new JMenuItem(
1985             MessageManager.getString("label.no_services"));
1986     webService.add(webServiceNoServices);
1987     if (!Platform.isJS())
1988     {
1989       exportImageMenu.add(htmlMenuItem);
1990     }
1991     exportImageMenu.add(epsFile);
1992     exportImageMenu.add(createPNG);
1993     if (!Platform.isJS())
1994     {
1995       exportImageMenu.add(createBioJS);
1996       exportImageMenu.add(createSVG);
1997     }
1998     addSequenceMenu.add(addFromFile);
1999     addSequenceMenu.add(addFromText);
2000     addSequenceMenu.add(addFromURL);
2001     this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH);
2002     statusPanel.add(statusBar, null);
2003     this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
2004   
2005     formatMenu.add(font);
2006     formatMenu.addSeparator();
2007     formatMenu.add(wrapMenuItem);
2008     formatMenu.add(scaleAbove);
2009     formatMenu.add(scaleLeft);
2010     formatMenu.add(scaleRight);
2011     formatMenu.add(seqLimits);
2012     formatMenu.add(idRightAlign);
2013     formatMenu.add(hiddenMarkers);
2014     formatMenu.add(viewBoxesMenuItem);
2015     formatMenu.add(viewTextMenuItem);
2016     formatMenu.add(colourTextMenuItem);
2017     formatMenu.add(renderGapsMenuItem);
2018     formatMenu.add(centreColumnLabelsMenuItem);
2019     formatMenu.add(showNonconservedMenuItem);
2020     selectMenu.add(findMenuItem);
2021     selectMenu.addSeparator();
2022     selectMenu.add(selectAllSequenceMenuItem);
2023     selectMenu.add(deselectAllSequenceMenuItem);
2024     selectMenu.add(invertSequenceMenuItem);
2025     selectMenu.add(invertColSel);
2026     selectMenu.add(createGroup);
2027     selectMenu.add(unGroup);
2028     selectMenu.add(grpsFromSelection);
2029     selectMenu.add(deleteGroups);
2030     selectMenu.add(annotationColumn);
2031     selectMenu.add(selectHighlighted);
2032     // TODO - determine if the listenToViewSelections button is needed : see bug
2033     // JAL-574
2034     // selectMenu.addSeparator();
2035     // selectMenu.add(listenToViewSelections);
2036   }
2037
2038   /**
2039    * Constructs the entries on the HMMER menu
2040    */
2041   protected void initHMMERMenu()
2042   {
2043     /*
2044      * hmmbuild
2045      */
2046     JMenu hmmBuild = new JMenu(MessageManager.getString("label.hmmbuild"));
2047     JMenuItem hmmBuildSettings = new JMenuItem(
2048             MessageManager.getString("label.edit_settings_and_run"));
2049     hmmBuildSettings.addActionListener(new ActionListener()
2050     {
2051       @Override
2052       public void actionPerformed(ActionEvent e)
2053       {
2054         hmmBuild_actionPerformed(false);
2055       }
2056     });
2057     JMenuItem hmmBuildRun = new JMenuItem(MessageManager.formatMessage(
2058             "label.action_with_default_settings", "hmmbuild"));
2059     hmmBuildRun.addActionListener(new ActionListener()
2060     {
2061       @Override
2062       public void actionPerformed(ActionEvent e)
2063       {
2064         hmmBuild_actionPerformed(true);
2065       }
2066     });
2067     hmmBuild.add(hmmBuildRun);
2068     hmmBuild.add(hmmBuildSettings);
2069
2070     /*
2071      * hmmalign
2072      */
2073     JMenu hmmAlign = new JMenu(MessageManager.getString("label.hmmalign"));
2074     JMenuItem hmmAlignRun = new JMenuItem(MessageManager.formatMessage(
2075             "label.action_with_default_settings", "hmmalign"));
2076     hmmAlignRun.addActionListener(new ActionListener()
2077     {
2078       @Override
2079       public void actionPerformed(ActionEvent e)
2080       {
2081         hmmAlign_actionPerformed(true);
2082       }
2083     });
2084     JMenuItem hmmAlignSettings = new JMenuItem(
2085             MessageManager.getString("label.edit_settings_and_run"));
2086     hmmAlignSettings.addActionListener(new ActionListener()
2087     {
2088       @Override
2089       public void actionPerformed(ActionEvent e)
2090       {
2091         hmmAlign_actionPerformed(false);
2092       }
2093     });
2094     hmmAlign.add(hmmAlignRun);
2095     hmmAlign.add(hmmAlignSettings);
2096
2097     /*
2098      * hmmsearch
2099      */
2100     JMenu hmmSearch = new JMenu(
2101             MessageManager.getString("label.hmmsearch"));
2102     JMenuItem hmmSearchSettings = new JMenuItem(
2103             MessageManager.getString("label.edit_settings_and_run"));
2104     hmmSearchSettings.addActionListener(new ActionListener()
2105     {
2106       @Override
2107       public void actionPerformed(ActionEvent e)
2108       {
2109         hmmSearch_actionPerformed(false);
2110       }
2111     });
2112     JMenuItem hmmSearchRun = new JMenuItem(MessageManager.formatMessage(
2113             "label.action_with_default_settings", "hmmsearch"));
2114     hmmSearchRun.addActionListener(new ActionListener()
2115     {
2116       @Override
2117       public void actionPerformed(ActionEvent e)
2118       {
2119         hmmSearch_actionPerformed(true);
2120       }
2121     });
2122     JMenuItem addDatabase = new JMenuItem(
2123             MessageManager.getString("label.add_database"));
2124     addDatabase.addActionListener(new ActionListener()
2125     {
2126       @Override
2127       public void actionPerformed(ActionEvent e)
2128       {
2129         try
2130         {
2131           addDatabase_actionPerformed();
2132         } catch (IOException e1)
2133         {
2134           e1.printStackTrace();
2135         }
2136       }
2137     });
2138     hmmSearch.add(hmmSearchRun);
2139     hmmSearch.add(hmmSearchSettings);
2140     // hmmSearch.add(addDatabase);
2141
2142     /*
2143      * jackhmmer
2144      */
2145     JMenu jackhmmer = new JMenu(
2146             MessageManager.getString("label.jackhmmer"));
2147     JMenuItem jackhmmerSettings = new JMenuItem(
2148             MessageManager.getString("label.edit_settings_and_run"));
2149     jackhmmerSettings.addActionListener(new ActionListener()
2150     {
2151       @Override
2152       public void actionPerformed(ActionEvent e)
2153       {
2154         jackhmmer_actionPerformed(false);
2155       }
2156     });
2157     JMenuItem jackhmmerRun = new JMenuItem(MessageManager.formatMessage(
2158             "label.action_with_default_settings", "jackhmmer"));
2159     jackhmmerRun.addActionListener(new ActionListener()
2160     {
2161       @Override
2162       public void actionPerformed(ActionEvent e)
2163       {
2164         jackhmmer_actionPerformed(true);
2165       }
2166
2167     });
2168     /*
2169     JMenuItem addDatabase = new JMenuItem(
2170             MessageManager.getString("label.add_database"));
2171     addDatabase.addActionListener(new ActionListener()
2172     {
2173       @Override
2174       public void actionPerformed(ActionEvent e)
2175       {
2176         try
2177         {
2178           addDatabase_actionPerformed();
2179         } catch (IOException e1)
2180         {
2181           e1.printStackTrace();
2182         }
2183       }
2184     });
2185     */
2186     jackhmmer.add(jackhmmerRun);
2187     jackhmmer.add(jackhmmerSettings);
2188     // hmmSearch.add(addDatabase);
2189
2190     /*
2191      * top level menu
2192      */
2193     hmmerMenu.setText(MessageManager.getString("action.hmmer"));
2194     hmmerMenu.setEnabled(HmmerCommand.isHmmerAvailable());
2195     hmmerMenu.add(hmmBuild);
2196     hmmerMenu.add(hmmAlign);
2197     hmmerMenu.add(hmmSearch);
2198     hmmerMenu.add(jackhmmer);
2199
2200   }
2201
2202   protected void enableSortMenuOptions()
2203   {
2204   }
2205   
2206   protected void loadVcf_actionPerformed()
2207   {
2208   }
2209
2210   /**
2211    * Constructs the entries on the Colour menu (but does not add them to the
2212    * menu).
2213    */
2214   protected void initColourMenu()
2215   {
2216     applyToAllGroups = new JCheckBoxMenuItem(
2217             MessageManager.getString("label.apply_colour_to_all_groups"));
2218     applyToAllGroups.addActionListener(new ActionListener()
2219     {
2220       @Override
2221       public void actionPerformed(ActionEvent e)
2222       {
2223         applyToAllGroups_actionPerformed(applyToAllGroups.isSelected());
2224       }
2225     });
2226
2227     textColour = new JMenuItem(
2228             MessageManager.getString("label.text_colour"));
2229     textColour.addActionListener(new ActionListener()
2230     {
2231       @Override
2232       public void actionPerformed(ActionEvent e)
2233       {
2234         textColour_actionPerformed();
2235       }
2236     });
2237
2238     conservationMenuItem = new JCheckBoxMenuItem(
2239             MessageManager.getString("action.by_conservation"));
2240     conservationMenuItem.addActionListener(new ActionListener()
2241     {
2242       @Override
2243       public void actionPerformed(ActionEvent e)
2244       {
2245         conservationMenuItem_actionPerformed(
2246                 conservationMenuItem.isSelected());
2247       }
2248     });
2249
2250     abovePIDThreshold = new JCheckBoxMenuItem(
2251             MessageManager.getString("label.above_identity_threshold"));
2252     abovePIDThreshold.addActionListener(new ActionListener()
2253     {
2254       @Override
2255       public void actionPerformed(ActionEvent e)
2256       {
2257         abovePIDThreshold_actionPerformed(abovePIDThreshold.isSelected());
2258       }
2259     });
2260     modifyPID = new JMenuItem(
2261             MessageManager.getString("label.modify_identity_threshold"));
2262     modifyPID.addActionListener(new ActionListener()
2263     {
2264       @Override
2265       public void actionPerformed(ActionEvent e)
2266       {
2267         modifyPID_actionPerformed();
2268       }
2269     });
2270     modifyConservation = new JMenuItem(MessageManager
2271             .getString("label.modify_conservation_threshold"));
2272     modifyConservation.addActionListener(new ActionListener()
2273     {
2274       @Override
2275       public void actionPerformed(ActionEvent e)
2276       {
2277         modifyConservation_actionPerformed();
2278       }
2279     });
2280
2281     annotationColour = new JRadioButtonMenuItem(
2282             MessageManager.getString("action.by_annotation"));
2283     annotationColour.setName(ResidueColourScheme.ANNOTATION_COLOUR);
2284     annotationColour.addActionListener(new ActionListener()
2285     {
2286       @Override
2287       public void actionPerformed(ActionEvent e)
2288       {
2289         annotationColour_actionPerformed();
2290       }
2291     });
2292   }
2293
2294   protected void selectHighlightedColumns_actionPerformed(
2295           ActionEvent actionEvent)
2296   {
2297     // TODO Auto-generated method stub
2298
2299   }
2300
2301   /**
2302    * Generate the reverse sequence (or reverse complement if the flag is true)
2303    * and add it to the alignment
2304    * 
2305    * @param complement
2306    */
2307   protected void showReverse_actionPerformed(boolean complement)
2308   {
2309   }
2310
2311   /**
2312    * Try to run script in a Groovy console, having first ensured that this
2313    * alignframe is set as currentAlignFrame in Desktop
2314    */
2315   protected void runGroovy_actionPerformed()
2316   {
2317
2318   }
2319
2320   /**
2321    * Adds the given action listener and key accelerator to the given menu item.
2322    * Also saves in a lookup table to support lookup of action by key stroke.
2323    * 
2324    * @param keyStroke
2325    * @param menuItem
2326    * @param actionListener
2327    */
2328   protected void addMenuActionAndAccelerator(KeyStroke keyStroke,
2329           JMenuItem menuItem, ActionListener actionListener)
2330   {
2331     menuItem.setAccelerator(keyStroke);
2332     accelerators.put(keyStroke, menuItem);
2333     menuItem.addActionListener(actionListener);
2334   }
2335
2336   /**
2337    * Action on clicking sort annotations by type.
2338    * 
2339    * @param sortOrder
2340    */
2341   protected void sortAnnotations_actionPerformed()
2342   {
2343   }
2344
2345   /**
2346    * Action on clicking Show all annotations.
2347    * 
2348    * @param forSequences
2349    *          update sequence-related annotations
2350    * @param forAlignment
2351    *          update non-sequence-related annotations
2352    */
2353   protected void showAllAnnotations_actionPerformed(boolean forSequences,
2354           boolean forAlignment)
2355   {
2356     setAnnotationsVisibility(true, forSequences, forAlignment);
2357   }
2358
2359   /**
2360    * Action on clicking Hide all annotations.
2361    * 
2362    * @param forSequences
2363    *          update sequence-related annotations
2364    * @param forAlignment
2365    *          update non-sequence-related annotations
2366    */
2367   protected void hideAllAnnotations_actionPerformed(boolean forSequences,
2368           boolean forAlignment)
2369   {
2370     setAnnotationsVisibility(false, forSequences, forAlignment);
2371   }
2372
2373   /**
2374    * Set the visibility of annotations to true or false. Can act on
2375    * sequence-related annotations, or alignment-related, or both.
2376    * 
2377    * @param visible
2378    * @param forSequences
2379    *          update sequence-related annotations
2380    * @param forAlignment
2381    *          update non-sequence-related annotations
2382    */
2383   protected void setAnnotationsVisibility(boolean visible,
2384           boolean forSequences, boolean forAlignment)
2385   {
2386
2387   }
2388
2389   protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
2390   {
2391     // TODO Auto-generated method stub
2392
2393   }
2394
2395   protected void listenToViewSelections_actionPerformed(ActionEvent e)
2396   {
2397     // TODO Auto-generated method stub
2398
2399   }
2400
2401   protected void showAllhidden_actionPerformed(ActionEvent e)
2402   {
2403     // TODO Auto-generated method stub
2404
2405   }
2406
2407   protected void hideAllButSelection_actionPerformed(ActionEvent e)
2408   {
2409     // TODO Auto-generated method stub
2410
2411   }
2412
2413   protected void hideAllSelection_actionPerformed(ActionEvent e)
2414   {
2415     // TODO Auto-generated method stub
2416
2417   }
2418
2419   protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
2420   {
2421     // TODO Auto-generated method stub
2422
2423   }
2424
2425   protected void showConsensusHistogram_actionPerformed(ActionEvent e)
2426   {
2427     // TODO Auto-generated method stub
2428
2429   }
2430
2431   protected void showSequenceLogo_actionPerformed(ActionEvent e)
2432   {
2433     // TODO Auto-generated method stub
2434
2435   }
2436
2437   protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
2438   {
2439     // TODO Auto-generated method stub
2440
2441   }
2442
2443   protected void showGroupConsensus_actionPerformed(ActionEvent e)
2444   {
2445     // TODO Auto-generated method stub
2446
2447   }
2448
2449   protected void showGroupConservation_actionPerformed(ActionEvent e)
2450   {
2451     // TODO Auto-generated method stub
2452
2453   }
2454
2455   protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
2456   {
2457     // TODO Auto-generated method stub
2458
2459   }
2460
2461   protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
2462   {
2463     // TODO Auto-generated method stub
2464
2465   }
2466
2467   protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
2468   {
2469     // TODO Auto-generated method stub
2470
2471   }
2472
2473   protected void followHighlight_actionPerformed()
2474   {
2475     // TODO Auto-generated method stub
2476
2477   }
2478
2479   protected void showNpFeats_actionPerformed(ActionEvent e)
2480   {
2481     // TODO Auto-generated method stub
2482
2483   }
2484
2485   protected void showDbRefs_actionPerformed(ActionEvent e)
2486   {
2487     // TODO Auto-generated method stub
2488
2489   }
2490
2491   protected void centreColumnLabels_actionPerformed(ActionEvent e)
2492   {
2493   }
2494
2495   protected void buildSortByAnnotationScoresMenu()
2496   {
2497   }
2498
2499   protected void extractScores_actionPerformed(ActionEvent e)
2500   {
2501   }
2502
2503   protected void outputText_actionPerformed(String formatName)
2504   {
2505   }
2506
2507   public void addFromFile_actionPerformed(ActionEvent e)
2508   {
2509
2510   }
2511
2512   public void addFromText_actionPerformed(ActionEvent e)
2513   {
2514
2515   }
2516
2517   public void addFromURL_actionPerformed(ActionEvent e)
2518   {
2519
2520   }
2521
2522   public void exportFeatures_actionPerformed(ActionEvent e)
2523   {
2524
2525   }
2526
2527   public void exportAnnotations_actionPerformed(ActionEvent e)
2528   {
2529
2530   }
2531
2532   protected void htmlMenuItem_actionPerformed(ActionEvent e)
2533   {
2534   }
2535
2536   protected void bioJSMenuItem_actionPerformed(ActionEvent e)
2537   {
2538
2539   }
2540
2541   protected void closeMenuItem_actionPerformed(boolean b)
2542   {
2543   }
2544
2545   protected void redoMenuItem_actionPerformed(ActionEvent e)
2546   {
2547   }
2548
2549   protected void undoMenuItem_actionPerformed(ActionEvent e)
2550   {
2551   }
2552
2553   protected void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
2554   {
2555   }
2556
2557   protected void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
2558   {
2559   }
2560
2561   protected void invertSequenceMenuItem_actionPerformed(ActionEvent e)
2562   {
2563   }
2564
2565   protected void remove2LeftMenuItem_actionPerformed(ActionEvent e)
2566   {
2567   }
2568
2569   protected void remove2RightMenuItem_actionPerformed(ActionEvent e)
2570   {
2571   }
2572
2573   protected void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
2574   {
2575   }
2576
2577   protected void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
2578   {
2579   }
2580
2581   protected void wrapMenuItem_actionPerformed(ActionEvent e)
2582   {
2583   }
2584
2585   protected void viewBoxesMenuItem_actionPerformed(ActionEvent e)
2586   {
2587   }
2588
2589   protected void viewTextMenuItem_actionPerformed(ActionEvent e)
2590   {
2591   }
2592
2593   protected void colourTextMenuItem_actionPerformed(ActionEvent e)
2594   {
2595   }
2596
2597   protected void annotationPanelMenuItem_actionPerformed(ActionEvent e)
2598   {
2599   }
2600
2601   protected void overviewMenuItem_actionPerformed(ActionEvent e)
2602   {
2603   }
2604
2605   protected void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
2606   {
2607   }
2608
2609   protected void sortIDMenuItem_actionPerformed(ActionEvent e)
2610   {
2611   }
2612
2613   protected void sortLengthMenuItem_actionPerformed(ActionEvent e)
2614   {
2615   }
2616
2617   protected void sortGroupMenuItem_actionPerformed(ActionEvent e)
2618   {
2619   }
2620
2621   protected void sortEValueMenuItem_actionPerformed(ActionEvent e)
2622   {
2623   }
2624
2625   protected void sortBitScoreMenuItem_actionPerformed(ActionEvent e)
2626   {
2627   }
2628
2629   protected void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
2630   {
2631   }
2632
2633   protected void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
2634   {
2635   }
2636
2637   protected void neighbourTreeMenuItem_actionPerformed(ActionEvent e)
2638   {
2639   }
2640
2641   protected void conservationMenuItem_actionPerformed(boolean selected)
2642   {
2643   }
2644
2645   protected void printMenuItem_actionPerformed(ActionEvent e)
2646   {
2647   }
2648
2649   protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
2650   {
2651   }
2652
2653   protected void findMenuItem_actionPerformed(ActionEvent e)
2654   {
2655   }
2656
2657   protected void abovePIDThreshold_actionPerformed(boolean selected)
2658   {
2659   }
2660
2661   public void showSeqFeatures_actionPerformed(ActionEvent actionEvent)
2662   {
2663   }
2664
2665   protected void deleteGroups_actionPerformed(ActionEvent e)
2666   {
2667   }
2668
2669   protected void createGroup_actionPerformed(ActionEvent e)
2670   {
2671   }
2672
2673   protected void unGroup_actionPerformed(ActionEvent e)
2674   {
2675   }
2676
2677   protected void copy_actionPerformed()
2678   {
2679   }
2680
2681   protected void cut_actionPerformed()
2682   {
2683   }
2684
2685   protected void delete_actionPerformed()
2686   {
2687   }
2688
2689   protected void pasteNew_actionPerformed(ActionEvent e)
2690           throws IOException, InterruptedException
2691   {
2692   }
2693
2694   protected void pasteThis_actionPerformed(ActionEvent e)
2695           throws IOException, InterruptedException
2696   {
2697   }
2698
2699   protected void applyToAllGroups_actionPerformed(boolean selected)
2700   {
2701   }
2702
2703   protected void hmmBuild_actionPerformed(boolean withDefaults)
2704   {
2705   }
2706
2707   protected void hmmSearch_actionPerformed(boolean withDefaults)
2708   {
2709   }
2710
2711   protected void jackhmmer_actionPerformed(boolean b)
2712   {
2713   }
2714
2715   protected void addDatabase_actionPerformed()
2716           throws FileFormatException, IOException
2717   {
2718   }
2719
2720   protected void hmmAlign_actionPerformed(boolean withDefaults)
2721   {
2722   }
2723
2724   public void createPNG(java.io.File f)
2725   {
2726   }
2727
2728   protected void font_actionPerformed(ActionEvent e)
2729   {
2730   }
2731
2732   protected void seqLimit_actionPerformed(ActionEvent e)
2733   {
2734   }
2735
2736   public void seqDBRef_actionPerformed(ActionEvent e)
2737   {
2738
2739   }
2740
2741   public void createEPS(java.io.File f)
2742   {
2743   }
2744
2745   public void createSVG(java.io.File f)
2746   {
2747
2748   }
2749
2750   protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
2751   {
2752
2753   }
2754
2755   /**
2756    * Template method to handle the 'load T-Coffee scores' menu event.
2757    * <p>
2758    * Subclasses override this method to provide a custom action.
2759    * 
2760    * @param event
2761    *          The raised event
2762    */
2763   protected void loadScores_actionPerformed(ActionEvent event)
2764   {
2765
2766   }
2767
2768   protected void jpred_actionPerformed(ActionEvent e)
2769   {
2770   }
2771
2772   protected void scaleAbove_actionPerformed(ActionEvent e)
2773   {
2774   }
2775
2776   protected void scaleLeft_actionPerformed(ActionEvent e)
2777   {
2778   }
2779
2780   protected void filterByEValue_actionPerformed()
2781   {
2782   }
2783
2784   protected void filterByScore_actionPerformed()
2785   {
2786   }
2787
2788   protected void scaleRight_actionPerformed(ActionEvent e)
2789   {
2790   }
2791
2792   protected void modifyPID_actionPerformed()
2793   {
2794   }
2795
2796   protected void modifyConservation_actionPerformed()
2797   {
2798   }
2799
2800   protected void saveAs_actionPerformed()
2801   {
2802   }
2803
2804   protected void padGapsMenuitem_actionPerformed(ActionEvent e)
2805   {
2806   }
2807
2808   public void vamsasStore_actionPerformed(ActionEvent e)
2809   {
2810
2811   }
2812
2813   public void vamsasLoad_actionPerformed(ActionEvent e)
2814   {
2815
2816   }
2817
2818   public void showTranslation_actionPerformed(GeneticCodeI codeTable)
2819   {
2820
2821   }
2822
2823   public void featureSettings_actionPerformed(ActionEvent e)
2824   {
2825
2826   }
2827
2828   public void fetchSequence_actionPerformed()
2829   {
2830
2831   }
2832
2833   public void smoothFont_actionPerformed(ActionEvent e)
2834   {
2835
2836   }
2837
2838   public void annotationColour_actionPerformed()
2839   {
2840   }
2841
2842   public void annotationColumn_actionPerformed(ActionEvent e)
2843   {
2844   }
2845
2846   public void associatedData_actionPerformed(ActionEvent e)
2847           throws IOException, InterruptedException
2848   {
2849
2850   }
2851
2852   public void autoCalculate_actionPerformed(ActionEvent e)
2853   {
2854
2855   }
2856
2857   public void sortByTreeOption_actionPerformed(ActionEvent e)
2858   {
2859
2860   }
2861
2862   public void showAllSeqs_actionPerformed(ActionEvent e)
2863   {
2864
2865   }
2866
2867   public void showAllColumns_actionPerformed(ActionEvent e)
2868   {
2869
2870   }
2871
2872   public void hideSelSequences_actionPerformed(ActionEvent e)
2873   {
2874
2875   }
2876
2877   public void hideSelColumns_actionPerformed(ActionEvent e)
2878   {
2879
2880   }
2881
2882   public void hiddenMarkers_actionPerformed(ActionEvent e)
2883   {
2884
2885   }
2886
2887   public void findPdbId_actionPerformed(ActionEvent e)
2888   {
2889
2890   }
2891
2892   public void enterPdbId_actionPerformed(ActionEvent e)
2893   {
2894
2895   }
2896
2897   public void pdbFile_actionPerformed(ActionEvent e)
2898   {
2899
2900   }
2901
2902   public void invertColSel_actionPerformed(ActionEvent e)
2903   {
2904
2905   }
2906
2907   public void tabSelectionChanged(int sel)
2908   {
2909
2910   }
2911
2912   public void tabbedPane_mousePressed(MouseEvent e)
2913   {
2914
2915   }
2916
2917   public void tabbedPane_focusGained(FocusEvent e)
2918   {
2919     requestFocus();
2920   }
2921
2922   public void save_actionPerformed(ActionEvent e)
2923   {
2924
2925   }
2926
2927   public void reload_actionPerformed(ActionEvent e)
2928   {
2929
2930   }
2931
2932   public void newView_actionPerformed(ActionEvent e)
2933   {
2934
2935   }
2936
2937   public void textColour_actionPerformed()
2938   {
2939
2940   }
2941
2942   public void idRightAlign_actionPerformed(ActionEvent e)
2943   {
2944
2945   }
2946
2947   public void expandViews_actionPerformed(ActionEvent e)
2948   {
2949
2950   }
2951
2952   public void gatherViews_actionPerformed(ActionEvent e)
2953   {
2954
2955   }
2956
2957   public void buildTreeSortMenu()
2958   {
2959
2960   }
2961
2962   public void pageSetup_actionPerformed(ActionEvent e)
2963   {
2964
2965   }
2966
2967   public void alignmentProperties()
2968   {
2969
2970   }
2971
2972   protected void expand_newalign(ActionEvent e)
2973   {
2974     // TODO Auto-generated method stub
2975
2976   }
2977
2978   protected boolean isShowAutoCalculatedAbove()
2979   {
2980     return showAutoCalculatedAbove;
2981   }
2982
2983   protected void setShowAutoCalculatedAbove(boolean showAutoCalculatedAbove)
2984   {
2985     this.showAutoCalculatedAbove = showAutoCalculatedAbove;
2986   }
2987
2988   protected SequenceAnnotationOrder getAnnotationSortOrder()
2989   {
2990     return annotationSortOrder;
2991   }
2992
2993   protected void setAnnotationSortOrder(
2994           SequenceAnnotationOrder annotationSortOrder)
2995   {
2996     this.annotationSortOrder = annotationSortOrder;
2997   }
2998
2999   public Map<KeyStroke, JMenuItem> getAccelerators()
3000   {
3001     return this.accelerators;
3002   }
3003
3004   /**
3005    * Returns the selected index of the tabbed pane, or -1 if none selected
3006    * (including the case where the tabbed pane has not been made visible).
3007    * 
3008    * @return
3009    */
3010   public int getTabIndex()
3011   {
3012     return tabbedPane.getSelectedIndex();
3013   }
3014
3015   public JPanel getStatusPanel()
3016   {
3017     return statusPanel;
3018   }
3019
3020   /**
3021    * Sets a reference to the containing split frame. Also makes the 'toggle
3022    * split view' menu item visible and checked.
3023    * 
3024    * @param sf
3025    */
3026   public void setSplitFrame(SplitContainerI sf)
3027   {
3028     this.splitFrame = sf;
3029     if (sf != null)
3030     {
3031       this.showComplementMenuItem.setVisible(true);
3032       this.showComplementMenuItem.setState(true);
3033     }
3034   }
3035
3036   public SplitContainerI getSplitViewContainer()
3037   {
3038     return this.splitFrame;
3039   }
3040
3041   protected void showComplement_actionPerformed(boolean complement)
3042   {
3043   }
3044   
3045
3046 }