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