2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\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
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
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
19 package jalview.jbgui;
\r
22 import java.awt.event.*;
\r
23 import javax.swing.*;
\r
24 import javax.swing.event.*;
\r
26 import jalview.schemes.*;
\r
28 public class GAlignFrame
\r
29 extends JInternalFrame
\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 protected JMenuItem clustalAlignMenuItem = new JMenuItem();
\r
58 BorderLayout borderLayout1 = new BorderLayout();
\r
59 public JLabel statusBar = new JLabel();
\r
60 protected JMenuItem saveAlignmentMenu = new JMenuItem();
\r
61 protected JMenu outputTextboxMenu = new JMenu();
\r
62 protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem();
\r
63 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
\r
64 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
\r
65 protected JRadioButtonMenuItem hydrophobicityColour = new
\r
66 JRadioButtonMenuItem();
\r
67 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
\r
68 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
\r
69 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
\r
70 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
\r
71 protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem();
\r
72 protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem();
\r
73 protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
\r
74 JMenuItem njTreeBlosumMenuItem = new JMenuItem();
\r
75 JMenuItem avDistanceTreeBlosumMenuItem = new JMenuItem();
\r
76 public JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem();
\r
77 public JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem();
\r
78 JMenuItem htmlMenuItem = new JMenuItem();
\r
79 JMenuItem overviewMenuItem = new JMenuItem();
\r
80 protected JMenuItem undoMenuItem = new JMenuItem();
\r
81 protected JMenuItem redoMenuItem = new JMenuItem();
\r
82 public JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
\r
83 JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
\r
84 public JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem();
\r
85 JMenuItem printMenuItem = new JMenuItem();
\r
86 public JCheckBoxMenuItem renderGapsMenuItem = new JCheckBoxMenuItem();
\r
87 JMenuItem findMenuItem = new JMenuItem();
\r
88 JMenu searchMenu = new JMenu();
\r
89 public JCheckBoxMenuItem abovePIDThreshold = new JCheckBoxMenuItem();
\r
90 public JCheckBoxMenuItem sequenceFeatures = new JCheckBoxMenuItem();
\r
91 protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
\r
92 JMenuItem deleteGroups = new JMenuItem();
\r
93 JMenuItem delete = new JMenuItem();
\r
94 JMenuItem copy = new JMenuItem();
\r
95 JMenuItem cut = new JMenuItem();
\r
96 JMenu jMenu1 = new JMenu();
\r
97 JMenuItem pasteNew = new JMenuItem();
\r
98 JMenuItem pasteThis = new JMenuItem();
\r
99 public JCheckBoxMenuItem applyToAllGroups = new JCheckBoxMenuItem();
\r
100 JMenuItem createPNG = new JMenuItem();
\r
101 protected JMenuItem font = new JMenuItem();
\r
102 public JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem();
\r
103 JMenuItem epsFile = new JMenuItem();
\r
104 JMenuItem LoadtreeMenuItem = new JMenuItem();
\r
105 public JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem();
\r
106 public JCheckBoxMenuItem scaleLeft = new JCheckBoxMenuItem();
\r
107 public JCheckBoxMenuItem scaleRight = new JCheckBoxMenuItem();
\r
108 protected JMenuItem modifyPID = new JMenuItem();
\r
109 protected JMenuItem modifyConservation = new JMenuItem();
\r
110 protected JMenu sortByTreeMenu = new JMenu();
\r
111 protected JMenu sort = new JMenu();
\r
112 JMenu calculate = new JMenu();
\r
113 JMenu jMenu2 = new JMenu();
\r
114 JMenuItem padGapsMenuitem = new JMenuItem();
\r
115 protected ButtonGroup colours = new ButtonGroup();
\r
116 JMenuItem vamsasStore = new JMenuItem();
\r
117 protected JCheckBoxMenuItem showTranslation = new JCheckBoxMenuItem();
\r
118 protected JTabbedPane tabbedPane = new JTabbedPane();
\r
119 protected JMenuItem featureSettings = new JMenuItem();
\r
120 public JCheckBoxMenuItem seqDBRef = new JCheckBoxMenuItem();
\r
122 public GAlignFrame()
\r
129 setJMenuBar(alignFrameMenuBar);
\r
131 // dynamically fill save as menu with available formats
\r
132 for (int i = 0; i < jalview.io.FormatAdapter.formats.size(); i++)
\r
134 JMenuItem item = new JMenuItem( (String) jalview.io.FormatAdapter.formats.
\r
137 item.addActionListener(new java.awt.event.ActionListener()
\r
139 public void actionPerformed(ActionEvent e)
\r
141 outputText_actionPerformed(e);
\r
145 outputTextboxMenu.add(item);
\r
148 catch (Exception e)
\r
153 if(jalview.gui.UserDefinedColours.getUserColourSchemes()!=null)
\r
155 java.util.Enumeration userColours = jalview.gui.UserDefinedColours.
\r
156 getUserColourSchemes().keys();
\r
158 while (userColours.hasMoreElements())
\r
160 final JRadioButtonMenuItem radioItem = new JRadioButtonMenuItem(userColours.
\r
161 nextElement().toString());
\r
162 radioItem.setName("USER_DEFINED");
\r
163 radioItem.addMouseListener(new MouseAdapter()
\r
165 public void mousePressed(MouseEvent evt)
\r
167 if(evt.isControlDown() || SwingUtilities.isRightMouseButton(evt))
\r
169 radioItem.removeActionListener(radioItem.getActionListeners()[0]);
\r
171 int option = JOptionPane.showInternalConfirmDialog(jalview.gui.Desktop.desktop,
\r
172 "Remove from default list?",
\r
173 "Remove user defined colour",
\r
174 JOptionPane.YES_NO_OPTION);
\r
175 if(option == JOptionPane.YES_OPTION)
\r
177 jalview.gui.UserDefinedColours.removeColourFromDefaults(radioItem.getText());
\r
178 colourMenu.remove(radioItem);
\r
181 radioItem.addActionListener(new ActionListener()
\r
183 public void actionPerformed(ActionEvent evt)
\r
185 userDefinedColour_actionPerformed(evt);
\r
191 radioItem.addActionListener(new ActionListener()
\r
193 public void actionPerformed(ActionEvent evt)
\r
195 userDefinedColour_actionPerformed(evt);
\r
198 colourMenu.insert(radioItem, 15);
\r
199 colours.add(radioItem);
\r
202 colours.add(noColourmenuItem);
\r
203 colours.add(clustalColour);
\r
204 colours.add(zappoColour);
\r
205 colours.add(taylorColour);
\r
206 colours.add(hydrophobicityColour);
\r
207 colours.add(helixColour);
\r
208 colours.add(strandColour);
\r
209 colours.add(turnColour);
\r
210 colours.add(buriedColour);
\r
211 colours.add(userDefinedColour);
\r
212 colours.add(PIDColour);
\r
213 colours.add(BLOSUM62Colour);
\r
214 colours.add(nucleotideColour);
\r
216 setColourSelected(jalview.bin.Cache.getDefault("DEFAULT_COLOUR", "None"));
\r
221 public void setColourSelected(String defaultColour)
\r
224 if (defaultColour != null)
\r
226 int index = ColourSchemeProperty.getColourIndexFromName(defaultColour);
\r
230 case ColourSchemeProperty.NONE:
\r
231 noColourmenuItem.setSelected(true);
\r
233 case ColourSchemeProperty.CLUSTAL:
\r
234 clustalColour.setSelected(true);
\r
238 case ColourSchemeProperty.BLOSUM:
\r
239 BLOSUM62Colour.setSelected(true);
\r
243 case ColourSchemeProperty.PID:
\r
244 PIDColour.setSelected(true);
\r
248 case ColourSchemeProperty.ZAPPO:
\r
249 zappoColour.setSelected(true);
\r
253 case ColourSchemeProperty.TAYLOR:
\r
254 taylorColour.setSelected(true);
\r
257 case ColourSchemeProperty.HYDROPHOBIC:
\r
258 hydrophobicityColour.setSelected(true);
\r
262 case ColourSchemeProperty.HELIX:
\r
263 helixColour.setSelected(true);
\r
267 case ColourSchemeProperty.STRAND:
\r
268 strandColour.setSelected(true);
\r
272 case ColourSchemeProperty.TURN:
\r
273 turnColour.setSelected(true);
\r
277 case ColourSchemeProperty.BURIED:
\r
278 buriedColour.setSelected(true);
\r
282 case ColourSchemeProperty.NUCLEOTIDE:
\r
283 nucleotideColour.setSelected(true);
\r
287 case ColourSchemeProperty.USER_DEFINED:
\r
288 userDefinedColour.setSelected(true);
\r
296 private void jbInit()
\r
299 fileMenu.setMnemonic('F');
\r
300 fileMenu.setText("File");
\r
301 saveAlignmentMenu.setMnemonic('L');
\r
302 saveAlignmentMenu.setText("Save As");
\r
303 saveAlignmentMenu.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.
\r
304 awt.event.KeyEvent.VK_S, java.awt.event.KeyEvent.CTRL_MASK, false));
\r
305 saveAlignmentMenu.addActionListener(new ActionListener()
\r
307 public void actionPerformed(ActionEvent e)
\r
309 saveAlignmentMenu_actionPerformed(e);
\r
312 closeMenuItem.setMnemonic('C');
\r
313 closeMenuItem.setText("Close");
\r
314 closeMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
316 public void actionPerformed(ActionEvent e)
\r
318 closeMenuItem_actionPerformed(e);
\r
321 editMenu.setText("Edit");
\r
322 viewMenu.setText("View");
\r
323 colourMenu.setText("Colour");
\r
324 calculateMenu.setText("Calculate");
\r
325 webService.setText("Web Service");
\r
326 selectAllSequenceMenuItem.setText("Select all");
\r
327 selectAllSequenceMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
\r
328 java.awt.event.KeyEvent.VK_A,
\r
329 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
\r
330 selectAllSequenceMenuItem.addActionListener(new java.awt.event.
\r
333 public void actionPerformed(ActionEvent e)
\r
335 selectAllSequenceMenuItem_actionPerformed(e);
\r
338 deselectAllSequenceMenuItem.setText("Deselect All");
\r
339 deselectAllSequenceMenuItem.setAccelerator(javax.swing.KeyStroke.
\r
341 java.awt.event.KeyEvent.VK_ESCAPE, 0, false));
\r
342 deselectAllSequenceMenuItem.addActionListener(new java.awt.event.
\r
345 public void actionPerformed(ActionEvent e)
\r
347 deselectAllSequenceMenuItem_actionPerformed(e);
\r
350 invertSequenceMenuItem.setText("Invert Selection");
\r
351 invertSequenceMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
353 public void actionPerformed(ActionEvent e)
\r
355 invertSequenceMenuItem_actionPerformed(e);
\r
358 remove2LeftMenuItem.setText("Remove Left");
\r
359 remove2LeftMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
361 public void actionPerformed(ActionEvent e)
\r
363 remove2LeftMenuItem_actionPerformed(e);
\r
366 remove2RightMenuItem.setText("Remove Right");
\r
367 remove2RightMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
369 public void actionPerformed(ActionEvent e)
\r
371 remove2RightMenuItem_actionPerformed(e);
\r
374 removeGappedColumnMenuItem.setText("Remove Empty Columns");
\r
375 removeGappedColumnMenuItem.addActionListener(new java.awt.event.
\r
378 public void actionPerformed(ActionEvent e)
\r
380 removeGappedColumnMenuItem_actionPerformed(e);
\r
383 removeAllGapsMenuItem.setText("Remove All Gaps");
\r
384 removeAllGapsMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
386 public void actionPerformed(ActionEvent e)
\r
388 removeAllGapsMenuItem_actionPerformed(e);
\r
391 viewBoxesMenuItem.setText("Boxes");
\r
392 viewBoxesMenuItem.setState(true);
\r
393 viewBoxesMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
395 public void actionPerformed(ActionEvent e)
\r
397 viewBoxesMenuItem_actionPerformed(e);
\r
400 viewTextMenuItem.setText("Text");
\r
401 viewTextMenuItem.setState(true);
\r
402 viewTextMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
404 public void actionPerformed(ActionEvent e)
\r
406 viewTextMenuItem_actionPerformed(e);
\r
409 sortPairwiseMenuItem.setText("by Pairwise Identity");
\r
410 sortPairwiseMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
412 public void actionPerformed(ActionEvent e)
\r
414 sortPairwiseMenuItem_actionPerformed(e);
\r
417 sortIDMenuItem.setText("by ID");
\r
418 sortIDMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
420 public void actionPerformed(ActionEvent e)
\r
422 sortIDMenuItem_actionPerformed(e);
\r
425 sortGroupMenuItem.setText("by Group");
\r
426 sortGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
428 public void actionPerformed(ActionEvent e)
\r
430 sortGroupMenuItem_actionPerformed(e);
\r
433 removeRedundancyMenuItem.setText("Remove Redundancy...");
\r
434 removeRedundancyMenuItem.addActionListener(new java.awt.event.
\r
437 public void actionPerformed(ActionEvent e)
\r
439 removeRedundancyMenuItem_actionPerformed(e);
\r
442 pairwiseAlignmentMenuItem.setText("Pairwise Alignments...");
\r
443 pairwiseAlignmentMenuItem.addActionListener(new java.awt.event.
\r
446 public void actionPerformed(ActionEvent e)
\r
448 pairwiseAlignmentMenuItem_actionPerformed(e);
\r
451 PCAMenuItem.setText("Principal Component Analysis");
\r
452 PCAMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
454 public void actionPerformed(ActionEvent e)
\r
456 PCAMenuItem_actionPerformed(e);
\r
459 averageDistanceTreeMenuItem.setText(
\r
460 "Average Distance Using % Identity");
\r
461 averageDistanceTreeMenuItem.addActionListener(new java.awt.event.
\r
464 public void actionPerformed(ActionEvent e)
\r
466 averageDistanceTreeMenuItem_actionPerformed(e);
\r
469 neighbourTreeMenuItem.setText("Neighbour Joining Using % Identity");
\r
470 neighbourTreeMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
472 public void actionPerformed(ActionEvent e)
\r
474 neighbourTreeMenuItem_actionPerformed(e);
\r
477 this.getContentPane().setLayout(borderLayout1);
\r
478 alignFrameMenuBar.setFont(new java.awt.Font("Verdana", 0, 11));
\r
479 alignFrameMenuBar.addAncestorListener(new AncestorListener()
\r
481 public void ancestorAdded(AncestorEvent event)
\r
483 alignFrameMenuBar_ancestorAdded(event);
\r
486 public void ancestorRemoved(AncestorEvent event)
\r
490 public void ancestorMoved(AncestorEvent event)
\r
494 statusBar.setBackground(Color.white);
\r
495 statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
\r
496 statusBar.setBorder(BorderFactory.createLineBorder(Color.black));
\r
497 statusBar.setText("Status bar");
\r
498 outputTextboxMenu.setMnemonic('T');
\r
499 outputTextboxMenu.setText("Output to Textbox");
\r
500 clustalColour.setText("Clustalx");
\r
502 clustalColour.addActionListener(new java.awt.event.ActionListener()
\r
504 public void actionPerformed(ActionEvent e)
\r
506 clustalColour_actionPerformed(e);
\r
509 zappoColour.setText("Zappo");
\r
510 zappoColour.addActionListener(new java.awt.event.ActionListener()
\r
512 public void actionPerformed(ActionEvent e)
\r
514 zappoColour_actionPerformed(e);
\r
517 taylorColour.setText("Taylor");
\r
518 taylorColour.addActionListener(new java.awt.event.ActionListener()
\r
520 public void actionPerformed(ActionEvent e)
\r
522 taylorColour_actionPerformed(e);
\r
525 hydrophobicityColour.setText("Hydrophobicity");
\r
526 hydrophobicityColour.addActionListener(new java.awt.event.ActionListener()
\r
528 public void actionPerformed(ActionEvent e)
\r
530 hydrophobicityColour_actionPerformed(e);
\r
533 helixColour.setText("Helix Propensity");
\r
534 helixColour.addActionListener(new java.awt.event.ActionListener()
\r
536 public void actionPerformed(ActionEvent e)
\r
538 helixColour_actionPerformed(e);
\r
541 strandColour.setText("Strand Propensity");
\r
542 strandColour.addActionListener(new java.awt.event.ActionListener()
\r
544 public void actionPerformed(ActionEvent e)
\r
546 strandColour_actionPerformed(e);
\r
549 turnColour.setText("Turn Propensity");
\r
550 turnColour.addActionListener(new java.awt.event.ActionListener()
\r
552 public void actionPerformed(ActionEvent e)
\r
554 turnColour_actionPerformed(e);
\r
557 buriedColour.setText("Buried Index");
\r
558 buriedColour.addActionListener(new java.awt.event.ActionListener()
\r
560 public void actionPerformed(ActionEvent e)
\r
562 buriedColour_actionPerformed(e);
\r
565 userDefinedColour.setText("User Defined...");
\r
566 userDefinedColour.addActionListener(new java.awt.event.ActionListener()
\r
568 public void actionPerformed(ActionEvent e)
\r
570 userDefinedColour_actionPerformed(e);
\r
573 PIDColour.setText("Percentage Identity");
\r
574 PIDColour.addActionListener(new java.awt.event.ActionListener()
\r
576 public void actionPerformed(ActionEvent e)
\r
578 PIDColour_actionPerformed(e);
\r
581 BLOSUM62Colour.setText("BLOSUM62 Score");
\r
582 BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
\r
584 public void actionPerformed(ActionEvent e)
\r
586 BLOSUM62Colour_actionPerformed(e);
\r
589 avDistanceTreeBlosumMenuItem.setText(
\r
590 "Average Distance Using BLOSUM62");
\r
591 avDistanceTreeBlosumMenuItem.addActionListener(new java.awt.event.
\r
594 public void actionPerformed(ActionEvent e)
\r
596 avTreeBlosumMenuItem_actionPerformed(e);
\r
599 njTreeBlosumMenuItem.setText("Neighbour Joining using BLOSUM62");
\r
600 njTreeBlosumMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
602 public void actionPerformed(ActionEvent e)
\r
604 njTreeBlosumMenuItem_actionPerformed(e);
\r
607 annotationPanelMenuItem.setActionCommand("");
\r
608 annotationPanelMenuItem.setText("Show Annotations");
\r
609 annotationPanelMenuItem.setState( jalview.bin.Cache.getDefault("SHOW_ANNOTATIONS",true));
\r
610 annotationPanelMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
612 public void actionPerformed(ActionEvent e)
\r
614 annotationPanelMenuItem_actionPerformed(e);
\r
617 colourTextMenuItem.setText("Colour Text");
\r
618 colourTextMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
620 public void actionPerformed(ActionEvent e)
\r
622 colourTextMenuItem_actionPerformed(e);
\r
625 htmlMenuItem.setText("HTML");
\r
626 htmlMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
628 public void actionPerformed(ActionEvent e)
\r
630 htmlMenuItem_actionPerformed(e);
\r
633 overviewMenuItem.setText("Overview Window");
\r
634 overviewMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
636 public void actionPerformed(ActionEvent e)
\r
638 overviewMenuItem_actionPerformed(e);
\r
641 undoMenuItem.setEnabled(false);
\r
642 undoMenuItem.setMnemonic('Z');
\r
643 undoMenuItem.setText("Undo");
\r
644 undoMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
\r
645 java.awt.event.KeyEvent.VK_Z,
\r
646 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
\r
647 undoMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
649 public void actionPerformed(ActionEvent e)
\r
651 undoMenuItem_actionPerformed(e);
\r
654 redoMenuItem.setEnabled(false);
\r
655 redoMenuItem.setMnemonic('0');
\r
656 redoMenuItem.setText("Redo");
\r
657 redoMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
659 public void actionPerformed(ActionEvent e)
\r
661 redoMenuItem_actionPerformed(e);
\r
664 conservationMenuItem.setText("By Conservation");
\r
665 conservationMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
667 public void actionPerformed(ActionEvent e)
\r
669 conservationMenuItem_actionPerformed(e);
\r
672 noColourmenuItem.setText("None");
\r
673 noColourmenuItem.addActionListener(new java.awt.event.ActionListener()
\r
675 public void actionPerformed(ActionEvent e)
\r
677 noColourmenuItem_actionPerformed(e);
\r
680 wrapMenuItem.setText("Wrap");
\r
681 wrapMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
683 public void actionPerformed(ActionEvent e)
\r
685 wrapMenuItem_actionPerformed(e);
\r
688 printMenuItem.setText("Print");
\r
689 printMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
691 public void actionPerformed(ActionEvent e)
\r
693 printMenuItem_actionPerformed(e);
\r
696 renderGapsMenuItem.setText("Show Gaps");
\r
697 renderGapsMenuItem.setState(true);
\r
698 renderGapsMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
700 public void actionPerformed(ActionEvent e)
\r
702 renderGapsMenuItem_actionPerformed(e);
\r
705 findMenuItem.setText("Find...");
\r
706 findMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
\r
707 java.awt.event.KeyEvent.VK_F,
\r
708 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
\r
709 findMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
711 public void actionPerformed(ActionEvent e)
\r
713 findMenuItem_actionPerformed(e);
\r
716 searchMenu.setText("Search");
\r
718 abovePIDThreshold.setText("Above Identity Threshold");
\r
719 abovePIDThreshold.addActionListener(new java.awt.event.ActionListener()
\r
721 public void actionPerformed(ActionEvent e)
\r
723 abovePIDThreshold_actionPerformed(e);
\r
726 sequenceFeatures.setText("Sequence Features");
\r
727 sequenceFeatures.addActionListener(new ActionListener()
\r
729 public void actionPerformed(ActionEvent actionEvent)
\r
731 sequenceFeatures_actionPerformed(actionEvent);
\r
734 nucleotideColour.setText("Nucleotide");
\r
735 nucleotideColour.addActionListener(new java.awt.event.ActionListener()
\r
737 public void actionPerformed(ActionEvent e)
\r
739 nucleotideColour_actionPerformed(e);
\r
742 deleteGroups.setText("Undefine groups");
\r
743 deleteGroups.addActionListener(new java.awt.event.ActionListener()
\r
745 public void actionPerformed(ActionEvent e)
\r
747 deleteGroups_actionPerformed(e);
\r
750 copy.setText("Copy");
\r
751 copy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
\r
752 java.awt.event.KeyEvent.VK_C,
\r
753 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
\r
754 copy.setMnemonic(KeyEvent.VK_C);
\r
756 copy.addActionListener(new java.awt.event.ActionListener()
\r
758 public void actionPerformed(ActionEvent e)
\r
760 copy_actionPerformed(e);
\r
763 cut.setText("Cut");
\r
764 cut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
\r
765 java.awt.event.KeyEvent.VK_X,
\r
766 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
\r
767 cut.setMnemonic(KeyEvent.VK_X);
\r
768 cut.addActionListener(new java.awt.event.ActionListener()
\r
770 public void actionPerformed(ActionEvent e)
\r
772 cut_actionPerformed(e);
\r
775 delete.setText("Delete");
\r
776 delete.addActionListener(new java.awt.event.ActionListener()
\r
778 public void actionPerformed(ActionEvent e)
\r
780 delete_actionPerformed(e);
\r
783 jMenu1.setMnemonic('V');
\r
784 jMenu1.setText("Paste");
\r
785 pasteNew.setText("To New Alignment");
\r
786 pasteNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
\r
787 java.awt.event.KeyEvent.VK_V,
\r
788 Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false));
\r
789 pasteNew.addActionListener(new java.awt.event.ActionListener()
\r
791 public void actionPerformed(ActionEvent e)
\r
793 pasteNew_actionPerformed(e);
\r
796 pasteThis.setText("Add To This Alignment");
\r
797 pasteThis.addActionListener(new java.awt.event.ActionListener()
\r
799 public void actionPerformed(ActionEvent e)
\r
801 pasteThis_actionPerformed(e);
\r
804 applyToAllGroups.setText("Apply Colour To All Groups");
\r
805 applyToAllGroups.setState(true);
\r
806 applyToAllGroups.addActionListener(new java.awt.event.ActionListener()
\r
808 public void actionPerformed(ActionEvent e)
\r
810 applyToAllGroups_actionPerformed(e);
\r
813 createPNG.addActionListener(new java.awt.event.ActionListener()
\r
815 public void actionPerformed(ActionEvent e)
\r
820 createPNG.setActionCommand("Save As PNG Image");
\r
821 createPNG.setText("PNG");
\r
822 font.setText("Font...");
\r
823 font.addActionListener(new java.awt.event.ActionListener()
\r
825 public void actionPerformed(ActionEvent e)
\r
827 font_actionPerformed(e);
\r
831 seqLimits.setText("Show Sequence Limits");
\r
832 seqLimits.setState( jalview.bin.Cache.getDefault("SHOW_JVSUFFIX",true));
\r
833 seqLimits.addActionListener(new java.awt.event.ActionListener()
\r
835 public void actionPerformed(ActionEvent e)
\r
837 seqLimit_actionPerformed(e);
\r
840 epsFile.setText("EPS");
\r
841 epsFile.addActionListener(new java.awt.event.ActionListener()
\r
843 public void actionPerformed(ActionEvent e)
\r
848 LoadtreeMenuItem.setActionCommand("Load a tree for this sequence set");
\r
849 LoadtreeMenuItem.setText("Load Assocated Tree");
\r
850 LoadtreeMenuItem.addActionListener(new java.awt.event.ActionListener()
\r
852 public void actionPerformed(ActionEvent e)
\r
854 LoadtreeMenuItem_actionPerformed(e);
\r
857 scaleAbove.setVisible(false);
\r
858 scaleAbove.setText("Scale Above");
\r
859 scaleAbove.addActionListener(new java.awt.event.ActionListener()
\r
861 public void actionPerformed(ActionEvent e)
\r
863 scaleAbove_actionPerformed(e);
\r
866 scaleLeft.setVisible(false);
\r
867 scaleLeft.setSelected(true);
\r
868 scaleLeft.setText("Scale Left");
\r
869 scaleLeft.addActionListener(new java.awt.event.ActionListener()
\r
871 public void actionPerformed(ActionEvent e)
\r
873 scaleLeft_actionPerformed(e);
\r
876 scaleRight.setVisible(false);
\r
877 scaleRight.setSelected(true);
\r
878 scaleRight.setText("Scale Right");
\r
879 scaleRight.addActionListener(new java.awt.event.ActionListener()
\r
881 public void actionPerformed(ActionEvent e)
\r
883 scaleRight_actionPerformed(e);
\r
886 modifyPID.setText("Modify Identity Threshold...");
\r
887 modifyPID.addActionListener(new java.awt.event.ActionListener()
\r
889 public void actionPerformed(ActionEvent e)
\r
891 modifyPID_actionPerformed(e);
\r
894 modifyConservation.setText("Modify Conservation Threshold...");
\r
895 modifyConservation.addActionListener(new java.awt.event.ActionListener()
\r
897 public void actionPerformed(ActionEvent e)
\r
899 modifyConservation_actionPerformed(e);
\r
902 sortByTreeMenu.setText("By Tree Order");
\r
903 sort.setText("Sort");
\r
904 calculate.setText("Calculate Tree");
\r
906 jMenu2.setText("Export");
\r
907 padGapsMenuitem.setText("Pad Gaps");
\r
908 padGapsMenuitem.addActionListener(new ActionListener()
\r
910 public void actionPerformed(ActionEvent e)
\r
912 padGapsMenuitem_actionPerformed(e);
\r
915 vamsasStore.setText("VAMSAS store");
\r
916 vamsasStore.addActionListener(new ActionListener()
\r
918 public void actionPerformed(ActionEvent e)
\r
920 vamsasStore_actionPerformed(e);
\r
923 showTranslation.setText("Translate cDNA");
\r
924 showTranslation.addActionListener(new ActionListener()
\r
926 public void actionPerformed(ActionEvent e)
\r
928 showTranslation_actionPerformed(e);
\r
932 tabbedPane.addChangeListener(new ChangeListener()
\r
934 public void stateChanged(ChangeEvent ece)
\r
940 featureSettings.setEnabled(false);
\r
941 featureSettings.setText("Feature Settings...");
\r
942 featureSettings.addActionListener(new ActionListener()
\r
944 public void actionPerformed(ActionEvent e)
\r
946 featureSettings_actionPerformed(e);
\r
949 seqDBRef.setState( jalview.bin.Cache.getDefault("SHOW_DBPREFIX",true));
\r
950 seqDBRef.setText("Show Sequence DB Refs");
\r
951 seqDBRef.addActionListener(new ActionListener()
\r
953 public void actionPerformed(ActionEvent e)
\r
955 seqDBRef_actionPerformed(e);
\r
958 alignFrameMenuBar.add(fileMenu);
\r
959 alignFrameMenuBar.add(editMenu);
\r
960 alignFrameMenuBar.add(searchMenu);
\r
961 alignFrameMenuBar.add(viewMenu);
\r
962 alignFrameMenuBar.add(colourMenu);
\r
963 alignFrameMenuBar.add(calculateMenu);
\r
964 alignFrameMenuBar.add(webService);
\r
965 fileMenu.add(vamsasStore);
\r
966 fileMenu.add(saveAlignmentMenu);
\r
967 fileMenu.add(jMenu2);
\r
968 fileMenu.add(outputTextboxMenu);
\r
969 fileMenu.add(printMenuItem);
\r
970 fileMenu.addSeparator();
\r
971 fileMenu.add(LoadtreeMenuItem);
\r
972 fileMenu.addSeparator();
\r
973 fileMenu.add(closeMenuItem);
\r
974 editMenu.add(undoMenuItem);
\r
975 editMenu.add(redoMenuItem);
\r
977 editMenu.add(copy);
\r
978 editMenu.add(jMenu1);
\r
979 editMenu.add(delete);
\r
980 editMenu.addSeparator();
\r
981 editMenu.add(selectAllSequenceMenuItem);
\r
982 editMenu.add(deselectAllSequenceMenuItem);
\r
983 editMenu.add(invertSequenceMenuItem);
\r
984 editMenu.add(deleteGroups);
\r
985 editMenu.addSeparator();
\r
986 editMenu.add(remove2LeftMenuItem);
\r
987 editMenu.add(remove2RightMenuItem);
\r
988 editMenu.add(removeGappedColumnMenuItem);
\r
989 editMenu.add(removeAllGapsMenuItem);
\r
990 editMenu.add(removeRedundancyMenuItem);
\r
991 editMenu.addSeparator();
\r
992 editMenu.add(padGapsMenuitem);
\r
993 searchMenu.add(findMenuItem);
\r
994 viewMenu.add(font);
\r
995 viewMenu.addSeparator();
\r
996 viewMenu.add(wrapMenuItem);
\r
997 viewMenu.add(seqDBRef);
\r
998 viewMenu.add(seqLimits);
\r
999 viewMenu.add(scaleAbove);
\r
1000 viewMenu.add(scaleLeft);
\r
1001 viewMenu.add(scaleRight);
\r
1002 viewMenu.add(viewBoxesMenuItem);
\r
1003 viewMenu.add(viewTextMenuItem);
\r
1004 viewMenu.add(colourTextMenuItem);
\r
1005 viewMenu.add(renderGapsMenuItem);
\r
1006 viewMenu.add(annotationPanelMenuItem);
\r
1007 viewMenu.addSeparator();
\r
1008 viewMenu.add(sequenceFeatures);
\r
1009 viewMenu.add(featureSettings);
\r
1010 viewMenu.addSeparator();
\r
1011 viewMenu.add(overviewMenuItem);
\r
1012 colourMenu.add(applyToAllGroups);
\r
1013 colourMenu.addSeparator();
\r
1014 colourMenu.add(noColourmenuItem);
\r
1015 colourMenu.add(clustalColour);
\r
1016 colourMenu.add(BLOSUM62Colour);
\r
1017 colourMenu.add(PIDColour);
\r
1018 colourMenu.add(zappoColour);
\r
1019 colourMenu.add(taylorColour);
\r
1020 colourMenu.add(hydrophobicityColour);
\r
1021 colourMenu.add(helixColour);
\r
1022 colourMenu.add(strandColour);
\r
1023 colourMenu.add(turnColour);
\r
1024 colourMenu.add(buriedColour);
\r
1025 colourMenu.add(nucleotideColour);
\r
1026 colourMenu.add(userDefinedColour);
\r
1027 colourMenu.addSeparator();
\r
1028 colourMenu.add(conservationMenuItem);
\r
1029 colourMenu.add(modifyConservation);
\r
1030 colourMenu.add(abovePIDThreshold);
\r
1031 colourMenu.add(modifyPID);
\r
1032 calculateMenu.add(sort);
\r
1033 calculateMenu.add(calculate);
\r
1034 calculateMenu.addSeparator();
\r
1035 calculateMenu.add(pairwiseAlignmentMenuItem);
\r
1036 calculateMenu.add(PCAMenuItem);
\r
1037 calculateMenu.addSeparator();
\r
1038 calculateMenu.add(showTranslation);
\r
1039 webServiceNoServices=new JMenuItem("<No Services>");
\r
1040 webService.add(webServiceNoServices);
\r
1041 this.getContentPane().add(statusBar, BorderLayout.SOUTH);
\r
1042 this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
\r
1043 jMenu1.add(pasteNew);
\r
1044 jMenu1.add(pasteThis);
\r
1045 sort.add(sortIDMenuItem);
\r
1046 sort.add(sortGroupMenuItem);
\r
1047 sort.add(sortPairwiseMenuItem);
\r
1048 calculate.add(averageDistanceTreeMenuItem);
\r
1049 calculate.add(neighbourTreeMenuItem);
\r
1050 calculate.add(avDistanceTreeBlosumMenuItem);
\r
1051 calculate.add(njTreeBlosumMenuItem);
\r
1052 jMenu2.add(htmlMenuItem);
\r
1053 jMenu2.add(epsFile);
\r
1054 jMenu2.add(createPNG);
\r
1057 protected void outputText_actionPerformed(ActionEvent e)
\r
1061 protected void htmlMenuItem_actionPerformed(ActionEvent e)
\r
1065 protected void closeMenuItem_actionPerformed(ActionEvent e)
\r
1069 protected void redoMenuItem_actionPerformed(ActionEvent e)
\r
1073 protected void undoMenuItem_actionPerformed(ActionEvent e)
\r
1077 protected void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
\r
1081 protected void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
\r
1085 protected void invertSequenceMenuItem_actionPerformed(ActionEvent e)
\r
1089 protected void remove2LeftMenuItem_actionPerformed(ActionEvent e)
\r
1093 protected void remove2RightMenuItem_actionPerformed(ActionEvent e)
\r
1097 protected void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
\r
1101 protected void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
\r
1105 protected void wrapMenuItem_actionPerformed(ActionEvent e)
\r
1109 protected void viewBoxesMenuItem_actionPerformed(ActionEvent e)
\r
1113 protected void viewTextMenuItem_actionPerformed(ActionEvent e)
\r
1117 protected void colourTextMenuItem_actionPerformed(ActionEvent e)
\r
1121 protected void annotationPanelMenuItem_actionPerformed(ActionEvent e)
\r
1125 protected void overviewMenuItem_actionPerformed(ActionEvent e)
\r
1129 protected void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
\r
1133 protected void sortIDMenuItem_actionPerformed(ActionEvent e)
\r
1137 protected void sortGroupMenuItem_actionPerformed(ActionEvent e)
\r
1141 protected void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
\r
1145 protected void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
\r
1149 protected void PCAMenuItem_actionPerformed(ActionEvent e)
\r
1153 protected void averageDistanceTreeMenuItem_actionPerformed(ActionEvent e)
\r
1157 protected void neighbourTreeMenuItem_actionPerformed(ActionEvent e)
\r
1161 protected void njTreeBlosumMenuItem_actionPerformed(ActionEvent e)
\r
1165 protected void avTreeBlosumMenuItem_actionPerformed(ActionEvent e)
\r
1169 protected void clustalAlignMenuItem_actionPerformed(ActionEvent e)
\r
1173 protected void clustalColour_actionPerformed(ActionEvent e)
\r
1177 protected void zappoColour_actionPerformed(ActionEvent e)
\r
1181 protected void taylorColour_actionPerformed(ActionEvent e)
\r
1185 protected void hydrophobicityColour_actionPerformed(ActionEvent e)
\r
1189 protected void helixColour_actionPerformed(ActionEvent e)
\r
1193 protected void strandColour_actionPerformed(ActionEvent e)
\r
1197 protected void turnColour_actionPerformed(ActionEvent e)
\r
1201 protected void buriedColour_actionPerformed(ActionEvent e)
\r
1205 protected void userDefinedColour_actionPerformed(ActionEvent e)
\r
1209 protected void PIDColour_actionPerformed(ActionEvent e)
\r
1213 protected void BLOSUM62Colour_actionPerformed(ActionEvent e)
\r
1217 protected void noColourmenuItem_actionPerformed(ActionEvent e)
\r
1221 protected void conservationMenuItem_actionPerformed(ActionEvent e)
\r
1225 protected void printMenuItem_actionPerformed(ActionEvent e)
\r
1229 protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
\r
1233 protected void findMenuItem_actionPerformed(ActionEvent e)
\r
1237 protected void abovePIDThreshold_actionPerformed(ActionEvent e)
\r
1241 public void sequenceFeatures_actionPerformed(ActionEvent actionEvent)
\r
1245 protected void nucleotideColour_actionPerformed(ActionEvent e)
\r
1249 protected void deleteGroups_actionPerformed(ActionEvent e)
\r
1253 protected void copy_actionPerformed(ActionEvent e)
\r
1257 protected void cut_actionPerformed(ActionEvent e)
\r
1261 protected void delete_actionPerformed(ActionEvent e)
\r
1265 protected void pasteNew_actionPerformed(ActionEvent e)
\r
1269 protected void pasteThis_actionPerformed(ActionEvent e)
\r
1273 protected void applyToAllGroups_actionPerformed(ActionEvent e)
\r
1277 public void createPNG(java.io.File f)
\r
1281 protected void font_actionPerformed(ActionEvent e)
\r
1285 protected void seqLimit_actionPerformed(ActionEvent e)
\r
1289 public void seqDBRef_actionPerformed(ActionEvent e)
\r
1295 public void createEPS(java.io.File f)
\r
1299 protected void LoadtreeMenuItem_actionPerformed(ActionEvent e)
\r
1303 protected void jpred_actionPerformed(ActionEvent e)
\r
1307 protected void scaleAbove_actionPerformed(ActionEvent e)
\r
1311 protected void scaleLeft_actionPerformed(ActionEvent e)
\r
1315 protected void scaleRight_actionPerformed(ActionEvent e)
\r
1319 protected void modifyPID_actionPerformed(ActionEvent e)
\r
1323 protected void modifyConservation_actionPerformed(ActionEvent e)
\r
1327 protected void preferences_actionPerformed(ActionEvent e)
\r
1331 protected void msaAlignMenuItem_actionPerformed(ActionEvent e)
\r
1335 protected void alignFrameMenuBar_ancestorAdded(AncestorEvent event)
\r
1339 protected void saveAlignmentMenu_actionPerformed(ActionEvent e)
\r
1343 protected void padGapsMenuitem_actionPerformed(ActionEvent e)
\r
1347 protected void ClustalRealign_actionPerformed(ActionEvent e)
\r
1351 public void vamsasStore_actionPerformed(ActionEvent e)
\r
1356 public void vamsasLoad_actionPerformed(ActionEvent e)
\r
1361 public void showTranslation_actionPerformed(ActionEvent e)
\r
1366 public void tabSelected()
\r
1371 public void featureSettings_actionPerformed(ActionEvent e)
\r