Merge branch 'alpha/JAL-3362_Jalview_212_alpha' into alpha/merge_212_JalviewJS_2112
[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 jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
24 import jalview.analysis.GeneticCodeI;
25 import jalview.analysis.GeneticCodes;
26 import jalview.api.SplitContainerI;
27 import jalview.bin.Cache;
28 import jalview.gui.JvSwingUtils;
29 import jalview.gui.Preferences;
30 import jalview.hmmer.HmmerCommand;
31 import jalview.io.FileFormatException;
32 import jalview.io.FileFormats;
33 import jalview.schemes.ResidueColourScheme;
34 import jalview.util.MessageManager;
35 import jalview.util.Platform;
36
37 import java.awt.BorderLayout;
38 import java.awt.Color;
39 import java.awt.GridLayout;
40 import java.awt.event.ActionEvent;
41 import java.awt.event.ActionListener;
42 import java.awt.event.FocusAdapter;
43 import java.awt.event.FocusEvent;
44 import java.awt.event.KeyEvent;
45 import java.awt.event.MouseAdapter;
46 import java.awt.event.MouseEvent;
47 import java.io.IOException;
48 import java.util.HashMap;
49 import java.util.Map;
50
51 import javax.swing.BorderFactory;
52 import javax.swing.ButtonGroup;
53 import javax.swing.JCheckBoxMenuItem;
54 import javax.swing.JInternalFrame;
55 import javax.swing.JLabel;
56 import javax.swing.JMenu;
57 import javax.swing.JMenuBar;
58 import javax.swing.JMenuItem;
59 import javax.swing.JPanel;
60 import javax.swing.JRadioButtonMenuItem;
61 import javax.swing.JTabbedPane;
62 import javax.swing.KeyStroke;
63 import javax.swing.event.ChangeEvent;
64 import javax.swing.event.MenuEvent;
65 import javax.swing.event.MenuListener;
66
67 @SuppressWarnings("serial")
68 public class GAlignFrame extends JInternalFrame
69 {
70   protected JMenuBar alignFrameMenuBar = new JMenuBar();
71
72   protected JMenuItem closeMenuItem = new JMenuItem();
73
74   public JMenu webService = new JMenu();// BH 2019 was protected, but not
75                                         // sufficient for AlignFrame thread run
76     // JBP - followed suite for these other service related GUI elements.
77     // TODO: check we really need these to be public
78   public JMenu hmmerMenu = new JMenu();
79
80   public JMenuItem webServiceNoServices;
81
82   protected JCheckBoxMenuItem viewBoxesMenuItem = new JCheckBoxMenuItem();
83
84   protected JCheckBoxMenuItem viewTextMenuItem = new JCheckBoxMenuItem();
85
86   protected JMenu sortByAnnotScore = new JMenu();
87
88   public JLabel statusBar = new JLabel(); // BH 2019 was protected, but not
89                                           // sufficient for
90                                           // AlignFrame.printWriter
91
92   protected JMenu outputTextboxMenu = new JMenu();
93
94   protected JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem();
95
96   protected JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem();
97
98   protected JCheckBoxMenuItem showNonconservedMenuItem = new JCheckBoxMenuItem();
99
100   protected JMenuItem undoMenuItem = new JMenuItem();
101
102   protected JMenuItem redoMenuItem = new JMenuItem();
103
104   protected JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem();
105
106   protected JCheckBoxMenuItem renderGapsMenuItem = new JCheckBoxMenuItem();
107
108   public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem();
109
110   JMenuItem copy = new JMenuItem();
111
112   JMenuItem cut = new JMenuItem();
113
114   JMenu pasteMenu = new JMenu();
115
116   protected JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem();
117
118   protected JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem();
119
120   protected JCheckBoxMenuItem scaleLeft = new JCheckBoxMenuItem();
121
122   protected JCheckBoxMenuItem scaleRight = new JCheckBoxMenuItem();
123
124   protected JCheckBoxMenuItem applyToAllGroups;
125
126   protected JMenu colourMenu = new JMenu();
127
128   protected JMenuItem textColour;
129
130   protected JCheckBoxMenuItem conservationMenuItem;
131
132   protected JMenuItem modifyConservation;
133
134   protected JCheckBoxMenuItem abovePIDThreshold;
135
136   protected JMenuItem modifyPID;
137
138   protected JRadioButtonMenuItem annotationColour;
139
140   protected JMenu sortByTreeMenu = new JMenu();
141
142   protected JMenu sort = new JMenu();
143
144   protected JMenuItem calculateTree = new JMenuItem();
145
146   protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem();
147
148   protected JCheckBoxMenuItem showNpFeatsMenuitem = new JCheckBoxMenuItem();
149
150   protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem();
151
152   protected JMenu showTranslation = new JMenu();
153
154   protected JMenuItem showReverse = new JMenuItem();
155
156   protected JMenuItem showReverseComplement = new JMenuItem();
157
158   protected JMenu showProducts = new JMenu();
159
160   protected JMenuItem runGroovy = new JMenuItem();
161
162   protected JMenuItem loadVcf;
163
164   protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
165
166   protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem();
167
168   protected JCheckBoxMenuItem listenToViewSelections = new JCheckBoxMenuItem();
169
170   protected JPanel statusPanel = new JPanel();
171
172   protected JMenuItem showAllSeqAnnotations = new JMenuItem();
173
174   protected JMenuItem hideAllSeqAnnotations = new JMenuItem();
175
176   protected JMenuItem showAllAlAnnotations = new JMenuItem();
177
178   protected JMenuItem hideAllAlAnnotations = new JMenuItem();
179
180   protected JCheckBoxMenuItem showComplementMenuItem = new JCheckBoxMenuItem();
181
182   protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem();
183
184   protected JTabbedPane tabbedPane = new JTabbedPane();
185
186   protected JMenuItem reload = new JMenuItem();
187
188   protected JMenu formatMenu = new JMenu();
189
190   protected JCheckBoxMenuItem idRightAlign = new JCheckBoxMenuItem();
191
192   protected JCheckBoxMenuItem centreColumnLabelsMenuItem = new JCheckBoxMenuItem();
193
194   protected JCheckBoxMenuItem followHighlightMenuItem = new JCheckBoxMenuItem();
195
196   protected JMenuItem gatherViews = new JMenuItem();
197
198   protected JMenuItem expandViews = new JMenuItem();
199
200   protected JCheckBoxMenuItem showGroupConsensus = new JCheckBoxMenuItem();
201
202   protected JCheckBoxMenuItem showGroupConservation = new JCheckBoxMenuItem();
203
204   protected JCheckBoxMenuItem showConsensusHistogram = new JCheckBoxMenuItem();
205
206   protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem();
207
208   protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
209
210   protected JCheckBoxMenuItem showInformationHistogram = new JCheckBoxMenuItem();
211
212   protected JCheckBoxMenuItem showHMMSequenceLogo = new JCheckBoxMenuItem();
213
214   protected JCheckBoxMenuItem normaliseHMMSequenceLogo = new JCheckBoxMenuItem();
215
216   protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
217
218   protected JMenuItem openFeatureSettings;
219
220   private SequenceAnnotationOrder annotationSortOrder;
221
222   private boolean showAutoCalculatedAbove = false;
223
224   private Map<KeyStroke, JMenuItem> accelerators = new HashMap<>();
225
226   private SplitContainerI splitFrame;
227
228   public GAlignFrame()
229   {
230     try
231     {
232
233       // for Web-page embedding using id=align-frame-div
234       setName("jalview-alignment");
235
236       jbInit();
237       setJMenuBar(alignFrameMenuBar);
238
239       // dynamically fill save as menu with available formats
240       for (String ff : FileFormats.getInstance().getWritableFormats(true))
241       {
242         JMenuItem item = new JMenuItem(ff);
243
244         item.addActionListener(new ActionListener()
245         {
246           @Override
247           public void actionPerformed(ActionEvent e)
248           {
249             outputText_actionPerformed(e.getActionCommand());
250           }
251         });
252
253         outputTextboxMenu.add(item);
254       }
255     } catch (Exception e)
256     {
257       System.err.println(e.toString());
258     }
259
260     if (Platform.allowMnemonics()) // was "not mac and not JS"
261     {
262       closeMenuItem.setMnemonic('C');
263       outputTextboxMenu.setMnemonic('T');
264       undoMenuItem.setMnemonic('Z');
265       redoMenuItem.setMnemonic('0');
266       copy.setMnemonic('C');
267       cut.setMnemonic('U');
268       pasteMenu.setMnemonic('P');
269       reload.setMnemonic('R');
270     }
271   }
272
273   private void jbInit() throws Exception
274   {
275     initColourMenu();
276   
277     JMenuItem saveAs = new JMenuItem(
278             MessageManager.getString("action.save_as"));
279     ActionListener al = new ActionListener()
280     {
281       @Override
282       public void actionPerformed(ActionEvent e)
283       {
284         saveAs_actionPerformed();
285       }
286     };
287   
288     // FIXME getDefaultToolkit throws an exception in Headless mode
289     KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S,
290             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx()
291                     | jalview.util.ShortcutKeyMaskExWrapper.SHIFT_DOWN_MASK,
292             false);
293     addMenuActionAndAccelerator(keyStroke, saveAs, al);
294   
295     closeMenuItem.setText(MessageManager.getString("action.close"));
296     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_W,
297             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx()
429                     | jalview.util.ShortcutKeyMaskExWrapper.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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx()
1024                     | jalview.util.ShortcutKeyMaskExWrapper.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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx()
1079                     | jalview.util.ShortcutKeyMaskExWrapper.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             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), 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         buildTreeSortMenu();
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     sortByAnnotScore
1264             .setText(MessageManager.getString("label.sort_by_score"));
1265     sort.add(sortByAnnotScore);
1266     sort.addMenuListener(new javax.swing.event.MenuListener()
1267     {
1268   
1269       @Override
1270       public void menuCanceled(MenuEvent e)
1271       {
1272       }
1273   
1274       @Override
1275       public void menuDeselected(MenuEvent e)
1276       {
1277       }
1278   
1279       @Override
1280       public void menuSelected(MenuEvent e)
1281       {
1282         buildSortByAnnotationScoresMenu();
1283       }
1284     });
1285     sortByAnnotScore.setVisible(false);
1286
1287     calculateTree
1288             .setText(MessageManager.getString("action.calculate_tree_pca"));
1289
1290     padGapsMenuitem.setText(MessageManager.getString("label.pad_gaps"));
1291     padGapsMenuitem
1292             .setState(jalview.bin.Cache.getDefault("PAD_GAPS", false));
1293     padGapsMenuitem.addActionListener(new ActionListener()
1294     {
1295       @Override
1296       public void actionPerformed(ActionEvent e)
1297       {
1298         padGapsMenuitem_actionPerformed(e);
1299       }
1300     });
1301     JMenuItem vamsasStore = new JMenuItem(
1302             MessageManager.getString("label.vamsas_store"));
1303     vamsasStore.setVisible(false);
1304     vamsasStore.addActionListener(new ActionListener()
1305     {
1306       @Override
1307       public void actionPerformed(ActionEvent e)
1308       {
1309         vamsasStore_actionPerformed(e);
1310       }
1311     });
1312
1313     /*
1314      * Translate as cDNA with sub-menu of translation tables
1315      */
1316     showTranslation
1317             .setText(MessageManager.getString("label.translate_cDNA"));
1318     boolean first = true;
1319     for (final GeneticCodeI table : GeneticCodes.getInstance()
1320             .getCodeTables())
1321     {
1322       JMenuItem item = new JMenuItem(table.getId() + " " + table.getName());
1323       showTranslation.add(item);
1324       item.addActionListener(new ActionListener()
1325       {
1326         @Override
1327         public void actionPerformed(ActionEvent e)
1328         {
1329           showTranslation_actionPerformed(table);
1330         }
1331       });
1332       if (first)
1333       {
1334         showTranslation.addSeparator();
1335       }
1336       first = false;
1337     }
1338
1339     showReverse.setText(MessageManager.getString("label.reverse"));
1340     showReverse.addActionListener(new ActionListener()
1341     {
1342       @Override
1343       public void actionPerformed(ActionEvent e)
1344       {
1345         showReverse_actionPerformed(false);
1346       }
1347     });
1348     showReverseComplement
1349             .setText(MessageManager.getString("label.reverse_complement"));
1350     showReverseComplement.addActionListener(new ActionListener()
1351     {
1352       @Override
1353       public void actionPerformed(ActionEvent e)
1354       {
1355         showReverse_actionPerformed(true);
1356       }
1357     });
1358   
1359     JMenuItem extractScores = new JMenuItem(
1360             MessageManager.getString("label.extract_scores"));
1361     extractScores.addActionListener(new ActionListener()
1362     {
1363       @Override
1364       public void actionPerformed(ActionEvent e)
1365       {
1366         extractScores_actionPerformed(e);
1367       }
1368     });
1369     extractScores.setVisible(true);
1370     // JBPNote: TODO: make gui for regex based score extraction
1371   
1372     // for show products actions see AlignFrame.canShowProducts
1373     showProducts.setText(MessageManager.getString("label.get_cross_refs"));
1374   
1375     runGroovy.setText(MessageManager.getString("label.run_groovy"));
1376     runGroovy.setToolTipText(
1377             MessageManager.getString("label.run_groovy_tip"));
1378     runGroovy.addActionListener(new ActionListener()
1379     {
1380       @Override
1381       public void actionPerformed(ActionEvent e)
1382       {
1383         runGroovy_actionPerformed();
1384       }
1385     });
1386
1387     openFeatureSettings = new JMenuItem(
1388             MessageManager.getString("action.feature_settings"));
1389     openFeatureSettings.addActionListener(new ActionListener()
1390     {
1391       @Override
1392       public void actionPerformed(ActionEvent e)
1393       {
1394         featureSettings_actionPerformed(e);
1395       }
1396     });
1397
1398     /*
1399      * add sub-menu of database we can fetch from
1400      */
1401     JMenuItem fetchSequence = new JMenuItem(
1402             MessageManager.getString("label.fetch_sequences"));
1403     fetchSequence.addActionListener(new ActionListener()
1404     {
1405       @Override
1406       public void actionPerformed(ActionEvent e)
1407       {
1408         fetchSequence_actionPerformed();
1409       }
1410     });
1411   
1412     JMenuItem associatedData = new JMenuItem(
1413             MessageManager.getString("label.load_features_annotations"));
1414     associatedData.addActionListener(new ActionListener()
1415     {
1416       @Override
1417       public void actionPerformed(ActionEvent e)
1418       {
1419         try
1420         {
1421           associatedData_actionPerformed(e);
1422         } catch (IOException | InterruptedException e1)
1423         {
1424           // TODO Auto-generated catch block
1425           e1.printStackTrace();
1426         }
1427       }
1428     });
1429     loadVcf = new JMenuItem(
1430             MessageManager.getString("label.load_vcf_file"));
1431     loadVcf.setToolTipText(MessageManager.getString("label.load_vcf"));
1432     loadVcf.addActionListener(new ActionListener()
1433     {
1434       @Override
1435       public void actionPerformed(ActionEvent e)
1436       {
1437         loadVcf_actionPerformed();
1438       }
1439     });
1440     autoCalculate.setText(
1441             MessageManager.getString("label.autocalculate_consensus"));
1442     autoCalculate.setState(
1443             jalview.bin.Cache.getDefault("AUTO_CALC_CONSENSUS", true));
1444     autoCalculate.addActionListener(new ActionListener()
1445     {
1446       @Override
1447       public void actionPerformed(ActionEvent e)
1448       {
1449         autoCalculate_actionPerformed(e);
1450       }
1451     });
1452     sortByTree.setText(
1453             MessageManager.getString("label.sort_alignment_new_tree"));
1454     sortByTree.setToolTipText("<html>" + MessageManager.getString(
1455             "label.enable_automatically_sort_alignment_when_open_new_tree"));
1456     sortByTree
1457             .setState(jalview.bin.Cache.getDefault("SORT_BY_TREE", false));
1458     sortByTree.addActionListener(new ActionListener()
1459     {
1460       @Override
1461       public void actionPerformed(ActionEvent e)
1462       {
1463         sortByTreeOption_actionPerformed(e);
1464       }
1465     });
1466
1467     listenToViewSelections.setText(
1468             MessageManager.getString("label.listen_for_selections"));
1469     listenToViewSelections
1470             .setToolTipText("<html>" + MessageManager.getString(
1471                     "label.selections_mirror_selections_made_same_sequences_other_views"));
1472     listenToViewSelections.setState(false);
1473     listenToViewSelections.addActionListener(new ActionListener()
1474     {
1475       @Override
1476       public void actionPerformed(ActionEvent e)
1477       {
1478         listenToViewSelections_actionPerformed(e);
1479       }
1480     });
1481   
1482     JMenu addSequenceMenu = new JMenu(
1483             MessageManager.getString("label.add_sequences"));
1484     JMenuItem addFromFile = new JMenuItem(
1485             MessageManager.getString("label.from_file"));
1486     addFromFile.addActionListener(new ActionListener()
1487     {
1488       @Override
1489       public void actionPerformed(ActionEvent e)
1490       {
1491         addFromFile_actionPerformed(e);
1492       }
1493     });
1494     JMenuItem addFromText = new JMenuItem(
1495             MessageManager.getString("label.from_textbox"));
1496     addFromText.addActionListener(new ActionListener()
1497     {
1498       @Override
1499       public void actionPerformed(ActionEvent e)
1500       {
1501         addFromText_actionPerformed(e);
1502       }
1503     });
1504     JMenuItem addFromURL = new JMenuItem(
1505             MessageManager.getString("label.from_url"));
1506     addFromURL.addActionListener(new ActionListener()
1507     {
1508       @Override
1509       public void actionPerformed(ActionEvent e)
1510       {
1511         addFromURL_actionPerformed(e);
1512       }
1513     });
1514     JMenuItem exportFeatures = new JMenuItem(
1515             MessageManager.getString("label.export_features"));
1516     exportFeatures.addActionListener(new ActionListener()
1517     {
1518       @Override
1519       public void actionPerformed(ActionEvent e)
1520       {
1521         exportFeatures_actionPerformed(e);
1522       }
1523     });
1524     JMenuItem exportAnnotations = new JMenuItem(
1525             MessageManager.getString("label.export_annotations"));
1526     exportAnnotations.addActionListener(new ActionListener()
1527     {
1528       @Override
1529       public void actionPerformed(ActionEvent e)
1530       {
1531         exportAnnotations_actionPerformed(e);
1532       }
1533     });
1534     statusPanel.setLayout(new GridLayout());
1535     JMenuItem showAllSeqs = new JMenuItem(
1536             MessageManager.getString("label.all_sequences"));
1537     showAllSeqs.setToolTipText(
1538             MessageManager.getString("label.toggle_sequence_visibility"));
1539     showAllSeqs.addActionListener(new ActionListener()
1540     {
1541       @Override
1542       public void actionPerformed(ActionEvent e)
1543       {
1544         showAllSeqs_actionPerformed(e);
1545       }
1546     });
1547     JMenuItem showAllColumns = new JMenuItem(
1548             MessageManager.getString("label.all_columns"));
1549     showAllColumns.setToolTipText(
1550             MessageManager.getString("label.toggle_columns_visibility"));
1551     showAllColumns.addActionListener(new ActionListener()
1552     {
1553       @Override
1554       public void actionPerformed(ActionEvent e)
1555       {
1556         showAllColumns_actionPerformed(e);
1557       }
1558     });
1559     JMenu hideMenu = new JMenu(MessageManager.getString("action.hide"));
1560     JMenuItem hideSelSequences = new JMenuItem(
1561             MessageManager.getString("label.selected_sequences"));
1562     hideSelSequences.setToolTipText(
1563             MessageManager.getString("label.toggle_sequence_visibility"));
1564     hideSelSequences.addActionListener(new ActionListener()
1565     {
1566       @Override
1567       public void actionPerformed(ActionEvent e)
1568       {
1569         hideSelSequences_actionPerformed(e);
1570       }
1571     });
1572     JMenuItem hideSelColumns = new JMenuItem(
1573             MessageManager.getString("label.selected_columns"));
1574     hideSelColumns.setToolTipText(
1575             MessageManager.getString("label.toggle_columns_visibility"));
1576     hideSelColumns.addActionListener(new ActionListener()
1577     {
1578       @Override
1579       public void actionPerformed(ActionEvent e)
1580       {
1581         hideSelColumns_actionPerformed(e);
1582       }
1583     });
1584     JMenuItem hideAllSelection = new JMenuItem(
1585             MessageManager.getString("label.selected_region"));
1586     hideAllSelection.addActionListener(new ActionListener()
1587     {
1588       @Override
1589       public void actionPerformed(ActionEvent e)
1590       {
1591         hideAllSelection_actionPerformed(e);
1592       }
1593     });
1594     // TODO: should be hidden if no selection exists.
1595     JMenuItem hideAllButSelection = new JMenuItem(
1596             MessageManager.getString("label.all_but_selected_region"));
1597     hideAllButSelection.addActionListener(new ActionListener()
1598     {
1599       @Override
1600       public void actionPerformed(ActionEvent e)
1601       {
1602         hideAllButSelection_actionPerformed(e);
1603       }
1604     });
1605     JMenuItem showAllhidden = new JMenuItem(
1606             MessageManager.getString("label.all_sequences_columns"));
1607     showAllhidden.setToolTipText(MessageManager
1608             .getString("label.toggles_visibility_hidden_selected_regions"));
1609     showAllhidden.addActionListener(new ActionListener()
1610     {
1611       @Override
1612       public void actionPerformed(ActionEvent e)
1613       {
1614         showAllhidden_actionPerformed(e);
1615       }
1616     });
1617     hiddenMarkers.setText(
1618             MessageManager.getString("action.show_hidden_markers"));
1619     hiddenMarkers.addActionListener(new ActionListener()
1620     {
1621       @Override
1622       public void actionPerformed(ActionEvent e)
1623       {
1624         hiddenMarkers_actionPerformed(e);
1625       }
1626     });
1627   
1628     JMenuItem invertColSel = new JMenuItem(
1629             MessageManager.getString("action.invert_column_selection"));
1630     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I,
1631             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx()
1632                     | jalview.util.ShortcutKeyMaskExWrapper.ALT_DOWN_MASK,
1633             false);
1634     al = new ActionListener()
1635     {
1636       @Override
1637       public void actionPerformed(ActionEvent e)
1638       {
1639         invertColSel_actionPerformed(e);
1640       }
1641     };
1642     addMenuActionAndAccelerator(keyStroke, invertColSel, al);
1643   
1644     showComplementMenuItem.setVisible(false);
1645     showComplementMenuItem.addActionListener(new ActionListener()
1646     {
1647       @Override
1648       public void actionPerformed(ActionEvent e)
1649       {
1650         showComplement_actionPerformed(showComplementMenuItem.getState());
1651       }
1652     });
1653   
1654     tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()
1655     {
1656       @Override
1657       public void stateChanged(ChangeEvent evt)
1658       {
1659         JTabbedPane pane = (JTabbedPane) evt.getSource();
1660         int sel = pane.getSelectedIndex();
1661         tabSelectionChanged(sel);
1662       }
1663     });
1664     tabbedPane.addMouseListener(new MouseAdapter()
1665     {
1666       @Override
1667       public void mousePressed(MouseEvent e)
1668       {
1669         if (e.isPopupTrigger()) // Mac
1670         {
1671           tabbedPane_mousePressed(e);
1672         }
1673       }
1674   
1675       @Override
1676       public void mouseReleased(MouseEvent e)
1677       {
1678         if (e.isPopupTrigger()) // Windows
1679         {
1680           tabbedPane_mousePressed(e);
1681         }
1682       }
1683     });
1684     tabbedPane.addFocusListener(new FocusAdapter()
1685     {
1686       @Override
1687       public void focusGained(FocusEvent e)
1688       {
1689         tabbedPane_focusGained(e);
1690       }
1691     });
1692   
1693     JMenuItem save = new JMenuItem(MessageManager.getString("action.save"));
1694     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S,
1695             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false);
1696     al = new ActionListener()
1697     {
1698       @Override
1699       public void actionPerformed(ActionEvent e)
1700       {
1701         save_actionPerformed(e);
1702       }
1703     };
1704     addMenuActionAndAccelerator(keyStroke, save, al);
1705   
1706     reload.setEnabled(false);
1707     reload.setText(MessageManager.getString("action.reload"));
1708     reload.addActionListener(new ActionListener()
1709     {
1710       @Override
1711       public void actionPerformed(ActionEvent e)
1712       {
1713         reload_actionPerformed(e);
1714       }
1715     });
1716   
1717     JMenuItem newView = new JMenuItem(
1718             MessageManager.getString("action.new_view"));
1719     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_T,
1720             jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx(), false);
1721     al = new ActionListener()
1722     {
1723       @Override
1724       public void actionPerformed(ActionEvent e)
1725       {
1726         newView_actionPerformed(e);
1727       }
1728     };
1729     addMenuActionAndAccelerator(keyStroke, newView, al);
1730   
1731     tabbedPane.setToolTipText("<html><i>"
1732             + MessageManager.getString("label.rename_tab_eXpand_reGroup")
1733             + "</i></html>");
1734   
1735     formatMenu.setText(MessageManager.getString("action.format"));
1736     JMenu selectMenu = new JMenu(MessageManager.getString("action.select"));
1737
1738     idRightAlign.setText(
1739             MessageManager.getString("label.right_align_sequence_id"));
1740     idRightAlign.addActionListener(new ActionListener()
1741     {
1742       @Override
1743       public void actionPerformed(ActionEvent e)
1744       {
1745         idRightAlign_actionPerformed(e);
1746       }
1747     });
1748   
1749     gatherViews.setEnabled(false);
1750     gatherViews.setText(MessageManager.getString("action.gather_views"));
1751     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, 0, false);
1752     al = new ActionListener()
1753     {
1754       @Override
1755       public void actionPerformed(ActionEvent e)
1756       {
1757         gatherViews_actionPerformed(e);
1758       }
1759     };
1760     addMenuActionAndAccelerator(keyStroke, gatherViews, al);
1761   
1762     expandViews.setEnabled(false);
1763     expandViews.setText(MessageManager.getString("action.expand_views"));
1764     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_X, 0, false);
1765     al = new ActionListener()
1766     {
1767       @Override
1768       public void actionPerformed(ActionEvent e)
1769       {
1770         expandViews_actionPerformed(e);
1771       }
1772     };
1773     addMenuActionAndAccelerator(keyStroke, expandViews, al);
1774   
1775     JMenuItem pageSetup = new JMenuItem(
1776             MessageManager.getString("action.page_setup"));
1777     pageSetup.addActionListener(new ActionListener()
1778     {
1779       @Override
1780       public void actionPerformed(ActionEvent e)
1781       {
1782         pageSetup_actionPerformed(e);
1783       }
1784     });
1785     JMenuItem alignmentProperties = new JMenuItem(
1786             MessageManager.getString("label.alignment_props"));
1787     alignmentProperties.addActionListener(new ActionListener()
1788     {
1789       @Override
1790       public void actionPerformed(ActionEvent actionEvent)
1791       {
1792         alignmentProperties();
1793       }
1794     });
1795     JMenuItem selectHighlighted = new JMenuItem(
1796             MessageManager.getString("action.select_highlighted_columns"));
1797     selectHighlighted.setToolTipText(
1798             MessageManager.getString("tooltip.select_highlighted_columns"));
1799     al = new ActionListener()
1800     {
1801       @Override
1802       public void actionPerformed(ActionEvent actionEvent)
1803       {
1804         selectHighlightedColumns_actionPerformed(actionEvent);
1805       }
1806     };
1807     JMenuItem Filter = new JMenuItem(
1808             MessageManager.getString("action.select_highlighted_columns"));
1809     selectHighlighted.setToolTipText(
1810             MessageManager.getString("tooltip.select_highlighted_columns"));
1811     al = new ActionListener()
1812     {
1813       @Override
1814       public void actionPerformed(ActionEvent actionEvent)
1815       {
1816         selectHighlightedColumns_actionPerformed(actionEvent);
1817       }
1818     };
1819     selectHighlighted.addActionListener(al);
1820     JMenu tooltipSettingsMenu = new JMenu(
1821             MessageManager.getString("label.sequence_id_tooltip"));
1822     JMenu autoAnnMenu = new JMenu(
1823             MessageManager.getString("label.autocalculated_annotation"));
1824   
1825     JMenu exportImageMenu = new JMenu(
1826             MessageManager.getString("label.export_image"));
1827     JMenu fileMenu = new JMenu(MessageManager.getString("action.file"));
1828     alignFrameMenuBar.add(fileMenu);
1829     alignFrameMenuBar.add(editMenu);
1830     alignFrameMenuBar.add(selectMenu);
1831     alignFrameMenuBar.add(viewMenu);
1832     alignFrameMenuBar.add(annotationsMenu);
1833     alignFrameMenuBar.add(formatMenu);
1834     alignFrameMenuBar.add(colourMenu);
1835     alignFrameMenuBar.add(calculateMenu);
1836     if (!Platform.isJS())
1837     {
1838       alignFrameMenuBar.add(webService);
1839       alignFrameMenuBar.add(hmmerMenu);
1840     }
1841   
1842     fileMenu.add(fetchSequence);
1843     fileMenu.add(addSequenceMenu);
1844     fileMenu.add(reload);
1845     fileMenu.addSeparator();
1846     fileMenu.add(vamsasStore);
1847     fileMenu.add(save);
1848     fileMenu.add(saveAs);
1849     fileMenu.add(outputTextboxMenu);
1850     fileMenu.add(pageSetup);
1851     fileMenu.add(printMenuItem);
1852     fileMenu.addSeparator();
1853     fileMenu.add(exportImageMenu);
1854     fileMenu.add(exportFeatures);
1855     fileMenu.add(exportAnnotations);
1856     fileMenu.add(loadTreeMenuItem);
1857     fileMenu.add(associatedData);
1858     if (!Platform.isJS())
1859     {
1860       fileMenu.add(loadVcf);
1861     }
1862     fileMenu.addSeparator();
1863     fileMenu.add(closeMenuItem);
1864   
1865     pasteMenu.add(pasteNew);
1866     pasteMenu.add(pasteThis);
1867     editMenu.add(undoMenuItem);
1868     editMenu.add(redoMenuItem);
1869     editMenu.add(cut);
1870     editMenu.add(copy);
1871     editMenu.add(pasteMenu);
1872     editMenu.add(delete);
1873     editMenu.addSeparator();
1874     editMenu.add(remove2LeftMenuItem);
1875     editMenu.add(remove2RightMenuItem);
1876     editMenu.add(removeGappedColumnMenuItem);
1877     editMenu.add(removeAllGapsMenuItem);
1878     editMenu.add(removeRedundancyMenuItem);
1879     editMenu.addSeparator();
1880     // dont add these yet in the CVS build - they cannot be undone!
1881     // Excluded from Jalview 2.5 release - undo needs to be implemented.
1882     // editMenu.add(justifyLeftMenuItem);
1883     // editMenu.add(justifyRightMenuItem);
1884     // editMenu.addSeparator();
1885     editMenu.add(padGapsMenuitem);
1886     editMenu.addSeparator();
1887     editMenu.add(filterByEValue);
1888     editMenu.add(filterByScore);
1889   
1890     showMenu.add(showAllColumns);
1891     showMenu.add(showAllSeqs);
1892     showMenu.add(showAllhidden);
1893     hideMenu.add(hideSelColumns);
1894     hideMenu.add(hideSelSequences);
1895     hideMenu.add(hideAllSelection);
1896     hideMenu.add(hideAllButSelection);
1897     viewMenu.add(newView);
1898     viewMenu.add(expandViews);
1899     viewMenu.add(gatherViews);
1900     viewMenu.addSeparator();
1901     viewMenu.add(showMenu);
1902     viewMenu.add(hideMenu);
1903     viewMenu.add(showComplementMenuItem);
1904     viewMenu.addSeparator();
1905     viewMenu.add(followHighlightMenuItem);
1906     viewMenu.addSeparator();
1907     viewMenu.add(showSeqFeatures);
1908     // viewMenu.add(showSeqFeaturesHeight);
1909     viewMenu.add(openFeatureSettings);
1910     tooltipSettingsMenu.add(showDbRefsMenuitem);
1911     tooltipSettingsMenu.add(showNpFeatsMenuitem);
1912     viewMenu.add(tooltipSettingsMenu);
1913     viewMenu.addSeparator();
1914     viewMenu.add(alignmentProperties);
1915     viewMenu.addSeparator();
1916     viewMenu.add(overviewMenuItem);
1917   
1918     annotationsMenu.add(annotationPanelMenuItem);
1919     annotationsMenu.addSeparator();
1920     annotationsMenu.add(showAllAlAnnotations);
1921     annotationsMenu.add(hideAllAlAnnotations);
1922     annotationsMenu.addSeparator();
1923     annotationsMenu.add(showAllSeqAnnotations);
1924     annotationsMenu.add(hideAllSeqAnnotations);
1925     annotationsMenu.add(sortAnnBySequence);
1926     annotationsMenu.add(sortAnnByLabel);
1927     annotationsMenu.addSeparator();
1928     autoAnnMenu.add(showAutoFirst);
1929     autoAnnMenu.add(showAutoLast);
1930     autoAnnMenu.addSeparator();
1931     autoAnnMenu.add(applyAutoAnnotationSettings);
1932     autoAnnMenu.add(showConsensusHistogram);
1933     autoAnnMenu.add(showSequenceLogo);
1934     autoAnnMenu.add(normaliseSequenceLogo);
1935     autoAnnMenu.addSeparator();
1936     autoAnnMenu.add(showGroupConservation);
1937     autoAnnMenu.add(showGroupConsensus);
1938     annotationsMenu.add(autoAnnMenu);
1939
1940     sort.add(sortIDMenuItem);
1941     sort.add(sortLengthMenuItem);
1942     sort.add(sortGroupMenuItem);
1943     sort.add(sortPairwiseMenuItem);
1944     sort.add(sortEValueMenuItem);
1945     sort.add(sortBitScoreMenuItem);
1946     sort.add(sortByTreeMenu);
1947     calculateMenu.add(sort);
1948     calculateMenu.add(calculateTree);
1949     calculateMenu.addSeparator();
1950     calculateMenu.add(pairwiseAlignmentMenuItem);
1951     calculateMenu.addSeparator();
1952     calculateMenu.add(showTranslation);
1953     calculateMenu.add(showReverse);
1954     calculateMenu.add(showReverseComplement);
1955     calculateMenu.add(showProducts);
1956     calculateMenu.add(autoCalculate);
1957     calculateMenu.add(sortByTree);
1958     calculateMenu.addSeparator();
1959     calculateMenu.add(expandAlignment);
1960     calculateMenu.add(extractScores);
1961     if (!Platform.isJS())
1962     {
1963       calculateMenu.addSeparator();
1964       calculateMenu.add(runGroovy);
1965     }
1966     webServiceNoServices = new JMenuItem(
1967             MessageManager.getString("label.no_services"));
1968     webService.add(webServiceNoServices);
1969     if (!Platform.isJS())
1970     {
1971       exportImageMenu.add(htmlMenuItem);
1972     }
1973     exportImageMenu.add(epsFile);
1974     exportImageMenu.add(createPNG);
1975     if (!Platform.isJS())
1976     {
1977       exportImageMenu.add(createBioJS);
1978       exportImageMenu.add(createSVG);
1979     }
1980     addSequenceMenu.add(addFromFile);
1981     addSequenceMenu.add(addFromText);
1982     addSequenceMenu.add(addFromURL);
1983     this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH);
1984     statusPanel.add(statusBar, null);
1985     this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
1986   
1987     formatMenu.add(font);
1988     formatMenu.addSeparator();
1989     formatMenu.add(wrapMenuItem);
1990     formatMenu.add(scaleAbove);
1991     formatMenu.add(scaleLeft);
1992     formatMenu.add(scaleRight);
1993     formatMenu.add(seqLimits);
1994     formatMenu.add(idRightAlign);
1995     formatMenu.add(hiddenMarkers);
1996     formatMenu.add(viewBoxesMenuItem);
1997     formatMenu.add(viewTextMenuItem);
1998     formatMenu.add(colourTextMenuItem);
1999     formatMenu.add(renderGapsMenuItem);
2000     formatMenu.add(centreColumnLabelsMenuItem);
2001     formatMenu.add(showNonconservedMenuItem);
2002     selectMenu.add(findMenuItem);
2003     selectMenu.addSeparator();
2004     selectMenu.add(selectAllSequenceMenuItem);
2005     selectMenu.add(deselectAllSequenceMenuItem);
2006     selectMenu.add(invertSequenceMenuItem);
2007     selectMenu.add(invertColSel);
2008     selectMenu.add(createGroup);
2009     selectMenu.add(unGroup);
2010     selectMenu.add(grpsFromSelection);
2011     selectMenu.add(deleteGroups);
2012     selectMenu.add(annotationColumn);
2013     selectMenu.add(selectHighlighted);
2014     // TODO - determine if the listenToViewSelections button is needed : see bug
2015     // JAL-574
2016     // selectMenu.addSeparator();
2017     // selectMenu.add(listenToViewSelections);
2018   }
2019
2020   /**
2021    * Constructs the entries on the HMMER menu
2022    */
2023   protected void initHMMERMenu()
2024   {
2025     /*
2026      * hmmbuild
2027      */
2028     JMenu hmmBuild = new JMenu(MessageManager.getString("label.hmmbuild"));
2029     JMenuItem hmmBuildSettings = new JMenuItem(
2030             MessageManager.getString("label.edit_settings_and_run"));
2031     hmmBuildSettings.addActionListener(new ActionListener()
2032     {
2033       @Override
2034       public void actionPerformed(ActionEvent e)
2035       {
2036         hmmBuild_actionPerformed(false);
2037       }
2038     });
2039     JMenuItem hmmBuildRun = new JMenuItem(MessageManager.formatMessage(
2040             "label.action_with_default_settings", "hmmbuild"));
2041     hmmBuildRun.addActionListener(new ActionListener()
2042     {
2043       @Override
2044       public void actionPerformed(ActionEvent e)
2045       {
2046         hmmBuild_actionPerformed(true);
2047       }
2048     });
2049     hmmBuild.add(hmmBuildRun);
2050     hmmBuild.add(hmmBuildSettings);
2051
2052     /*
2053      * hmmalign
2054      */
2055     JMenu hmmAlign = new JMenu(MessageManager.getString("label.hmmalign"));
2056     JMenuItem hmmAlignRun = new JMenuItem(MessageManager.formatMessage(
2057             "label.action_with_default_settings", "hmmalign"));
2058     hmmAlignRun.addActionListener(new ActionListener()
2059     {
2060       @Override
2061       public void actionPerformed(ActionEvent e)
2062       {
2063         hmmAlign_actionPerformed(true);
2064       }
2065     });
2066     JMenuItem hmmAlignSettings = new JMenuItem(
2067             MessageManager.getString("label.edit_settings_and_run"));
2068     hmmAlignSettings.addActionListener(new ActionListener()
2069     {
2070       @Override
2071       public void actionPerformed(ActionEvent e)
2072       {
2073         hmmAlign_actionPerformed(false);
2074       }
2075     });
2076     hmmAlign.add(hmmAlignRun);
2077     hmmAlign.add(hmmAlignSettings);
2078
2079     /*
2080      * hmmsearch
2081      */
2082     JMenu hmmSearch = new JMenu(
2083             MessageManager.getString("label.hmmsearch"));
2084     JMenuItem hmmSearchSettings = new JMenuItem(
2085             MessageManager.getString("label.edit_settings_and_run"));
2086     hmmSearchSettings.addActionListener(new ActionListener()
2087     {
2088       @Override
2089       public void actionPerformed(ActionEvent e)
2090       {
2091         hmmSearch_actionPerformed(false);
2092       }
2093     });
2094     JMenuItem hmmSearchRun = new JMenuItem(MessageManager.formatMessage(
2095             "label.action_with_default_settings", "hmmsearch"));
2096     hmmSearchRun.addActionListener(new ActionListener()
2097     {
2098       @Override
2099       public void actionPerformed(ActionEvent e)
2100       {
2101         hmmSearch_actionPerformed(true);
2102       }
2103     });
2104     JMenuItem addDatabase = new JMenuItem(
2105             MessageManager.getString("label.add_database"));
2106     addDatabase.addActionListener(new ActionListener()
2107     {
2108       @Override
2109       public void actionPerformed(ActionEvent e)
2110       {
2111         try
2112         {
2113           addDatabase_actionPerformed();
2114         } catch (IOException e1)
2115         {
2116           e1.printStackTrace();
2117         }
2118       }
2119     });
2120     hmmSearch.add(hmmSearchRun);
2121     hmmSearch.add(hmmSearchSettings);
2122     // hmmSearch.add(addDatabase);
2123
2124     /*
2125      * jackhmmer
2126      */
2127     JMenu jackhmmer = new JMenu(
2128             MessageManager.getString("label.jackhmmer"));
2129     JMenuItem jackhmmerSettings = new JMenuItem(
2130             MessageManager.getString("label.edit_settings_and_run"));
2131     jackhmmerSettings.addActionListener(new ActionListener()
2132     {
2133       @Override
2134       public void actionPerformed(ActionEvent e)
2135       {
2136         jackhmmer_actionPerformed(false);
2137       }
2138     });
2139     JMenuItem jackhmmerRun = new JMenuItem(MessageManager.formatMessage(
2140             "label.action_with_default_settings", "jackhmmer"));
2141     jackhmmerRun.addActionListener(new ActionListener()
2142     {
2143       @Override
2144       public void actionPerformed(ActionEvent e)
2145       {
2146         jackhmmer_actionPerformed(true);
2147       }
2148
2149     });
2150     /*
2151     JMenuItem addDatabase = new JMenuItem(
2152             MessageManager.getString("label.add_database"));
2153     addDatabase.addActionListener(new ActionListener()
2154     {
2155       @Override
2156       public void actionPerformed(ActionEvent e)
2157       {
2158         try
2159         {
2160           addDatabase_actionPerformed();
2161         } catch (IOException e1)
2162         {
2163           e1.printStackTrace();
2164         }
2165       }
2166     });
2167     */
2168     jackhmmer.add(jackhmmerRun);
2169     jackhmmer.add(jackhmmerSettings);
2170     // hmmSearch.add(addDatabase);
2171
2172     /*
2173      * top level menu
2174      */
2175     hmmerMenu.setText(MessageManager.getString("action.hmmer"));
2176     hmmerMenu.setEnabled(HmmerCommand.isHmmerAvailable());
2177     hmmerMenu.add(hmmBuild);
2178     hmmerMenu.add(hmmAlign);
2179     hmmerMenu.add(hmmSearch);
2180     hmmerMenu.add(jackhmmer);
2181
2182   }
2183
2184   protected void loadVcf_actionPerformed()
2185   {
2186   }
2187
2188   /**
2189    * Constructs the entries on the Colour menu (but does not add them to the
2190    * menu).
2191    */
2192   protected void initColourMenu()
2193   {
2194     applyToAllGroups = new JCheckBoxMenuItem(
2195             MessageManager.getString("label.apply_colour_to_all_groups"));
2196     applyToAllGroups.addActionListener(new ActionListener()
2197     {
2198       @Override
2199       public void actionPerformed(ActionEvent e)
2200       {
2201         applyToAllGroups_actionPerformed(applyToAllGroups.isSelected());
2202       }
2203     });
2204
2205     textColour = new JMenuItem(
2206             MessageManager.getString("label.text_colour"));
2207     textColour.addActionListener(new ActionListener()
2208     {
2209       @Override
2210       public void actionPerformed(ActionEvent e)
2211       {
2212         textColour_actionPerformed();
2213       }
2214     });
2215
2216     conservationMenuItem = new JCheckBoxMenuItem(
2217             MessageManager.getString("action.by_conservation"));
2218     conservationMenuItem.addActionListener(new ActionListener()
2219     {
2220       @Override
2221       public void actionPerformed(ActionEvent e)
2222       {
2223         conservationMenuItem_actionPerformed(
2224                 conservationMenuItem.isSelected());
2225       }
2226     });
2227
2228     abovePIDThreshold = new JCheckBoxMenuItem(
2229             MessageManager.getString("label.above_identity_threshold"));
2230     abovePIDThreshold.addActionListener(new ActionListener()
2231     {
2232       @Override
2233       public void actionPerformed(ActionEvent e)
2234       {
2235         abovePIDThreshold_actionPerformed(abovePIDThreshold.isSelected());
2236       }
2237     });
2238     modifyPID = new JMenuItem(
2239             MessageManager.getString("label.modify_identity_threshold"));
2240     modifyPID.addActionListener(new ActionListener()
2241     {
2242       @Override
2243       public void actionPerformed(ActionEvent e)
2244       {
2245         modifyPID_actionPerformed();
2246       }
2247     });
2248     modifyConservation = new JMenuItem(MessageManager
2249             .getString("label.modify_conservation_threshold"));
2250     modifyConservation.addActionListener(new ActionListener()
2251     {
2252       @Override
2253       public void actionPerformed(ActionEvent e)
2254       {
2255         modifyConservation_actionPerformed();
2256       }
2257     });
2258
2259     annotationColour = new JRadioButtonMenuItem(
2260             MessageManager.getString("action.by_annotation"));
2261     annotationColour.setName(ResidueColourScheme.ANNOTATION_COLOUR);
2262     annotationColour.addActionListener(new ActionListener()
2263     {
2264       @Override
2265       public void actionPerformed(ActionEvent e)
2266       {
2267         annotationColour_actionPerformed();
2268       }
2269     });
2270   }
2271
2272   protected void selectHighlightedColumns_actionPerformed(
2273           ActionEvent actionEvent)
2274   {
2275     // TODO Auto-generated method stub
2276
2277   }
2278
2279   /**
2280    * Generate the reverse sequence (or reverse complement if the flag is true)
2281    * and add it to the alignment
2282    * 
2283    * @param complement
2284    */
2285   protected void showReverse_actionPerformed(boolean complement)
2286   {
2287   }
2288
2289   /**
2290    * Try to run script in a Groovy console, having first ensured that this
2291    * alignframe is set as currentAlignFrame in Desktop
2292    */
2293   protected void runGroovy_actionPerformed()
2294   {
2295
2296   }
2297
2298   /**
2299    * Adds the given action listener and key accelerator to the given menu item.
2300    * Also saves in a lookup table to support lookup of action by key stroke.
2301    * 
2302    * @param keyStroke
2303    * @param menuItem
2304    * @param actionListener
2305    */
2306   protected void addMenuActionAndAccelerator(KeyStroke keyStroke,
2307           JMenuItem menuItem, ActionListener actionListener)
2308   {
2309     menuItem.setAccelerator(keyStroke);
2310     accelerators.put(keyStroke, menuItem);
2311     menuItem.addActionListener(actionListener);
2312   }
2313
2314   /**
2315    * Action on clicking sort annotations by type.
2316    * 
2317    * @param sortOrder
2318    */
2319   protected void sortAnnotations_actionPerformed()
2320   {
2321   }
2322
2323   /**
2324    * Action on clicking Show all annotations.
2325    * 
2326    * @param forSequences
2327    *          update sequence-related annotations
2328    * @param forAlignment
2329    *          update non-sequence-related annotations
2330    */
2331   protected void showAllAnnotations_actionPerformed(boolean forSequences,
2332           boolean forAlignment)
2333   {
2334     setAnnotationsVisibility(true, forSequences, forAlignment);
2335   }
2336
2337   /**
2338    * Action on clicking Hide all annotations.
2339    * 
2340    * @param forSequences
2341    *          update sequence-related annotations
2342    * @param forAlignment
2343    *          update non-sequence-related annotations
2344    */
2345   protected void hideAllAnnotations_actionPerformed(boolean forSequences,
2346           boolean forAlignment)
2347   {
2348     setAnnotationsVisibility(false, forSequences, forAlignment);
2349   }
2350
2351   /**
2352    * Set the visibility of annotations to true or false. Can act on
2353    * sequence-related annotations, or alignment-related, or both.
2354    * 
2355    * @param visible
2356    * @param forSequences
2357    *          update sequence-related annotations
2358    * @param forAlignment
2359    *          update non-sequence-related annotations
2360    */
2361   protected void setAnnotationsVisibility(boolean visible,
2362           boolean forSequences, boolean forAlignment)
2363   {
2364
2365   }
2366
2367   protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
2368   {
2369     // TODO Auto-generated method stub
2370
2371   }
2372
2373   protected void listenToViewSelections_actionPerformed(ActionEvent e)
2374   {
2375     // TODO Auto-generated method stub
2376
2377   }
2378
2379   protected void showAllhidden_actionPerformed(ActionEvent e)
2380   {
2381     // TODO Auto-generated method stub
2382
2383   }
2384
2385   protected void hideAllButSelection_actionPerformed(ActionEvent e)
2386   {
2387     // TODO Auto-generated method stub
2388
2389   }
2390
2391   protected void hideAllSelection_actionPerformed(ActionEvent e)
2392   {
2393     // TODO Auto-generated method stub
2394
2395   }
2396
2397   protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
2398   {
2399     // TODO Auto-generated method stub
2400
2401   }
2402
2403   protected void showConsensusHistogram_actionPerformed(ActionEvent e)
2404   {
2405     // TODO Auto-generated method stub
2406
2407   }
2408
2409   protected void showSequenceLogo_actionPerformed(ActionEvent e)
2410   {
2411     // TODO Auto-generated method stub
2412
2413   }
2414
2415   protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
2416   {
2417     // TODO Auto-generated method stub
2418
2419   }
2420
2421   protected void showGroupConsensus_actionPerformed(ActionEvent e)
2422   {
2423     // TODO Auto-generated method stub
2424
2425   }
2426
2427   protected void showGroupConservation_actionPerformed(ActionEvent e)
2428   {
2429     // TODO Auto-generated method stub
2430
2431   }
2432
2433   protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
2434   {
2435     // TODO Auto-generated method stub
2436
2437   }
2438
2439   protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
2440   {
2441     // TODO Auto-generated method stub
2442
2443   }
2444
2445   protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
2446   {
2447     // TODO Auto-generated method stub
2448
2449   }
2450
2451   protected void followHighlight_actionPerformed()
2452   {
2453     // TODO Auto-generated method stub
2454
2455   }
2456
2457   protected void showNpFeats_actionPerformed(ActionEvent e)
2458   {
2459     // TODO Auto-generated method stub
2460
2461   }
2462
2463   protected void showDbRefs_actionPerformed(ActionEvent e)
2464   {
2465     // TODO Auto-generated method stub
2466
2467   }
2468
2469   protected void centreColumnLabels_actionPerformed(ActionEvent e)
2470   {
2471   }
2472
2473   protected void buildSortByAnnotationScoresMenu()
2474   {
2475   }
2476
2477   protected void extractScores_actionPerformed(ActionEvent e)
2478   {
2479   }
2480
2481   protected void outputText_actionPerformed(String formatName)
2482   {
2483   }
2484
2485   public void addFromFile_actionPerformed(ActionEvent e)
2486   {
2487
2488   }
2489
2490   public void addFromText_actionPerformed(ActionEvent e)
2491   {
2492
2493   }
2494
2495   public void addFromURL_actionPerformed(ActionEvent e)
2496   {
2497
2498   }
2499
2500   public void exportFeatures_actionPerformed(ActionEvent e)
2501   {
2502
2503   }
2504
2505   public void exportAnnotations_actionPerformed(ActionEvent e)
2506   {
2507
2508   }
2509
2510   protected void htmlMenuItem_actionPerformed(ActionEvent e)
2511   {
2512   }
2513
2514   protected void bioJSMenuItem_actionPerformed(ActionEvent e)
2515   {
2516
2517   }
2518
2519   protected void closeMenuItem_actionPerformed(boolean b)
2520   {
2521   }
2522
2523   protected void redoMenuItem_actionPerformed(ActionEvent e)
2524   {
2525   }
2526
2527   protected void undoMenuItem_actionPerformed(ActionEvent e)
2528   {
2529   }
2530
2531   protected void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
2532   {
2533   }
2534
2535   protected void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
2536   {
2537   }
2538
2539   protected void invertSequenceMenuItem_actionPerformed(ActionEvent e)
2540   {
2541   }
2542
2543   protected void remove2LeftMenuItem_actionPerformed(ActionEvent e)
2544   {
2545   }
2546
2547   protected void remove2RightMenuItem_actionPerformed(ActionEvent e)
2548   {
2549   }
2550
2551   protected void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
2552   {
2553   }
2554
2555   protected void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
2556   {
2557   }
2558
2559   protected void wrapMenuItem_actionPerformed(ActionEvent e)
2560   {
2561   }
2562
2563   protected void viewBoxesMenuItem_actionPerformed(ActionEvent e)
2564   {
2565   }
2566
2567   protected void viewTextMenuItem_actionPerformed(ActionEvent e)
2568   {
2569   }
2570
2571   protected void colourTextMenuItem_actionPerformed(ActionEvent e)
2572   {
2573   }
2574
2575   protected void annotationPanelMenuItem_actionPerformed(ActionEvent e)
2576   {
2577   }
2578
2579   protected void overviewMenuItem_actionPerformed(ActionEvent e)
2580   {
2581   }
2582
2583   protected void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
2584   {
2585   }
2586
2587   protected void sortIDMenuItem_actionPerformed(ActionEvent e)
2588   {
2589   }
2590
2591   protected void sortLengthMenuItem_actionPerformed(ActionEvent e)
2592   {
2593   }
2594
2595   protected void sortGroupMenuItem_actionPerformed(ActionEvent e)
2596   {
2597   }
2598
2599   protected void sortEValueMenuItem_actionPerformed(ActionEvent e)
2600   {
2601   }
2602
2603   protected void sortBitScoreMenuItem_actionPerformed(ActionEvent e)
2604   {
2605   }
2606
2607   protected void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
2608   {
2609   }
2610
2611   protected void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
2612   {
2613   }
2614
2615   protected void neighbourTreeMenuItem_actionPerformed(ActionEvent e)
2616   {
2617   }
2618
2619   protected void conservationMenuItem_actionPerformed(boolean selected)
2620   {
2621   }
2622
2623   protected void printMenuItem_actionPerformed(ActionEvent e)
2624   {
2625   }
2626
2627   protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
2628   {
2629   }
2630
2631   protected void findMenuItem_actionPerformed(ActionEvent e)
2632   {
2633   }
2634
2635   protected void abovePIDThreshold_actionPerformed(boolean selected)
2636   {
2637   }
2638
2639   public void showSeqFeatures_actionPerformed(ActionEvent actionEvent)
2640   {
2641   }
2642
2643   protected void deleteGroups_actionPerformed(ActionEvent e)
2644   {
2645   }
2646
2647   protected void createGroup_actionPerformed(ActionEvent e)
2648   {
2649   }
2650
2651   protected void unGroup_actionPerformed(ActionEvent e)
2652   {
2653   }
2654
2655   protected void copy_actionPerformed()
2656   {
2657   }
2658
2659   protected void cut_actionPerformed()
2660   {
2661   }
2662
2663   protected void delete_actionPerformed()
2664   {
2665   }
2666
2667   protected void pasteNew_actionPerformed(ActionEvent e)
2668           throws IOException, InterruptedException
2669   {
2670   }
2671
2672   protected void pasteThis_actionPerformed(ActionEvent e)
2673           throws IOException, InterruptedException
2674   {
2675   }
2676
2677   protected void applyToAllGroups_actionPerformed(boolean selected)
2678   {
2679   }
2680
2681   protected void hmmBuild_actionPerformed(boolean withDefaults)
2682   {
2683   }
2684
2685   protected void hmmSearch_actionPerformed(boolean withDefaults)
2686   {
2687   }
2688
2689   protected void jackhmmer_actionPerformed(boolean b)
2690   {
2691   }
2692
2693   protected void addDatabase_actionPerformed()
2694           throws FileFormatException, IOException
2695   {
2696   }
2697
2698   protected void hmmAlign_actionPerformed(boolean withDefaults)
2699   {
2700   }
2701
2702   public void createPNG(java.io.File f)
2703   {
2704   }
2705
2706   protected void font_actionPerformed(ActionEvent e)
2707   {
2708   }
2709
2710   protected void seqLimit_actionPerformed(ActionEvent e)
2711   {
2712   }
2713
2714   public void seqDBRef_actionPerformed(ActionEvent e)
2715   {
2716
2717   }
2718
2719   public void createEPS(java.io.File f)
2720   {
2721   }
2722
2723   public void createSVG(java.io.File f)
2724   {
2725
2726   }
2727
2728   protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
2729   {
2730
2731   }
2732
2733   /**
2734    * Template method to handle the 'load T-Coffee scores' menu event.
2735    * <p>
2736    * Subclasses override this method to provide a custom action.
2737    * 
2738    * @param event
2739    *          The raised event
2740    */
2741   protected void loadScores_actionPerformed(ActionEvent event)
2742   {
2743
2744   }
2745
2746   protected void jpred_actionPerformed(ActionEvent e)
2747   {
2748   }
2749
2750   protected void scaleAbove_actionPerformed(ActionEvent e)
2751   {
2752   }
2753
2754   protected void scaleLeft_actionPerformed(ActionEvent e)
2755   {
2756   }
2757
2758   protected void filterByEValue_actionPerformed()
2759   {
2760   }
2761
2762   protected void filterByScore_actionPerformed()
2763   {
2764   }
2765
2766   protected void scaleRight_actionPerformed(ActionEvent e)
2767   {
2768   }
2769
2770   protected void modifyPID_actionPerformed()
2771   {
2772   }
2773
2774   protected void modifyConservation_actionPerformed()
2775   {
2776   }
2777
2778   protected void saveAs_actionPerformed()
2779   {
2780   }
2781
2782   protected void padGapsMenuitem_actionPerformed(ActionEvent e)
2783   {
2784   }
2785
2786   public void vamsasStore_actionPerformed(ActionEvent e)
2787   {
2788
2789   }
2790
2791   public void vamsasLoad_actionPerformed(ActionEvent e)
2792   {
2793
2794   }
2795
2796   public void showTranslation_actionPerformed(GeneticCodeI codeTable)
2797   {
2798
2799   }
2800
2801   public void featureSettings_actionPerformed(ActionEvent e)
2802   {
2803
2804   }
2805
2806   public void fetchSequence_actionPerformed()
2807   {
2808
2809   }
2810
2811   public void smoothFont_actionPerformed(ActionEvent e)
2812   {
2813
2814   }
2815
2816   public void annotationColour_actionPerformed()
2817   {
2818   }
2819
2820   public void annotationColumn_actionPerformed(ActionEvent e)
2821   {
2822   }
2823
2824   public void associatedData_actionPerformed(ActionEvent e)
2825           throws IOException, InterruptedException
2826   {
2827
2828   }
2829
2830   public void autoCalculate_actionPerformed(ActionEvent e)
2831   {
2832
2833   }
2834
2835   public void sortByTreeOption_actionPerformed(ActionEvent e)
2836   {
2837
2838   }
2839
2840   public void showAllSeqs_actionPerformed(ActionEvent e)
2841   {
2842
2843   }
2844
2845   public void showAllColumns_actionPerformed(ActionEvent e)
2846   {
2847
2848   }
2849
2850   public void hideSelSequences_actionPerformed(ActionEvent e)
2851   {
2852
2853   }
2854
2855   public void hideSelColumns_actionPerformed(ActionEvent e)
2856   {
2857
2858   }
2859
2860   public void hiddenMarkers_actionPerformed(ActionEvent e)
2861   {
2862
2863   }
2864
2865   public void findPdbId_actionPerformed(ActionEvent e)
2866   {
2867
2868   }
2869
2870   public void enterPdbId_actionPerformed(ActionEvent e)
2871   {
2872
2873   }
2874
2875   public void pdbFile_actionPerformed(ActionEvent e)
2876   {
2877
2878   }
2879
2880   public void invertColSel_actionPerformed(ActionEvent e)
2881   {
2882
2883   }
2884
2885   public void tabSelectionChanged(int sel)
2886   {
2887
2888   }
2889
2890   public void tabbedPane_mousePressed(MouseEvent e)
2891   {
2892
2893   }
2894
2895   public void tabbedPane_focusGained(FocusEvent e)
2896   {
2897     requestFocus();
2898   }
2899
2900   public void save_actionPerformed(ActionEvent e)
2901   {
2902
2903   }
2904
2905   public void reload_actionPerformed(ActionEvent e)
2906   {
2907
2908   }
2909
2910   public void newView_actionPerformed(ActionEvent e)
2911   {
2912
2913   }
2914
2915   public void textColour_actionPerformed()
2916   {
2917
2918   }
2919
2920   public void idRightAlign_actionPerformed(ActionEvent e)
2921   {
2922
2923   }
2924
2925   public void expandViews_actionPerformed(ActionEvent e)
2926   {
2927
2928   }
2929
2930   public void gatherViews_actionPerformed(ActionEvent e)
2931   {
2932
2933   }
2934
2935   public void buildTreeSortMenu()
2936   {
2937
2938   }
2939
2940   public void pageSetup_actionPerformed(ActionEvent e)
2941   {
2942
2943   }
2944
2945   public void alignmentProperties()
2946   {
2947
2948   }
2949
2950   protected void expand_newalign(ActionEvent e)
2951   {
2952     // TODO Auto-generated method stub
2953
2954   }
2955
2956   protected boolean isShowAutoCalculatedAbove()
2957   {
2958     return showAutoCalculatedAbove;
2959   }
2960
2961   protected void setShowAutoCalculatedAbove(boolean showAutoCalculatedAbove)
2962   {
2963     this.showAutoCalculatedAbove = showAutoCalculatedAbove;
2964   }
2965
2966   protected SequenceAnnotationOrder getAnnotationSortOrder()
2967   {
2968     return annotationSortOrder;
2969   }
2970
2971   protected void setAnnotationSortOrder(
2972           SequenceAnnotationOrder annotationSortOrder)
2973   {
2974     this.annotationSortOrder = annotationSortOrder;
2975   }
2976
2977   public Map<KeyStroke, JMenuItem> getAccelerators()
2978   {
2979     return this.accelerators;
2980   }
2981
2982   /**
2983    * Returns the selected index of the tabbed pane, or -1 if none selected
2984    * (including the case where the tabbed pane has not been made visible).
2985    * 
2986    * @return
2987    */
2988   public int getTabIndex()
2989   {
2990     return tabbedPane.getSelectedIndex();
2991   }
2992
2993   public JPanel getStatusPanel()
2994   {
2995     return statusPanel;
2996   }
2997
2998   /**
2999    * Sets a reference to the containing split frame. Also makes the 'toggle
3000    * split view' menu item visible and checked.
3001    * 
3002    * @param sf
3003    */
3004   public void setSplitFrame(SplitContainerI sf)
3005   {
3006     this.splitFrame = sf;
3007     if (sf != null)
3008     {
3009       this.showComplementMenuItem.setVisible(true);
3010       this.showComplementMenuItem.setState(true);
3011     }
3012   }
3013
3014   public SplitContainerI getSplitViewContainer()
3015   {
3016     return this.splitFrame;
3017   }
3018
3019   protected void showComplement_actionPerformed(boolean complement)
3020   {
3021   }
3022 }