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