Check bounds of loaded comp
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer
3  * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18  */
19 package jalview.jbgui;
20
21 import java.awt.*;
22 import java.awt.event.*;
23
24 import javax.swing.*;
25 import javax.swing.event.*;
26
27 import jalview.schemes.*;
28
29 public class GAlignFrame
30     extends JInternalFrame
31 {
32   protected JMenuBar alignFrameMenuBar = new JMenuBar();
33   protected JMenu fileMenu = new JMenu();
34   protected JMenuItem closeMenuItem = new JMenuItem();
35   protected JMenu editMenu = new JMenu();
36   protected JMenu viewMenu = new JMenu();
37   protected JMenu colourMenu = new JMenu();
38   protected JMenu calculateMenu = new JMenu();
39   protected JMenu webService = new JMenu();
40   protected JMenuItem webServiceNoServices;
41   protected JMenuItem selectAllSequenceMenuItem = new JMenuItem();
42   protected JMenuItem deselectAllSequenceMenuItem = new JMenuItem();
43   protected JMenuItem invertSequenceMenuItem = new JMenuItem();
44   protected JMenuItem remove2LeftMenuItem = new JMenuItem();
45   protected JMenuItem remove2RightMenuItem = new JMenuItem();
46   protected JMenuItem removeGappedColumnMenuItem = new JMenuItem();
47   protected JMenuItem removeAllGapsMenuItem = new JMenuItem();
48   public JCheckBoxMenuItem viewBoxesMenuItem = new JCheckBoxMenuItem();
49   public JCheckBoxMenuItem viewTextMenuItem = new JCheckBoxMenuItem();
50   protected JMenuItem sortPairwiseMenuItem = new JMenuItem();
51   protected JMenuItem sortIDMenuItem = new JMenuItem();
52   protected JMenuItem sortGroupMenuItem = new JMenuItem();
53   protected JMenu sortByAnnotScore = new JMenu();
54   protected JMenuItem removeRedundancyMenuItem = new JMenuItem();
55   protected JMenuItem pairwiseAlignmentMenuItem = new JMenuItem();
56   protected JMenuItem PCAMenuItem = new JMenuItem();
57   protected JMenuItem averageDistanceTreeMenuItem = new JMenuItem();
58   protected JMenuItem neighbourTreeMenuItem = new JMenuItem();
59   BorderLayout borderLayout1 = new BorderLayout();
60   public JLabel statusBar = new JLabel();
61   protected JMenuItem saveAs = new JMenuItem();
62   protected JMenu outputTextboxMenu = new JMenu();
63   protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem();
64   protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
65   protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
66   protected JRadioButtonMenuItem hydrophobicityColour = new
67       JRadioButtonMenuItem();
68   protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
69   protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
70   protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
71   protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
72   protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem();
73   protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem();
74   protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
75   JMenuItem njTreeBlosumMenuItem = new JMenuItem();
76   JMenuItem avDistanceTreeBlosumMenuItem = new JMenuItem();
77   public JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem();
78   public JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem();
79   JMenuItem htmlMenuItem = new JMenuItem();
80   JMenuItem overviewMenuItem = new JMenuItem();
81   protected JMenuItem undoMenuItem = new JMenuItem();
82   protected JMenuItem redoMenuItem = new JMenuItem();
83   public JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
84   JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
85   public JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem();
86   JMenuItem printMenuItem = new JMenuItem();
87   public JCheckBoxMenuItem renderGapsMenuItem = new JCheckBoxMenuItem();
88   JMenuItem findMenuItem = new JMenuItem();
89   public JCheckBoxMenuItem abovePIDThreshold = new JCheckBoxMenuItem();
90   public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem();
91   protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
92   JMenuItem deleteGroups = new JMenuItem();
93   JMenuItem delete = new JMenuItem();
94   JMenuItem copy = new JMenuItem();
95   JMenuItem cut = new JMenuItem();
96   JMenu pasteMenu = new JMenu();
97   JMenuItem pasteNew = new JMenuItem();
98   JMenuItem pasteThis = new JMenuItem();
99   public JCheckBoxMenuItem applyToAllGroups = new JCheckBoxMenuItem();
100   JMenuItem createPNG = new JMenuItem();
101   protected JMenuItem font = new JMenuItem();
102   public JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem();
103   JMenuItem epsFile = new JMenuItem();
104   JMenuItem LoadtreeMenuItem = new JMenuItem();
105   public JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem();
106   public JCheckBoxMenuItem scaleLeft = new JCheckBoxMenuItem();
107   public JCheckBoxMenuItem scaleRight = new JCheckBoxMenuItem();
108   protected JMenuItem modifyPID = new JMenuItem();
109   protected JMenuItem modifyConservation = new JMenuItem();
110   protected JMenu sortByTreeMenu = new JMenu();
111   protected JMenu sort = new JMenu();
112   JMenu calculate = new JMenu();
113   JMenu jMenu2 = new JMenu();
114   protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem();
115   protected ButtonGroup colours = new ButtonGroup();
116   JMenuItem vamsasStore = new JMenuItem();
117   protected JMenuItem showTranslation = new JMenuItem();
118   protected JMenuItem extractScores = new JMenuItem();
119   public JMenuItem featureSettings = new JMenuItem();
120   JMenuItem fetchSequence = new JMenuItem();
121   JMenuItem annotationColour = new JMenuItem();
122   JMenuItem associatedData = new JMenuItem();
123   protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
124   JMenu addSequenceMenu = new JMenu();
125   JMenuItem addFromFile = new JMenuItem();
126   JMenuItem addFromText = new JMenuItem();
127   JMenuItem addFromURL = new JMenuItem();
128   JMenuItem exportAnnotations = new JMenuItem();
129   JMenuItem exportFeatures = new JMenuItem();
130   protected JPanel statusPanel = new JPanel();
131   GridLayout gridLayout1 = new GridLayout();
132   JMenu jMenu3 = new JMenu();
133   JMenuItem showAllSeqs = new JMenuItem();
134   JMenuItem showAllColumns = new JMenuItem();
135   JMenu hideMenu = new JMenu();
136   JMenuItem hideSelSequences = new JMenuItem();
137   JMenuItem hideSelColumns = new JMenuItem();
138   protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem();
139   JMenuItem invertColSel = new JMenuItem();
140   protected JTabbedPane tabbedPane = new JTabbedPane();
141   JMenuItem save = new JMenuItem();
142   protected JMenuItem reload = new JMenuItem();
143   JMenuItem newView = new JMenuItem();
144   JMenuItem textColour = new JMenuItem();
145   JMenu formatMenu = new JMenu();
146   JMenu selectMenu = new JMenu();
147   protected JCheckBoxMenuItem idRightAlign = new JCheckBoxMenuItem();
148   protected JMenuItem gatherViews = new JMenuItem();
149   protected JMenuItem expandViews = new JMenuItem();
150   JMenuItem pageSetup = new JMenuItem();
151   JMenuItem alignmentProperties = new JMenuItem();
152   public GAlignFrame()
153   {
154     try
155     {
156       jbInit();
157       setJMenuBar(alignFrameMenuBar);
158
159       // dynamically fill save as menu with available formats
160       for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
161       {
162         JMenuItem item = new JMenuItem(jalview.io.FormatAdapter.
163                                        WRITEABLE_FORMATS[i]);
164
165         item.addActionListener(new java.awt.event.ActionListener()
166         {
167           public void actionPerformed(ActionEvent e)
168           {
169             outputText_actionPerformed(e);
170           }
171         });
172
173         outputTextboxMenu.add(item);
174       }
175     }
176     catch (Exception e)
177     {
178     }
179
180     if (!System.getProperty("os.name").startsWith("Mac"))
181     {
182       closeMenuItem.setMnemonic('C');
183       outputTextboxMenu.setMnemonic('T');
184       undoMenuItem.setMnemonic('Z');
185       redoMenuItem.setMnemonic('0');
186       copy.setMnemonic('C');
187       cut.setMnemonic('U');
188       pasteMenu.setMnemonic('P');
189       reload.setMnemonic('R');
190     }
191
192     if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
193     {
194       java.util.Enumeration userColours = jalview.gui.UserDefinedColours.
195           getUserColourSchemes().keys();
196
197       while (userColours.hasMoreElements())
198       {
199         final JRadioButtonMenuItem radioItem = new JRadioButtonMenuItem(
200             userColours.
201             nextElement().toString());
202         radioItem.setName("USER_DEFINED");
203         radioItem.addMouseListener(new MouseAdapter()
204         {
205           public void mousePressed(MouseEvent evt)
206           {
207             if (evt.isControlDown() || SwingUtilities.isRightMouseButton(evt))
208             {
209               radioItem.removeActionListener(radioItem.getActionListeners()[0]);
210
211               int option = JOptionPane.showInternalConfirmDialog(jalview.gui.
212                   Desktop.desktop,
213                   "Remove from default list?",
214                   "Remove user defined colour",
215                   JOptionPane.YES_NO_OPTION);
216               if (option == JOptionPane.YES_OPTION)
217               {
218                 jalview.gui.UserDefinedColours.removeColourFromDefaults(
219                     radioItem.getText());
220                 colourMenu.remove(radioItem);
221               }
222               else
223               {
224                 radioItem.addActionListener(new ActionListener()
225                 {
226                   public void actionPerformed(ActionEvent evt)
227                   {
228                     userDefinedColour_actionPerformed(evt);
229                   }
230                 });
231               }
232             }
233           }
234         });
235         radioItem.addActionListener(new ActionListener()
236         {
237           public void actionPerformed(ActionEvent evt)
238           {
239             userDefinedColour_actionPerformed(evt);
240           }
241         });
242         colourMenu.insert(radioItem, 15);
243         colours.add(radioItem);
244       }
245     }
246     colours.add(noColourmenuItem);
247     colours.add(clustalColour);
248     colours.add(zappoColour);
249     colours.add(taylorColour);
250     colours.add(hydrophobicityColour);
251     colours.add(helixColour);
252     colours.add(strandColour);
253     colours.add(turnColour);
254     colours.add(buriedColour);
255     colours.add(userDefinedColour);
256     colours.add(PIDColour);
257     colours.add(BLOSUM62Colour);
258     colours.add(nucleotideColour);
259
260     setColourSelected(jalview.bin.Cache.getDefault("DEFAULT_COLOUR", "None"));
261
262   }
263
264   public void setColourSelected(String defaultColour)
265   {
266
267     if (defaultColour != null)
268     {
269       int index = ColourSchemeProperty.getColourIndexFromName(defaultColour);
270
271       switch (index)
272       {
273         case ColourSchemeProperty.NONE:
274           noColourmenuItem.setSelected(true);
275           break;
276         case ColourSchemeProperty.CLUSTAL:
277           clustalColour.setSelected(true);
278
279           break;
280
281         case ColourSchemeProperty.BLOSUM:
282           BLOSUM62Colour.setSelected(true);
283
284           break;
285
286         case ColourSchemeProperty.PID:
287           PIDColour.setSelected(true);
288
289           break;
290
291         case ColourSchemeProperty.ZAPPO:
292           zappoColour.setSelected(true);
293
294           break;
295
296         case ColourSchemeProperty.TAYLOR:
297           taylorColour.setSelected(true);
298           break;
299
300         case ColourSchemeProperty.HYDROPHOBIC:
301           hydrophobicityColour.setSelected(true);
302
303           break;
304
305         case ColourSchemeProperty.HELIX:
306           helixColour.setSelected(true);
307
308           break;
309
310         case ColourSchemeProperty.STRAND:
311           strandColour.setSelected(true);
312
313           break;
314
315         case ColourSchemeProperty.TURN:
316           turnColour.setSelected(true);
317
318           break;
319
320         case ColourSchemeProperty.BURIED:
321           buriedColour.setSelected(true);
322
323           break;
324
325         case ColourSchemeProperty.NUCLEOTIDE:
326           nucleotideColour.setSelected(true);
327
328           break;
329
330         case ColourSchemeProperty.USER_DEFINED:
331           userDefinedColour.setSelected(true);
332
333           break;
334       }
335     }
336
337   }
338
339   private void jbInit()
340       throws Exception
341   {
342     fileMenu.setText("File");
343     saveAs.setText("Save As...");
344     saveAs.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.
345         KeyEvent.VK_S,
346         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() |
347         java.awt.event.KeyEvent.SHIFT_MASK, false));
348     saveAs.addActionListener(new ActionListener()
349     {
350       public void actionPerformed(ActionEvent e)
351       {
352         saveAs_actionPerformed(e);
353       }
354     });
355     closeMenuItem.setText("Close");
356     closeMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.
357         event.KeyEvent.VK_W, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
358     closeMenuItem.addActionListener(new java.awt.event.ActionListener()
359     {
360       public void actionPerformed(ActionEvent e)
361       {
362         closeMenuItem_actionPerformed(false);
363       }
364     });
365     editMenu.setText("Edit");
366     viewMenu.setText("View");
367     colourMenu.setText("Colour");
368     calculateMenu.setText("Calculate");
369     webService.setText("Web Service");
370     selectAllSequenceMenuItem.setText("Select All");
371     selectAllSequenceMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
372         java.awt.event.KeyEvent.VK_A,
373         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
374     selectAllSequenceMenuItem.addActionListener(new java.awt.event.
375                                                 ActionListener()
376     {
377       public void actionPerformed(ActionEvent e)
378       {
379         selectAllSequenceMenuItem_actionPerformed(e);
380       }
381     });
382     deselectAllSequenceMenuItem.setText("Deselect All");
383     deselectAllSequenceMenuItem.setAccelerator(javax.swing.KeyStroke.
384                                                getKeyStroke(
385         java.awt.event.KeyEvent.VK_ESCAPE, 0, false));
386     deselectAllSequenceMenuItem.addActionListener(new java.awt.event.
387                                                   ActionListener()
388     {
389       public void actionPerformed(ActionEvent e)
390       {
391         deselectAllSequenceMenuItem_actionPerformed(e);
392       }
393     });
394     invertSequenceMenuItem.setText("Invert Sequence Selection");
395     invertSequenceMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
396         java.awt.event.KeyEvent.VK_I,
397         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
398     invertSequenceMenuItem.addActionListener(new java.awt.event.ActionListener()
399     {
400       public void actionPerformed(ActionEvent e)
401       {
402         invertSequenceMenuItem_actionPerformed(e);
403       }
404     });
405     remove2LeftMenuItem.setText("Remove Left");
406     remove2LeftMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.
407         awt.event.KeyEvent.VK_L,
408         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
409     remove2LeftMenuItem.addActionListener(new java.awt.event.ActionListener()
410     {
411       public void actionPerformed(ActionEvent e)
412       {
413         remove2LeftMenuItem_actionPerformed(e);
414       }
415     });
416     remove2RightMenuItem.setText("Remove Right");
417     remove2RightMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.
418         awt.event.KeyEvent.VK_R,
419         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
420     remove2RightMenuItem.addActionListener(new java.awt.event.ActionListener()
421     {
422       public void actionPerformed(ActionEvent e)
423       {
424         remove2RightMenuItem_actionPerformed(e);
425       }
426     });
427     removeGappedColumnMenuItem.setText("Remove Empty Columns");
428     removeGappedColumnMenuItem.setAccelerator(javax.swing.KeyStroke.
429                                               getKeyStroke(java.awt.event.
430         KeyEvent.VK_E, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
431     removeGappedColumnMenuItem.addActionListener(new java.awt.event.
432                                                  ActionListener()
433     {
434       public void actionPerformed(ActionEvent e)
435       {
436         removeGappedColumnMenuItem_actionPerformed(e);
437       }
438     });
439     removeAllGapsMenuItem.setText("Remove All Gaps");
440     removeAllGapsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
441         java.awt.event.KeyEvent.VK_E,
442         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() |
443         java.awt.event.KeyEvent.SHIFT_MASK, false));
444     removeAllGapsMenuItem.addActionListener(new java.awt.event.ActionListener()
445     {
446       public void actionPerformed(ActionEvent e)
447       {
448         removeAllGapsMenuItem_actionPerformed(e);
449       }
450     });
451     viewBoxesMenuItem.setText("Boxes");
452     viewBoxesMenuItem.setState(true);
453     viewBoxesMenuItem.addActionListener(new java.awt.event.ActionListener()
454     {
455       public void actionPerformed(ActionEvent e)
456       {
457         viewBoxesMenuItem_actionPerformed(e);
458       }
459     });
460     viewTextMenuItem.setText("Text");
461     viewTextMenuItem.setState(true);
462     viewTextMenuItem.addActionListener(new java.awt.event.ActionListener()
463     {
464       public void actionPerformed(ActionEvent e)
465       {
466         viewTextMenuItem_actionPerformed(e);
467       }
468     });
469     sortPairwiseMenuItem.setText("by Pairwise Identity");
470     sortPairwiseMenuItem.addActionListener(new java.awt.event.ActionListener()
471     {
472       public void actionPerformed(ActionEvent e)
473       {
474         sortPairwiseMenuItem_actionPerformed(e);
475       }
476     });
477     sortIDMenuItem.setText("by ID");
478     sortIDMenuItem.addActionListener(new java.awt.event.ActionListener()
479     {
480       public void actionPerformed(ActionEvent e)
481       {
482         sortIDMenuItem_actionPerformed(e);
483       }
484     });
485     sortGroupMenuItem.setText("by Group");
486     sortGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
487     {
488       public void actionPerformed(ActionEvent e)
489       {
490         sortGroupMenuItem_actionPerformed(e);
491       }
492     });
493     removeRedundancyMenuItem.setText("Remove Redundancy...");
494     removeRedundancyMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
495         java.awt.event.KeyEvent.VK_D,
496         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
497     removeRedundancyMenuItem.addActionListener(new java.awt.event.
498                                                ActionListener()
499     {
500       public void actionPerformed(ActionEvent e)
501       {
502         removeRedundancyMenuItem_actionPerformed(e);
503       }
504     });
505     pairwiseAlignmentMenuItem.setText("Pairwise Alignments...");
506     pairwiseAlignmentMenuItem.addActionListener(new java.awt.event.
507                                                 ActionListener()
508     {
509       public void actionPerformed(ActionEvent e)
510       {
511         pairwiseAlignmentMenuItem_actionPerformed(e);
512       }
513     });
514     PCAMenuItem.setText("Principal Component Analysis");
515     PCAMenuItem.addActionListener(new java.awt.event.ActionListener()
516     {
517       public void actionPerformed(ActionEvent e)
518       {
519         PCAMenuItem_actionPerformed(e);
520       }
521     });
522     averageDistanceTreeMenuItem.setText(
523         "Average Distance Using % Identity");
524     averageDistanceTreeMenuItem.addActionListener(new java.awt.event.
525                                                   ActionListener()
526     {
527       public void actionPerformed(ActionEvent e)
528       {
529         averageDistanceTreeMenuItem_actionPerformed(e);
530       }
531     });
532     neighbourTreeMenuItem.setText("Neighbour Joining Using % Identity");
533     neighbourTreeMenuItem.addActionListener(new java.awt.event.ActionListener()
534     {
535       public void actionPerformed(ActionEvent e)
536       {
537         neighbourTreeMenuItem_actionPerformed(e);
538       }
539     });
540     this.getContentPane().setLayout(borderLayout1);
541     alignFrameMenuBar.setFont(new java.awt.Font("Verdana", 0, 11));
542     statusBar.setBackground(Color.white);
543     statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
544     statusBar.setBorder(BorderFactory.createLineBorder(Color.black));
545     statusBar.setText("Status bar");
546     outputTextboxMenu.setText("Output to Textbox");
547     clustalColour.setText("Clustalx");
548
549     clustalColour.addActionListener(new java.awt.event.ActionListener()
550     {
551       public void actionPerformed(ActionEvent e)
552       {
553         clustalColour_actionPerformed(e);
554       }
555     });
556     zappoColour.setText("Zappo");
557     zappoColour.addActionListener(new java.awt.event.ActionListener()
558     {
559       public void actionPerformed(ActionEvent e)
560       {
561         zappoColour_actionPerformed(e);
562       }
563     });
564     taylorColour.setText("Taylor");
565     taylorColour.addActionListener(new java.awt.event.ActionListener()
566     {
567       public void actionPerformed(ActionEvent e)
568       {
569         taylorColour_actionPerformed(e);
570       }
571     });
572     hydrophobicityColour.setText("Hydrophobicity");
573     hydrophobicityColour.addActionListener(new java.awt.event.ActionListener()
574     {
575       public void actionPerformed(ActionEvent e)
576       {
577         hydrophobicityColour_actionPerformed(e);
578       }
579     });
580     helixColour.setText("Helix Propensity");
581     helixColour.addActionListener(new java.awt.event.ActionListener()
582     {
583       public void actionPerformed(ActionEvent e)
584       {
585         helixColour_actionPerformed(e);
586       }
587     });
588     strandColour.setText("Strand Propensity");
589     strandColour.addActionListener(new java.awt.event.ActionListener()
590     {
591       public void actionPerformed(ActionEvent e)
592       {
593         strandColour_actionPerformed(e);
594       }
595     });
596     turnColour.setText("Turn Propensity");
597     turnColour.addActionListener(new java.awt.event.ActionListener()
598     {
599       public void actionPerformed(ActionEvent e)
600       {
601         turnColour_actionPerformed(e);
602       }
603     });
604     buriedColour.setText("Buried Index");
605     buriedColour.addActionListener(new java.awt.event.ActionListener()
606     {
607       public void actionPerformed(ActionEvent e)
608       {
609         buriedColour_actionPerformed(e);
610       }
611     });
612     userDefinedColour.setText("User Defined...");
613     userDefinedColour.addActionListener(new java.awt.event.ActionListener()
614     {
615       public void actionPerformed(ActionEvent e)
616       {
617         userDefinedColour_actionPerformed(e);
618       }
619     });
620     PIDColour.setText("Percentage Identity");
621     PIDColour.addActionListener(new java.awt.event.ActionListener()
622     {
623       public void actionPerformed(ActionEvent e)
624       {
625         PIDColour_actionPerformed(e);
626       }
627     });
628     BLOSUM62Colour.setText("BLOSUM62 Score");
629     BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
630     {
631       public void actionPerformed(ActionEvent e)
632       {
633         BLOSUM62Colour_actionPerformed(e);
634       }
635     });
636     avDistanceTreeBlosumMenuItem.setText(
637         "Average Distance Using BLOSUM62");
638     avDistanceTreeBlosumMenuItem.addActionListener(new java.awt.event.
639         ActionListener()
640     {
641       public void actionPerformed(ActionEvent e)
642       {
643         avTreeBlosumMenuItem_actionPerformed(e);
644       }
645     });
646     njTreeBlosumMenuItem.setText("Neighbour Joining using BLOSUM62");
647     njTreeBlosumMenuItem.addActionListener(new java.awt.event.ActionListener()
648     {
649       public void actionPerformed(ActionEvent e)
650       {
651         njTreeBlosumMenuItem_actionPerformed(e);
652       }
653     });
654     annotationPanelMenuItem.setActionCommand("");
655     annotationPanelMenuItem.setText("Show Annotations");
656     annotationPanelMenuItem.setState(jalview.bin.Cache.getDefault(
657         "SHOW_ANNOTATIONS", true));
658     annotationPanelMenuItem.addActionListener(new java.awt.event.ActionListener()
659     {
660       public void actionPerformed(ActionEvent e)
661       {
662         annotationPanelMenuItem_actionPerformed(e);
663       }
664     });
665     colourTextMenuItem.setText("Colour Text");
666     colourTextMenuItem.addActionListener(new java.awt.event.ActionListener()
667     {
668       public void actionPerformed(ActionEvent e)
669       {
670         colourTextMenuItem_actionPerformed(e);
671       }
672     });
673     htmlMenuItem.setText("HTML");
674     htmlMenuItem.addActionListener(new java.awt.event.ActionListener()
675     {
676       public void actionPerformed(ActionEvent e)
677       {
678         htmlMenuItem_actionPerformed(e);
679       }
680     });
681     overviewMenuItem.setText("Overview Window");
682     overviewMenuItem.addActionListener(new java.awt.event.ActionListener()
683     {
684       public void actionPerformed(ActionEvent e)
685       {
686         overviewMenuItem_actionPerformed(e);
687       }
688     });
689     undoMenuItem.setEnabled(false);
690     undoMenuItem.setText("Undo");
691     undoMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
692         java.awt.event.KeyEvent.VK_Z,
693         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
694     undoMenuItem.addActionListener(new java.awt.event.ActionListener()
695     {
696       public void actionPerformed(ActionEvent e)
697       {
698         undoMenuItem_actionPerformed(e);
699       }
700     });
701     redoMenuItem.setEnabled(false);
702     redoMenuItem.setText("Redo");
703     redoMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.
704         event.KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
705     redoMenuItem.addActionListener(new java.awt.event.ActionListener()
706     {
707       public void actionPerformed(ActionEvent e)
708       {
709         redoMenuItem_actionPerformed(e);
710       }
711     });
712     conservationMenuItem.setText("By Conservation");
713     conservationMenuItem.addActionListener(new java.awt.event.ActionListener()
714     {
715       public void actionPerformed(ActionEvent e)
716       {
717         conservationMenuItem_actionPerformed(e);
718       }
719     });
720     noColourmenuItem.setText("None");
721     noColourmenuItem.addActionListener(new java.awt.event.ActionListener()
722     {
723       public void actionPerformed(ActionEvent e)
724       {
725         noColourmenuItem_actionPerformed(e);
726       }
727     });
728     wrapMenuItem.setText("Wrap");
729     wrapMenuItem.addActionListener(new java.awt.event.ActionListener()
730     {
731       public void actionPerformed(ActionEvent e)
732       {
733         wrapMenuItem_actionPerformed(e);
734       }
735     });
736     printMenuItem.setText("Print ...");
737     printMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.
738         event.KeyEvent.VK_P, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
739     printMenuItem.addActionListener(new java.awt.event.ActionListener()
740     {
741       public void actionPerformed(ActionEvent e)
742       {
743         printMenuItem_actionPerformed(e);
744       }
745     });
746     renderGapsMenuItem.setText("Show Gaps");
747     renderGapsMenuItem.setState(true);
748     renderGapsMenuItem.addActionListener(new java.awt.event.ActionListener()
749     {
750       public void actionPerformed(ActionEvent e)
751       {
752         renderGapsMenuItem_actionPerformed(e);
753       }
754     });
755     findMenuItem.setText("Find...");
756     findMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
757         java.awt.event.KeyEvent.VK_F,
758         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
759     findMenuItem.addActionListener(new java.awt.event.ActionListener()
760     {
761       public void actionPerformed(ActionEvent e)
762       {
763         findMenuItem_actionPerformed(e);
764       }
765     });
766     abovePIDThreshold.setText("Above Identity Threshold");
767     abovePIDThreshold.addActionListener(new java.awt.event.ActionListener()
768     {
769       public void actionPerformed(ActionEvent e)
770       {
771         abovePIDThreshold_actionPerformed(e);
772       }
773     });
774     showSeqFeatures.setText("Show Sequence Features");
775     showSeqFeatures.addActionListener(new ActionListener()
776     {
777       public void actionPerformed(ActionEvent actionEvent)
778       {
779         showSeqFeatures_actionPerformed(actionEvent);
780       }
781     });
782     nucleotideColour.setText("Nucleotide");
783     nucleotideColour.addActionListener(new java.awt.event.ActionListener()
784     {
785       public void actionPerformed(ActionEvent e)
786       {
787         nucleotideColour_actionPerformed(e);
788       }
789     });
790     deleteGroups.setText("Undefine groups");
791     deleteGroups.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.
792         event.KeyEvent.VK_U, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
793     deleteGroups.addActionListener(new java.awt.event.ActionListener()
794     {
795       public void actionPerformed(ActionEvent e)
796       {
797         deleteGroups_actionPerformed(e);
798       }
799     });
800     copy.setText("Copy");
801     copy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
802         java.awt.event.KeyEvent.VK_C,
803         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
804
805     copy.addActionListener(new java.awt.event.ActionListener()
806     {
807       public void actionPerformed(ActionEvent e)
808       {
809         copy_actionPerformed(e);
810       }
811     });
812     cut.setText("Cut");
813     cut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
814         java.awt.event.KeyEvent.VK_X,
815         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
816     cut.addActionListener(new java.awt.event.ActionListener()
817     {
818       public void actionPerformed(ActionEvent e)
819       {
820         cut_actionPerformed(e);
821       }
822     });
823     delete.setText("Delete");
824     delete.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.
825         KeyEvent.VK_BACK_SPACE, 0, false));
826     delete.addActionListener(new java.awt.event.ActionListener()
827     {
828       public void actionPerformed(ActionEvent e)
829       {
830         delete_actionPerformed(e);
831       }
832     });
833     pasteMenu.setText("Paste");
834     pasteNew.setText("To New Alignment");
835     pasteNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
836         java.awt.event.KeyEvent.VK_V,
837         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() |
838         java.awt.event.KeyEvent.SHIFT_MASK, false));
839     pasteNew.addActionListener(new java.awt.event.ActionListener()
840     {
841       public void actionPerformed(ActionEvent e)
842       {
843         pasteNew_actionPerformed(e);
844       }
845     });
846     pasteThis.setText("Add To This Alignment");
847     pasteThis.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
848         java.awt.event.KeyEvent.VK_V,
849         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
850     pasteThis.addActionListener(new java.awt.event.ActionListener()
851     {
852       public void actionPerformed(ActionEvent e)
853       {
854         pasteThis_actionPerformed(e);
855       }
856     });
857     applyToAllGroups.setText("Apply Colour To All Groups");
858     applyToAllGroups.addActionListener(new java.awt.event.ActionListener()
859     {
860       public void actionPerformed(ActionEvent e)
861       {
862         applyToAllGroups_actionPerformed(e);
863       }
864     });
865     createPNG.addActionListener(new java.awt.event.ActionListener()
866     {
867       public void actionPerformed(ActionEvent e)
868       {
869         createPNG(null);
870       }
871     });
872     createPNG.setActionCommand("Save As PNG Image");
873     createPNG.setText("PNG");
874     font.setText("Font...");
875     font.addActionListener(new java.awt.event.ActionListener()
876     {
877       public void actionPerformed(ActionEvent e)
878       {
879         font_actionPerformed(e);
880       }
881     });
882
883     seqLimits.setText("Show Sequence Limits");
884     seqLimits.setState(jalview.bin.Cache.getDefault("SHOW_JVSUFFIX", true));
885     seqLimits.addActionListener(new java.awt.event.ActionListener()
886     {
887       public void actionPerformed(ActionEvent e)
888       {
889         seqLimit_actionPerformed(e);
890       }
891     });
892     epsFile.setText("EPS");
893     epsFile.addActionListener(new java.awt.event.ActionListener()
894     {
895       public void actionPerformed(ActionEvent e)
896       {
897         createEPS(null);
898       }
899     });
900     LoadtreeMenuItem.setActionCommand("Load a tree for this sequence set");
901     LoadtreeMenuItem.setText("Load Associated Tree");
902     LoadtreeMenuItem.addActionListener(new java.awt.event.ActionListener()
903     {
904       public void actionPerformed(ActionEvent e)
905       {
906         LoadtreeMenuItem_actionPerformed(e);
907       }
908     });
909     scaleAbove.setVisible(false);
910     scaleAbove.setText("Scale Above");
911     scaleAbove.addActionListener(new java.awt.event.ActionListener()
912     {
913       public void actionPerformed(ActionEvent e)
914       {
915         scaleAbove_actionPerformed(e);
916       }
917     });
918     scaleLeft.setVisible(false);
919     scaleLeft.setSelected(true);
920     scaleLeft.setText("Scale Left");
921     scaleLeft.addActionListener(new java.awt.event.ActionListener()
922     {
923       public void actionPerformed(ActionEvent e)
924       {
925         scaleLeft_actionPerformed(e);
926       }
927     });
928     scaleRight.setVisible(false);
929     scaleRight.setSelected(true);
930     scaleRight.setText("Scale Right");
931     scaleRight.addActionListener(new java.awt.event.ActionListener()
932     {
933       public void actionPerformed(ActionEvent e)
934       {
935         scaleRight_actionPerformed(e);
936       }
937     });
938     modifyPID.setText("Modify Identity Threshold...");
939     modifyPID.addActionListener(new java.awt.event.ActionListener()
940     {
941       public void actionPerformed(ActionEvent e)
942       {
943         modifyPID_actionPerformed(e);
944       }
945     });
946     modifyConservation.setText("Modify Conservation Threshold...");
947     modifyConservation.addActionListener(new java.awt.event.ActionListener()
948     {
949       public void actionPerformed(ActionEvent e)
950       {
951         modifyConservation_actionPerformed(e);
952       }
953     });
954     sortByTreeMenu.setText("By Tree Order");
955     sort.setText("Sort");
956     sort.addMenuListener(new MenuListener()
957     {
958       public void menuSelected(MenuEvent e)
959       {
960         buildTreeMenu();
961       }
962
963       public void menuDeselected(MenuEvent e)
964       {
965       }
966
967       public void menuCanceled(MenuEvent e)
968       {
969       }
970     });
971     sortByAnnotScore.setText("by Score");
972     sort.add(sortByAnnotScore);
973     sortByAnnotScore.addMenuListener(
974             new javax.swing.event.MenuListener() {
975               
976                 public void menuCanceled(MenuEvent e)
977                 {
978                 }
979
980                 public void menuDeselected(MenuEvent e)
981                 {
982                 }
983
984                 public void menuSelected(MenuEvent e)
985                 {
986                   buildSortByAnnotationScoresMenu();
987                 }
988               }
989               );
990     sortByAnnotScore.setVisible(false);
991     
992     calculate.setText("Calculate Tree");
993
994     jMenu2.setText("Export Image");
995     padGapsMenuitem.setText("Pad Gaps");
996     padGapsMenuitem.setState(jalview.bin.Cache.getDefault("PAD_GAPS", false));
997     padGapsMenuitem.addActionListener(new ActionListener()
998     {
999       public void actionPerformed(ActionEvent e)
1000       {
1001         padGapsMenuitem_actionPerformed(e);
1002       }
1003     });
1004     vamsasStore.setVisible(false);
1005     vamsasStore.setText("VAMSAS store");
1006     vamsasStore.addActionListener(new ActionListener()
1007     {
1008       public void actionPerformed(ActionEvent e)
1009       {
1010         vamsasStore_actionPerformed(e);
1011       }
1012     });
1013     showTranslation.setText("Translate cDNA");
1014     showTranslation.addActionListener(new ActionListener()
1015     {
1016       public void actionPerformed(ActionEvent e)
1017       {
1018         showTranslation_actionPerformed(e);
1019       }
1020     });
1021     extractScores.setText("Extract Scores...");
1022     extractScores.addActionListener(new ActionListener()
1023     {
1024       public void actionPerformed(ActionEvent e)
1025       {
1026         extractScores_actionPerformed(e);
1027       }
1028     });
1029     extractScores.setVisible(false); // JBPNote: TODO: make gui for regex based score extraction
1030     featureSettings.setText("Feature Settings...");
1031     featureSettings.addActionListener(new ActionListener()
1032     {
1033       public void actionPerformed(ActionEvent e)
1034       {
1035         featureSettings_actionPerformed(e);
1036       }
1037     });
1038     fetchSequence.setText("Fetch Sequence(s)...");
1039     fetchSequence.addActionListener(new ActionListener()
1040     {
1041       public void actionPerformed(ActionEvent e)
1042       {
1043         fetchSequence_actionPerformed(e);
1044       }
1045     });
1046
1047     annotationColour.setText("By Annotation...");
1048     annotationColour.addActionListener(new ActionListener()
1049     {
1050       public void actionPerformed(ActionEvent e)
1051       {
1052         annotationColour_actionPerformed(e);
1053       }
1054     });
1055     associatedData.setText("Load Features / Annotations");
1056     associatedData.addActionListener(new ActionListener()
1057     {
1058       public void actionPerformed(ActionEvent e)
1059       {
1060         associatedData_actionPerformed(e);
1061       }
1062     });
1063     autoCalculate.setText("Autocalculate Consensus");
1064     autoCalculate.setState(jalview.bin.Cache.getDefault("AUTO_CALC_CONSENSUS", true));
1065     autoCalculate.addActionListener(new ActionListener()
1066     {
1067       public void actionPerformed(ActionEvent e)
1068       {
1069         autoCalculate_actionPerformed(e);
1070       }
1071     });
1072     addSequenceMenu.setText("Add Sequences");
1073     addFromFile.setText("From File");
1074     addFromFile.addActionListener(new ActionListener()
1075     {
1076       public void actionPerformed(ActionEvent e)
1077       {
1078         addFromFile_actionPerformed(e);
1079       }
1080     });
1081     addFromText.setText("From Textbox");
1082     addFromText.addActionListener(new ActionListener()
1083     {
1084       public void actionPerformed(ActionEvent e)
1085       {
1086         addFromText_actionPerformed(e);
1087       }
1088     });
1089     addFromURL.setText("From URL");
1090     addFromURL.addActionListener(new ActionListener()
1091     {
1092       public void actionPerformed(ActionEvent e)
1093       {
1094         addFromURL_actionPerformed(e);
1095       }
1096     });
1097     exportFeatures.setText("Export Features...");
1098     exportFeatures.addActionListener(new ActionListener()
1099     {
1100       public void actionPerformed(ActionEvent e)
1101       {
1102         exportFeatures_actionPerformed(e);
1103       }
1104     });
1105     exportAnnotations.setText("Export Annotations...");
1106     exportAnnotations.addActionListener(new ActionListener()
1107     {
1108       public void actionPerformed(ActionEvent e)
1109       {
1110         exportAnnotations_actionPerformed(e);
1111       }
1112     });
1113     statusPanel.setLayout(gridLayout1);
1114     jMenu3.setText("Show");
1115     showAllSeqs.setText("All Sequences");
1116     showAllSeqs.addActionListener(new ActionListener()
1117     {
1118       public void actionPerformed(ActionEvent e)
1119       {
1120         showAllSeqs_actionPerformed(e);
1121       }
1122     });
1123     showAllColumns.setText("All Columns");
1124     showAllColumns.addActionListener(new ActionListener()
1125     {
1126       public void actionPerformed(ActionEvent e)
1127       {
1128         showAllColumns_actionPerformed(e);
1129       }
1130     });
1131     hideMenu.setText("Hide");
1132     hideSelSequences.setText("Selected Sequences");
1133     hideSelSequences.addActionListener(new ActionListener()
1134     {
1135       public void actionPerformed(ActionEvent e)
1136       {
1137         hideSelSequences_actionPerformed(e);
1138       }
1139     });
1140     hideSelColumns.setText("Selected Columns");
1141     hideSelColumns.addActionListener(new ActionListener()
1142     {
1143       public void actionPerformed(ActionEvent e)
1144       {
1145         hideSelColumns_actionPerformed(e);
1146       }
1147     });
1148     hiddenMarkers.setText("Show Hidden Markers");
1149     hiddenMarkers.addActionListener(new ActionListener()
1150     {
1151       public void actionPerformed(ActionEvent e)
1152       {
1153         hiddenMarkers_actionPerformed(e);
1154       }
1155     });
1156     invertColSel.setText("Invert Column Selection");
1157     invertColSel.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.
1158         event.KeyEvent.VK_I,
1159         Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()
1160         | java.awt.event.KeyEvent.ALT_MASK,
1161         false));
1162     invertColSel.addActionListener(new ActionListener()
1163     {
1164       public void actionPerformed(ActionEvent e)
1165       {
1166         invertColSel_actionPerformed(e);
1167       }
1168     });
1169     tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()
1170     {
1171       public void stateChanged(ChangeEvent evt)
1172       {
1173         JTabbedPane pane = (JTabbedPane) evt.getSource();
1174         int sel = pane.getSelectedIndex();
1175         tabSelectionChanged(sel);
1176       }
1177     });
1178     tabbedPane.addMouseListener(new MouseAdapter()
1179     {
1180       public void mousePressed(MouseEvent e)
1181       {
1182         tabbedPane_mousePressed(e);
1183       }
1184     });
1185     tabbedPane.addFocusListener(new FocusAdapter()
1186     {
1187       public void focusGained(FocusEvent e)
1188       {
1189         tabbedPane_focusGained(e);
1190       }
1191     });
1192     save.setText("Save");
1193     save.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.
1194         KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
1195     save.addActionListener(new ActionListener()
1196     {
1197       public void actionPerformed(ActionEvent e)
1198       {
1199         save_actionPerformed(e);
1200       }
1201     });
1202     reload.setEnabled(false);
1203     reload.setText("Reload");
1204     reload.addActionListener(new ActionListener()
1205     {
1206       public void actionPerformed(ActionEvent e)
1207       {
1208         reload_actionPerformed(e);
1209       }
1210     });
1211     newView.setText("New View");
1212     newView.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.
1213         KeyEvent.VK_T, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
1214     newView.addActionListener(new ActionListener()
1215     {
1216       public void actionPerformed(ActionEvent e)
1217       {
1218         newView_actionPerformed(e);
1219       }
1220     });
1221     tabbedPane.setToolTipText("<html><i> Right-click to rename tab"
1222                               +
1223         "<br> Press X to eXpand tabs, G to reGroup.</i></html>");
1224     textColour.setText("Text Colour");
1225     textColour.addActionListener(new ActionListener()
1226     {
1227       public void actionPerformed(ActionEvent e)
1228       {
1229         textColour_actionPerformed(e);
1230       }
1231     });
1232     formatMenu.setText("Format");
1233     selectMenu.setText("Select");
1234     idRightAlign.setText("Right Align Sequence Id");
1235     idRightAlign.addActionListener(new ActionListener()
1236     {
1237       public void actionPerformed(ActionEvent e)
1238       {
1239         idRightAlign_actionPerformed(e);
1240       }
1241     });
1242     gatherViews.setEnabled(false);
1243     gatherViews.setText("Gather Views");
1244     gatherViews.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.
1245         event.KeyEvent.VK_G, 0, false));
1246     gatherViews.addActionListener(new ActionListener()
1247     {
1248       public void actionPerformed(ActionEvent e)
1249       {
1250         gatherViews_actionPerformed(e);
1251       }
1252     });
1253     expandViews.setEnabled(false);
1254     expandViews.setText("Expand Views");
1255     expandViews.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.
1256         event.KeyEvent.VK_X, 0, false));
1257     expandViews.addActionListener(new ActionListener()
1258     {
1259       public void actionPerformed(ActionEvent e)
1260       {
1261         expandViews_actionPerformed(e);
1262       }
1263     });
1264     pageSetup.setText("Page Setup ...");
1265     pageSetup.addActionListener(new ActionListener()
1266     {
1267       public void actionPerformed(ActionEvent e)
1268       {
1269         pageSetup_actionPerformed(e);
1270       }
1271     });
1272     alignmentProperties.setText("Alignment Properties...");
1273     alignmentProperties.addActionListener(new ActionListener()
1274     {
1275       public void actionPerformed(ActionEvent actionEvent)
1276       {
1277         alignmentProperties();
1278       }
1279     });
1280
1281     alignFrameMenuBar.add(fileMenu);
1282     alignFrameMenuBar.add(editMenu);
1283     alignFrameMenuBar.add(selectMenu);
1284     alignFrameMenuBar.add(viewMenu);
1285     alignFrameMenuBar.add(formatMenu);
1286     alignFrameMenuBar.add(colourMenu);
1287     alignFrameMenuBar.add(calculateMenu);
1288     alignFrameMenuBar.add(webService);
1289     fileMenu.add(fetchSequence);
1290     fileMenu.add(addSequenceMenu);
1291     fileMenu.add(reload);
1292     fileMenu.addSeparator();
1293     fileMenu.add(vamsasStore);
1294     fileMenu.add(save);
1295     fileMenu.add(saveAs);
1296     fileMenu.add(outputTextboxMenu);
1297     fileMenu.add(pageSetup);
1298     fileMenu.add(printMenuItem);
1299     fileMenu.addSeparator();
1300     fileMenu.add(jMenu2);
1301     fileMenu.add(exportFeatures);
1302     fileMenu.add(exportAnnotations);
1303     fileMenu.add(LoadtreeMenuItem);
1304     fileMenu.add(associatedData);
1305     fileMenu.addSeparator();
1306     fileMenu.add(closeMenuItem);
1307     editMenu.add(undoMenuItem);
1308     editMenu.add(redoMenuItem);
1309     editMenu.add(cut);
1310     editMenu.add(copy);
1311     editMenu.add(pasteMenu);
1312     editMenu.add(delete);
1313     editMenu.addSeparator();
1314     editMenu.add(remove2LeftMenuItem);
1315     editMenu.add(remove2RightMenuItem);
1316     editMenu.add(removeGappedColumnMenuItem);
1317     editMenu.add(removeAllGapsMenuItem);
1318     editMenu.add(removeRedundancyMenuItem);
1319     editMenu.addSeparator();
1320     editMenu.add(padGapsMenuitem);
1321     viewMenu.add(newView);
1322     viewMenu.add(expandViews);
1323     viewMenu.add(gatherViews);
1324     viewMenu.addSeparator();
1325     viewMenu.add(jMenu3);
1326     viewMenu.add(hideMenu);
1327     viewMenu.addSeparator();
1328     viewMenu.add(annotationPanelMenuItem);
1329     viewMenu.addSeparator();
1330     viewMenu.add(showSeqFeatures);
1331     viewMenu.add(featureSettings);
1332     viewMenu.addSeparator();
1333     viewMenu.add(alignmentProperties);
1334     viewMenu.addSeparator();
1335     viewMenu.add(overviewMenuItem);
1336     colourMenu.add(applyToAllGroups);
1337     colourMenu.add(textColour);
1338     colourMenu.addSeparator();
1339     colourMenu.add(noColourmenuItem);
1340     colourMenu.add(clustalColour);
1341     colourMenu.add(BLOSUM62Colour);
1342     colourMenu.add(PIDColour);
1343     colourMenu.add(zappoColour);
1344     colourMenu.add(taylorColour);
1345     colourMenu.add(hydrophobicityColour);
1346     colourMenu.add(helixColour);
1347     colourMenu.add(strandColour);
1348     colourMenu.add(turnColour);
1349     colourMenu.add(buriedColour);
1350     colourMenu.add(nucleotideColour);
1351     colourMenu.add(userDefinedColour);
1352     colourMenu.addSeparator();
1353     colourMenu.add(conservationMenuItem);
1354     colourMenu.add(modifyConservation);
1355     colourMenu.add(abovePIDThreshold);
1356     colourMenu.add(modifyPID);
1357     colourMenu.add(annotationColour);
1358     calculateMenu.add(sort);
1359     calculateMenu.add(calculate);
1360     calculateMenu.addSeparator();
1361     calculateMenu.add(pairwiseAlignmentMenuItem);
1362     calculateMenu.add(PCAMenuItem);
1363     calculateMenu.addSeparator();
1364     calculateMenu.add(showTranslation);
1365     calculateMenu.add(autoCalculate);
1366     calculateMenu.addSeparator();
1367     calculateMenu.add(extractScores);
1368     webServiceNoServices = new JMenuItem("<No Services>");
1369     webService.add(webServiceNoServices);
1370     pasteMenu.add(pasteNew);
1371     pasteMenu.add(pasteThis);
1372     sort.add(sortIDMenuItem);
1373     sort.add(sortGroupMenuItem);
1374     sort.add(sortPairwiseMenuItem);
1375     sort.add(sortByTreeMenu);
1376     calculate.add(averageDistanceTreeMenuItem);
1377     calculate.add(neighbourTreeMenuItem);
1378     calculate.add(avDistanceTreeBlosumMenuItem);
1379     calculate.add(njTreeBlosumMenuItem);
1380     jMenu2.add(htmlMenuItem);
1381     jMenu2.add(epsFile);
1382     jMenu2.add(createPNG);
1383     addSequenceMenu.add(addFromFile);
1384     addSequenceMenu.add(addFromText);
1385     addSequenceMenu.add(addFromURL);
1386     this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH);
1387     statusPanel.add(statusBar, null);
1388     this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
1389     jMenu3.add(showAllColumns);
1390     jMenu3.add(showAllSeqs);
1391     hideMenu.add(hideSelColumns);
1392     hideMenu.add(hideSelSequences);
1393     formatMenu.add(font);
1394     formatMenu.addSeparator();
1395     formatMenu.add(wrapMenuItem);
1396     formatMenu.add(scaleAbove);
1397     formatMenu.add(scaleLeft);
1398     formatMenu.add(scaleRight);
1399     formatMenu.add(seqLimits);
1400     formatMenu.add(idRightAlign);
1401     formatMenu.add(hiddenMarkers);
1402     formatMenu.add(viewBoxesMenuItem);
1403     formatMenu.add(viewTextMenuItem);
1404     formatMenu.add(colourTextMenuItem);
1405     formatMenu.add(renderGapsMenuItem);
1406     selectMenu.add(findMenuItem);
1407     selectMenu.addSeparator();
1408     selectMenu.add(selectAllSequenceMenuItem);
1409     selectMenu.add(deselectAllSequenceMenuItem);
1410     selectMenu.add(invertSequenceMenuItem);
1411     selectMenu.add(invertColSel);
1412     selectMenu.add(deleteGroups);
1413   }
1414
1415   protected void buildSortByAnnotationScoresMenu()
1416   {
1417   }
1418
1419   protected void extractScores_actionPerformed(ActionEvent e)
1420   {
1421   }
1422
1423   protected void outputText_actionPerformed(ActionEvent e)
1424   {
1425   }
1426
1427   public void addFromFile_actionPerformed(ActionEvent e)
1428   {
1429
1430   }
1431
1432   public void addFromText_actionPerformed(ActionEvent e)
1433   {
1434
1435   }
1436
1437   public void addFromURL_actionPerformed(ActionEvent e)
1438   {
1439
1440   }
1441
1442   public void exportFeatures_actionPerformed(ActionEvent e)
1443   {
1444
1445   }
1446
1447   public void exportAnnotations_actionPerformed(ActionEvent e)
1448   {
1449
1450   }
1451
1452   protected void htmlMenuItem_actionPerformed(ActionEvent e)
1453   {
1454   }
1455
1456   protected void closeMenuItem_actionPerformed(boolean b)
1457   {
1458   }
1459
1460   protected void redoMenuItem_actionPerformed(ActionEvent e)
1461   {
1462   }
1463
1464   protected void undoMenuItem_actionPerformed(ActionEvent e)
1465   {
1466   }
1467
1468   protected void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
1469   {
1470   }
1471
1472   protected void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
1473   {
1474   }
1475
1476   protected void invertSequenceMenuItem_actionPerformed(ActionEvent e)
1477   {
1478   }
1479
1480   protected void remove2LeftMenuItem_actionPerformed(ActionEvent e)
1481   {
1482   }
1483
1484   protected void remove2RightMenuItem_actionPerformed(ActionEvent e)
1485   {
1486   }
1487
1488   protected void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
1489   {
1490   }
1491
1492   protected void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
1493   {
1494   }
1495
1496   protected void wrapMenuItem_actionPerformed(ActionEvent e)
1497   {
1498   }
1499
1500   protected void viewBoxesMenuItem_actionPerformed(ActionEvent e)
1501   {
1502   }
1503
1504   protected void viewTextMenuItem_actionPerformed(ActionEvent e)
1505   {
1506   }
1507
1508   protected void colourTextMenuItem_actionPerformed(ActionEvent e)
1509   {
1510   }
1511
1512   protected void annotationPanelMenuItem_actionPerformed(ActionEvent e)
1513   {
1514   }
1515
1516   protected void overviewMenuItem_actionPerformed(ActionEvent e)
1517   {
1518   }
1519
1520   protected void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
1521   {
1522   }
1523
1524   protected void sortIDMenuItem_actionPerformed(ActionEvent e)
1525   {
1526   }
1527
1528   protected void sortGroupMenuItem_actionPerformed(ActionEvent e)
1529   {
1530   }
1531
1532   protected void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
1533   {
1534   }
1535
1536   protected void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
1537   {
1538   }
1539
1540   protected void PCAMenuItem_actionPerformed(ActionEvent e)
1541   {
1542   }
1543
1544   protected void averageDistanceTreeMenuItem_actionPerformed(ActionEvent e)
1545   {
1546   }
1547
1548   protected void neighbourTreeMenuItem_actionPerformed(ActionEvent e)
1549   {
1550   }
1551
1552   protected void njTreeBlosumMenuItem_actionPerformed(ActionEvent e)
1553   {
1554   }
1555
1556   protected void avTreeBlosumMenuItem_actionPerformed(ActionEvent e)
1557   {
1558   }
1559
1560   protected void clustalColour_actionPerformed(ActionEvent e)
1561   {
1562   }
1563
1564   protected void zappoColour_actionPerformed(ActionEvent e)
1565   {
1566   }
1567
1568   protected void taylorColour_actionPerformed(ActionEvent e)
1569   {
1570   }
1571
1572   protected void hydrophobicityColour_actionPerformed(ActionEvent e)
1573   {
1574   }
1575
1576   protected void helixColour_actionPerformed(ActionEvent e)
1577   {
1578   }
1579
1580   protected void strandColour_actionPerformed(ActionEvent e)
1581   {
1582   }
1583
1584   protected void turnColour_actionPerformed(ActionEvent e)
1585   {
1586   }
1587
1588   protected void buriedColour_actionPerformed(ActionEvent e)
1589   {
1590   }
1591
1592   protected void userDefinedColour_actionPerformed(ActionEvent e)
1593   {
1594   }
1595
1596   protected void PIDColour_actionPerformed(ActionEvent e)
1597   {
1598   }
1599
1600   protected void BLOSUM62Colour_actionPerformed(ActionEvent e)
1601   {
1602   }
1603
1604   protected void noColourmenuItem_actionPerformed(ActionEvent e)
1605   {
1606   }
1607
1608   protected void conservationMenuItem_actionPerformed(ActionEvent e)
1609   {
1610   }
1611
1612   protected void printMenuItem_actionPerformed(ActionEvent e)
1613   {
1614   }
1615
1616   protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
1617   {
1618   }
1619
1620   protected void findMenuItem_actionPerformed(ActionEvent e)
1621   {
1622   }
1623
1624   protected void abovePIDThreshold_actionPerformed(ActionEvent e)
1625   {
1626   }
1627
1628   public void showSeqFeatures_actionPerformed(ActionEvent actionEvent)
1629   {
1630   }
1631
1632   protected void nucleotideColour_actionPerformed(ActionEvent e)
1633   {
1634   }
1635
1636   protected void deleteGroups_actionPerformed(ActionEvent e)
1637   {
1638   }
1639
1640   protected void copy_actionPerformed(ActionEvent e)
1641   {
1642   }
1643
1644   protected void cut_actionPerformed(ActionEvent e)
1645   {
1646   }
1647
1648   protected void delete_actionPerformed(ActionEvent e)
1649   {
1650   }
1651
1652   protected void pasteNew_actionPerformed(ActionEvent e)
1653   {
1654   }
1655
1656   protected void pasteThis_actionPerformed(ActionEvent e)
1657   {
1658   }
1659
1660   protected void applyToAllGroups_actionPerformed(ActionEvent e)
1661   {
1662   }
1663
1664   public void createPNG(java.io.File f)
1665   {
1666   }
1667
1668   protected void font_actionPerformed(ActionEvent e)
1669   {
1670   }
1671
1672   protected void seqLimit_actionPerformed(ActionEvent e)
1673   {
1674   }
1675
1676   public void seqDBRef_actionPerformed(ActionEvent e)
1677   {
1678
1679   }
1680
1681   public void createEPS(java.io.File f)
1682   {
1683   }
1684
1685   protected void LoadtreeMenuItem_actionPerformed(ActionEvent e)
1686   {
1687   }
1688
1689   protected void jpred_actionPerformed(ActionEvent e)
1690   {
1691   }
1692
1693   protected void scaleAbove_actionPerformed(ActionEvent e)
1694   {
1695   }
1696
1697   protected void scaleLeft_actionPerformed(ActionEvent e)
1698   {
1699   }
1700
1701   protected void scaleRight_actionPerformed(ActionEvent e)
1702   {
1703   }
1704
1705   protected void modifyPID_actionPerformed(ActionEvent e)
1706   {
1707   }
1708
1709   protected void modifyConservation_actionPerformed(ActionEvent e)
1710   {
1711   }
1712
1713   protected void saveAs_actionPerformed(ActionEvent e)
1714   {
1715   }
1716
1717   protected void padGapsMenuitem_actionPerformed(ActionEvent e)
1718   {
1719   }
1720
1721   public void vamsasStore_actionPerformed(ActionEvent e)
1722   {
1723
1724   }
1725
1726   public void vamsasLoad_actionPerformed(ActionEvent e)
1727   {
1728
1729   }
1730
1731   public void showTranslation_actionPerformed(ActionEvent e)
1732   {
1733
1734   }
1735
1736   public void featureSettings_actionPerformed(ActionEvent e)
1737   {
1738
1739   }
1740
1741   public void fetchSequence_actionPerformed(ActionEvent e)
1742   {
1743
1744   }
1745
1746   public void smoothFont_actionPerformed(ActionEvent e)
1747   {
1748
1749   }
1750
1751   public void annotationColour_actionPerformed(ActionEvent e)
1752   {
1753
1754   }
1755
1756   public void associatedData_actionPerformed(ActionEvent e)
1757   {
1758
1759   }
1760
1761   public void autoCalculate_actionPerformed(ActionEvent e)
1762   {
1763
1764   }
1765
1766   public void showAllSeqs_actionPerformed(ActionEvent e)
1767   {
1768
1769   }
1770
1771   public void showAllColumns_actionPerformed(ActionEvent e)
1772   {
1773
1774   }
1775
1776   public void hideSelSequences_actionPerformed(ActionEvent e)
1777   {
1778
1779   }
1780
1781   public void hideSelColumns_actionPerformed(ActionEvent e)
1782   {
1783
1784   }
1785
1786   public void hiddenMarkers_actionPerformed(ActionEvent e)
1787   {
1788
1789   }
1790
1791   public void findPdbId_actionPerformed(ActionEvent e)
1792   {
1793
1794   }
1795
1796   public void enterPdbId_actionPerformed(ActionEvent e)
1797   {
1798
1799   }
1800
1801   public void pdbFile_actionPerformed(ActionEvent e)
1802   {
1803
1804   }
1805
1806   public void invertColSel_actionPerformed(ActionEvent e)
1807   {
1808
1809   }
1810
1811   public void tabSelectionChanged(int sel)
1812   {
1813
1814   }
1815
1816   public void tabbedPane_mousePressed(MouseEvent e)
1817   {
1818
1819   }
1820
1821   public void tabbedPane_focusGained(FocusEvent e)
1822   {
1823     requestFocus();
1824   }
1825
1826   public void save_actionPerformed(ActionEvent e)
1827   {
1828
1829   }
1830
1831   public void reload_actionPerformed(ActionEvent e)
1832   {
1833
1834   }
1835
1836   public void newView_actionPerformed(ActionEvent e)
1837   {
1838
1839   }
1840
1841   public void textColour_actionPerformed(ActionEvent e)
1842   {
1843
1844   }
1845
1846   public void idRightAlign_actionPerformed(ActionEvent e)
1847   {
1848
1849   }
1850
1851   public void expandViews_actionPerformed(ActionEvent e)
1852   {
1853
1854   }
1855
1856   public void gatherViews_actionPerformed(ActionEvent e)
1857   {
1858
1859   }
1860
1861   public void buildTreeMenu()
1862   {
1863
1864   }
1865   
1866   public void pageSetup_actionPerformed(ActionEvent e)
1867   {
1868
1869   }
1870
1871   public void alignmentProperties()
1872   {
1873
1874   }
1875 }