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