2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.jbgui;
23 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
24 import jalview.api.SplitContainerI;
25 import jalview.bin.Cache;
26 import jalview.gui.JvSwingUtils;
27 import jalview.gui.Preferences;
28 import jalview.schemes.ColourSchemeProperty;
29 import jalview.util.MessageManager;
31 import java.awt.BorderLayout;
32 import java.awt.Color;
33 import java.awt.GridLayout;
34 import java.awt.Toolkit;
35 import java.awt.event.ActionEvent;
36 import java.awt.event.ActionListener;
37 import java.awt.event.FocusAdapter;
38 import java.awt.event.FocusEvent;
39 import java.awt.event.KeyEvent;
40 import java.awt.event.MouseAdapter;
41 import java.awt.event.MouseEvent;
42 import java.util.HashMap;
45 import javax.swing.BorderFactory;
46 import javax.swing.ButtonGroup;
47 import javax.swing.JCheckBoxMenuItem;
48 import javax.swing.JInternalFrame;
49 import javax.swing.JLabel;
50 import javax.swing.JMenu;
51 import javax.swing.JMenuBar;
52 import javax.swing.JMenuItem;
53 import javax.swing.JOptionPane;
54 import javax.swing.JPanel;
55 import javax.swing.JRadioButtonMenuItem;
56 import javax.swing.JTabbedPane;
57 import javax.swing.KeyStroke;
58 import javax.swing.event.ChangeEvent;
59 import javax.swing.event.MenuEvent;
60 import javax.swing.event.MenuListener;
62 public class GAlignFrame extends JInternalFrame
64 protected JMenuBar alignFrameMenuBar = new JMenuBar();
66 protected JMenuItem closeMenuItem = new JMenuItem();
68 protected JMenu colourMenu = new JMenu();
70 protected JMenu webService = new JMenu();
72 protected JMenuItem webServiceNoServices;
74 public JCheckBoxMenuItem viewBoxesMenuItem = new JCheckBoxMenuItem();
76 public JCheckBoxMenuItem viewTextMenuItem = new JCheckBoxMenuItem();
78 protected JMenu sortByAnnotScore = new JMenu();
80 public JLabel statusBar = new JLabel();
82 protected JMenu outputTextboxMenu = new JMenu();
84 protected JRadioButtonMenuItem clustalColour = new JRadioButtonMenuItem();
86 protected JRadioButtonMenuItem zappoColour = new JRadioButtonMenuItem();
88 protected JRadioButtonMenuItem taylorColour = new JRadioButtonMenuItem();
90 protected JRadioButtonMenuItem hydrophobicityColour = new JRadioButtonMenuItem();
92 protected JRadioButtonMenuItem helixColour = new JRadioButtonMenuItem();
94 protected JRadioButtonMenuItem strandColour = new JRadioButtonMenuItem();
96 protected JRadioButtonMenuItem turnColour = new JRadioButtonMenuItem();
98 protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
100 protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem();
102 protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem();
104 protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
106 protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
108 protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
110 protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
112 // protected JRadioButtonMenuItem covariationColour = new
113 // JRadioButtonMenuItem();
115 protected JRadioButtonMenuItem tcoffeeColour = new JRadioButtonMenuItem();
117 public JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem();
119 public JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem();
121 public JCheckBoxMenuItem showNonconservedMenuItem = new JCheckBoxMenuItem();
123 protected JMenuItem undoMenuItem = new JMenuItem();
125 protected JMenuItem redoMenuItem = new JMenuItem();
127 public JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
129 JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
131 public JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem();
133 public JCheckBoxMenuItem renderGapsMenuItem = new JCheckBoxMenuItem();
135 public JCheckBoxMenuItem abovePIDThreshold = new JCheckBoxMenuItem();
137 public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem();
139 JMenuItem copy = new JMenuItem();
141 JMenuItem cut = new JMenuItem();
143 JMenu pasteMenu = new JMenu();
145 public JCheckBoxMenuItem applyToAllGroups = new JCheckBoxMenuItem();
147 public JCheckBoxMenuItem seqLimits = new JCheckBoxMenuItem();
149 public JCheckBoxMenuItem scaleAbove = new JCheckBoxMenuItem();
151 public JCheckBoxMenuItem scaleLeft = new JCheckBoxMenuItem();
153 public JCheckBoxMenuItem scaleRight = new JCheckBoxMenuItem();
155 protected JMenuItem modifyConservation = new JMenuItem();
157 protected JMenu sortByTreeMenu = new JMenu();
159 protected JMenu sort = new JMenu();
161 protected JMenu calculateTree = new JMenu();
163 protected JCheckBoxMenuItem padGapsMenuitem = new JCheckBoxMenuItem();
165 protected JCheckBoxMenuItem showNpFeatsMenuitem = new JCheckBoxMenuItem();
167 protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem();
169 protected ButtonGroup colours = new ButtonGroup();
171 protected JMenuItem showTranslation = new JMenuItem();
173 protected JMenuItem showReverse = new JMenuItem();
175 protected JMenuItem showReverseComplement = new JMenuItem();
177 protected JMenu showProducts = new JMenu();
179 protected JMenuItem runGroovy = new JMenuItem();
181 protected JMenuItem rnahelicesColour = new JMenuItem();
183 protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
185 protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem();
187 protected JCheckBoxMenuItem listenToViewSelections = new JCheckBoxMenuItem();
189 protected JPanel statusPanel = new JPanel();
191 protected JMenuItem showAllSeqAnnotations = new JMenuItem();
193 protected JMenuItem hideAllSeqAnnotations = new JMenuItem();
195 protected JMenuItem showAllAlAnnotations = new JMenuItem();
197 protected JMenuItem hideAllAlAnnotations = new JMenuItem();
199 protected JCheckBoxMenuItem showComplementMenuItem = new JCheckBoxMenuItem();
201 protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem();
203 protected JTabbedPane tabbedPane = new JTabbedPane();
205 protected JMenuItem reload = new JMenuItem();
207 protected JMenu formatMenu = new JMenu();
209 protected JCheckBoxMenuItem idRightAlign = new JCheckBoxMenuItem();
211 protected JCheckBoxMenuItem centreColumnLabelsMenuItem = new JCheckBoxMenuItem();
213 protected JCheckBoxMenuItem followHighlightMenuItem = new JCheckBoxMenuItem();
215 protected JMenuItem gatherViews = new JMenuItem();
217 protected JMenuItem expandViews = new JMenuItem();
219 protected JCheckBoxMenuItem showGroupConsensus = new JCheckBoxMenuItem();
221 protected JCheckBoxMenuItem showGroupConservation = new JCheckBoxMenuItem();
223 protected JCheckBoxMenuItem showConsensusHistogram = new JCheckBoxMenuItem();
225 protected JCheckBoxMenuItem showSequenceLogo = new JCheckBoxMenuItem();
227 protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
229 protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
231 private SequenceAnnotationOrder annotationSortOrder;
233 private boolean showAutoCalculatedAbove = false;
235 private Map<KeyStroke, JMenuItem> accelerators = new HashMap<KeyStroke, JMenuItem>();
237 private SplitContainerI splitFrame;
244 setJMenuBar(alignFrameMenuBar);
246 // dynamically fill save as menu with available formats
247 for (int i = 0; i < jalview.io.FormatAdapter.WRITEABLE_FORMATS.length; i++)
249 JMenuItem item = new JMenuItem(
250 jalview.io.FormatAdapter.WRITEABLE_FORMATS[i]);
252 item.addActionListener(new ActionListener()
255 public void actionPerformed(ActionEvent e)
257 outputText_actionPerformed(e);
261 outputTextboxMenu.add(item);
263 } catch (Exception e)
265 System.err.println(e.toString());
268 if (!jalview.util.Platform.isAMac())
270 closeMenuItem.setMnemonic('C');
271 outputTextboxMenu.setMnemonic('T');
272 undoMenuItem.setMnemonic('Z');
273 redoMenuItem.setMnemonic('0');
274 copy.setMnemonic('C');
275 cut.setMnemonic('U');
276 pasteMenu.setMnemonic('P');
277 reload.setMnemonic('R');
280 if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
282 java.util.Enumeration userColours = jalview.gui.UserDefinedColours
283 .getUserColourSchemes().keys();
285 while (userColours.hasMoreElements())
287 final JRadioButtonMenuItem radioItem = new JRadioButtonMenuItem(
288 userColours.nextElement().toString());
289 radioItem.setName("USER_DEFINED");
290 radioItem.addMouseListener(new MouseAdapter()
293 public void mousePressed(MouseEvent evt)
295 if (evt.isPopupTrigger()) // Mac
297 offerRemoval(radioItem);
302 public void mouseReleased(MouseEvent evt)
304 if (evt.isPopupTrigger()) // Windows
306 offerRemoval(radioItem);
313 void offerRemoval(final JRadioButtonMenuItem radioItem)
315 radioItem.removeActionListener(radioItem.getActionListeners()[0]);
317 int option = JOptionPane.showInternalConfirmDialog(
318 jalview.gui.Desktop.desktop,
320 .getString("label.remove_from_default_list"),
322 .getString("label.remove_user_defined_colour"),
323 JOptionPane.YES_NO_OPTION);
324 if (option == JOptionPane.YES_OPTION)
326 jalview.gui.UserDefinedColours
327 .removeColourFromDefaults(radioItem.getText());
328 colourMenu.remove(radioItem);
332 radioItem.addActionListener(new ActionListener()
335 public void actionPerformed(ActionEvent evt)
337 userDefinedColour_actionPerformed(evt);
343 radioItem.addActionListener(new ActionListener()
346 public void actionPerformed(ActionEvent evt)
348 userDefinedColour_actionPerformed(evt);
351 colourMenu.insert(radioItem, 15);
352 colours.add(radioItem);
355 colours.add(noColourmenuItem);
356 colours.add(clustalColour);
357 colours.add(zappoColour);
358 colours.add(taylorColour);
359 colours.add(hydrophobicityColour);
360 colours.add(helixColour);
361 colours.add(strandColour);
362 colours.add(turnColour);
363 colours.add(buriedColour);
364 colours.add(userDefinedColour);
365 colours.add(PIDColour);
366 colours.add(BLOSUM62Colour);
367 colours.add(nucleotideColour);
368 colours.add(purinePyrimidineColour);
369 // colours.add(covariationColour);
370 colours.add(tcoffeeColour);
371 colours.add(RNAInteractionColour);
372 setColourSelected(jalview.bin.Cache.getDefault(
373 Preferences.DEFAULT_COLOUR, "None"));
376 public void setColourSelected(String defaultColour)
379 if (defaultColour != null)
381 int index = ColourSchemeProperty
382 .getColourIndexFromName(defaultColour);
386 case ColourSchemeProperty.CLUSTAL:
387 clustalColour.setSelected(true);
391 case ColourSchemeProperty.BLOSUM:
392 BLOSUM62Colour.setSelected(true);
396 case ColourSchemeProperty.PID:
397 PIDColour.setSelected(true);
401 case ColourSchemeProperty.ZAPPO:
402 zappoColour.setSelected(true);
406 case ColourSchemeProperty.TAYLOR:
407 taylorColour.setSelected(true);
410 case ColourSchemeProperty.HYDROPHOBIC:
411 hydrophobicityColour.setSelected(true);
415 case ColourSchemeProperty.HELIX:
416 helixColour.setSelected(true);
420 case ColourSchemeProperty.STRAND:
421 strandColour.setSelected(true);
425 case ColourSchemeProperty.TURN:
426 turnColour.setSelected(true);
430 case ColourSchemeProperty.BURIED:
431 buriedColour.setSelected(true);
435 case ColourSchemeProperty.NUCLEOTIDE:
436 nucleotideColour.setSelected(true);
440 case ColourSchemeProperty.TCOFFEE:
441 tcoffeeColour.setSelected(true);
444 case ColourSchemeProperty.PURINEPYRIMIDINE:
445 purinePyrimidineColour.setSelected(true);
449 case ColourSchemeProperty.RNAINTERACTION:
450 RNAInteractionColour.setSelected(true);
454 * case ColourSchemeProperty.COVARIATION:
455 * covariationColour.setSelected(true);
459 case ColourSchemeProperty.USER_DEFINED:
460 userDefinedColour.setSelected(true);
463 case ColourSchemeProperty.NONE:
465 noColourmenuItem.setSelected(true);
473 private void jbInit() throws Exception
475 JMenuItem saveAs = new JMenuItem(
476 MessageManager.getString("action.save_as"));
477 ActionListener al = new ActionListener()
480 public void actionPerformed(ActionEvent e)
482 saveAs_actionPerformed(e);
485 KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit
486 .getDefaultToolkit().getMenuShortcutKeyMask()
487 | KeyEvent.SHIFT_MASK, false);
488 addMenuActionAndAccelerator(keyStroke, saveAs, al);
490 closeMenuItem.setText(MessageManager.getString("action.close"));
491 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_W, Toolkit
492 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
493 al = new ActionListener()
496 public void actionPerformed(ActionEvent e)
498 closeMenuItem_actionPerformed(false);
501 addMenuActionAndAccelerator(keyStroke, closeMenuItem, al);
503 JMenu editMenu = new JMenu(MessageManager.getString("action.edit"));
504 JMenu viewMenu = new JMenu(MessageManager.getString("action.view"));
505 JMenu annotationsMenu = new JMenu(
506 MessageManager.getString("action.annotations"));
507 JMenu showMenu = new JMenu(MessageManager.getString("action.show"));
508 colourMenu.setText(MessageManager.getString("action.colour"));
509 JMenu calculateMenu = new JMenu(
510 MessageManager.getString("action.calculate"));
511 webService.setText(MessageManager.getString("action.web_service"));
512 JMenuItem selectAllSequenceMenuItem = new JMenuItem(
513 MessageManager.getString("action.select_all"));
514 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit
515 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
516 al = new ActionListener()
519 public void actionPerformed(ActionEvent e)
521 selectAllSequenceMenuItem_actionPerformed(e);
524 addMenuActionAndAccelerator(keyStroke, selectAllSequenceMenuItem, al);
526 JMenuItem deselectAllSequenceMenuItem = new JMenuItem(
527 MessageManager.getString("action.deselect_all"));
528 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
529 al = new ActionListener()
532 public void actionPerformed(ActionEvent e)
534 deselectAllSequenceMenuItem_actionPerformed(e);
537 addMenuActionAndAccelerator(keyStroke, deselectAllSequenceMenuItem, al);
539 JMenuItem invertSequenceMenuItem = new JMenuItem(
540 MessageManager.getString("action.invert_sequence_selection"));
541 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I, Toolkit
542 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
543 al = new ActionListener()
546 public void actionPerformed(ActionEvent e)
548 invertSequenceMenuItem_actionPerformed(e);
551 addMenuActionAndAccelerator(keyStroke, invertSequenceMenuItem, al);
553 JMenuItem grpsFromSelection = new JMenuItem(
554 MessageManager.getString("action.make_groups_selection"));
555 grpsFromSelection.addActionListener(new ActionListener()
558 public void actionPerformed(ActionEvent e)
560 makeGrpsFromSelection_actionPerformed(e);
563 JMenuItem expandAlignment = new JMenuItem(
564 MessageManager.getString("action.view_flanking_regions"));
565 expandAlignment.setToolTipText(MessageManager
566 .getString("label.view_flanking_regions"));
567 expandAlignment.addActionListener(new ActionListener()
570 public void actionPerformed(ActionEvent e)
575 JMenuItem remove2LeftMenuItem = new JMenuItem(
576 MessageManager.getString("action.remove_left"));
577 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_L, Toolkit
578 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
579 al = new ActionListener()
582 public void actionPerformed(ActionEvent e)
584 remove2LeftMenuItem_actionPerformed(e);
587 addMenuActionAndAccelerator(keyStroke, remove2LeftMenuItem, al);
589 JMenuItem remove2RightMenuItem = new JMenuItem(
590 MessageManager.getString("action.remove_right"));
591 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_R, Toolkit
592 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
593 al = new ActionListener()
596 public void actionPerformed(ActionEvent e)
598 remove2RightMenuItem_actionPerformed(e);
601 addMenuActionAndAccelerator(keyStroke, remove2RightMenuItem, al);
603 JMenuItem removeGappedColumnMenuItem = new JMenuItem(
604 MessageManager.getString("action.remove_empty_columns"));
605 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_E, Toolkit
606 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
607 al = new ActionListener()
610 public void actionPerformed(ActionEvent e)
612 removeGappedColumnMenuItem_actionPerformed(e);
615 addMenuActionAndAccelerator(keyStroke, removeGappedColumnMenuItem, al);
617 JMenuItem removeAllGapsMenuItem = new JMenuItem(
618 MessageManager.getString("action.remove_all_gaps"));
619 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_E, Toolkit
620 .getDefaultToolkit().getMenuShortcutKeyMask()
621 | KeyEvent.SHIFT_MASK, false);
622 al = new ActionListener()
625 public void actionPerformed(ActionEvent e)
627 removeAllGapsMenuItem_actionPerformed(e);
630 addMenuActionAndAccelerator(keyStroke, removeAllGapsMenuItem, al);
632 JMenuItem justifyLeftMenuItem = new JMenuItem(
633 MessageManager.getString("action.left_justify_alignment"));
634 justifyLeftMenuItem.addActionListener(new ActionListener()
637 public void actionPerformed(ActionEvent e)
639 justifyLeftMenuItem_actionPerformed(e);
642 JMenuItem justifyRightMenuItem = new JMenuItem(
643 MessageManager.getString("action.right_justify_alignment"));
644 justifyRightMenuItem.addActionListener(new ActionListener()
647 public void actionPerformed(ActionEvent e)
649 justifyRightMenuItem_actionPerformed(e);
652 viewBoxesMenuItem.setText(MessageManager.getString("action.boxes"));
653 viewBoxesMenuItem.setState(true);
654 viewBoxesMenuItem.addActionListener(new ActionListener()
657 public void actionPerformed(ActionEvent e)
659 viewBoxesMenuItem_actionPerformed(e);
662 viewTextMenuItem.setText(MessageManager.getString("action.text"));
663 viewTextMenuItem.setState(true);
664 viewTextMenuItem.addActionListener(new ActionListener()
667 public void actionPerformed(ActionEvent e)
669 viewTextMenuItem_actionPerformed(e);
672 showNonconservedMenuItem.setText(MessageManager
673 .getString("label.show_non_conversed"));
674 showNonconservedMenuItem.setState(false);
675 showNonconservedMenuItem.addActionListener(new ActionListener()
678 public void actionPerformed(ActionEvent e)
680 showUnconservedMenuItem_actionPerformed(e);
683 JMenuItem sortPairwiseMenuItem = new JMenuItem(
684 MessageManager.getString("action.by_pairwise_id"));
685 sortPairwiseMenuItem.addActionListener(new ActionListener()
688 public void actionPerformed(ActionEvent e)
690 sortPairwiseMenuItem_actionPerformed(e);
693 JMenuItem sortIDMenuItem = new JMenuItem(
694 MessageManager.getString("action.by_id"));
695 sortIDMenuItem.addActionListener(new ActionListener()
698 public void actionPerformed(ActionEvent e)
700 sortIDMenuItem_actionPerformed(e);
703 JMenuItem sortLengthMenuItem = new JMenuItem(
704 MessageManager.getString("action.by_length"));
705 sortLengthMenuItem.addActionListener(new ActionListener()
708 public void actionPerformed(ActionEvent e)
710 sortLengthMenuItem_actionPerformed(e);
713 JMenuItem sortGroupMenuItem = new JMenuItem(
714 MessageManager.getString("action.by_group"));
715 sortGroupMenuItem.addActionListener(new ActionListener()
718 public void actionPerformed(ActionEvent e)
720 sortGroupMenuItem_actionPerformed(e);
724 JMenuItem removeRedundancyMenuItem = new JMenuItem(
725 MessageManager.getString("action.remove_redundancy"));
726 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_D, Toolkit
727 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
728 al = new ActionListener()
731 public void actionPerformed(ActionEvent e)
733 removeRedundancyMenuItem_actionPerformed(e);
736 addMenuActionAndAccelerator(keyStroke, removeRedundancyMenuItem, al);
738 JMenuItem pairwiseAlignmentMenuItem = new JMenuItem(
739 MessageManager.getString("action.pairwise_alignment"));
740 pairwiseAlignmentMenuItem.addActionListener(new ActionListener()
743 public void actionPerformed(ActionEvent e)
745 pairwiseAlignmentMenuItem_actionPerformed(e);
748 JMenuItem PCAMenuItem = new JMenuItem(
749 MessageManager.getString("label.principal_component_analysis"));
750 PCAMenuItem.addActionListener(new ActionListener()
753 public void actionPerformed(ActionEvent e)
755 PCAMenuItem_actionPerformed(e);
758 JMenuItem averageDistanceTreeMenuItem = new JMenuItem(
759 MessageManager.getString("label.average_distance_identity"));
760 averageDistanceTreeMenuItem.addActionListener(new ActionListener()
763 public void actionPerformed(ActionEvent e)
765 averageDistanceTreeMenuItem_actionPerformed(e);
768 JMenuItem neighbourTreeMenuItem = new JMenuItem(
769 MessageManager.getString("label.neighbour_joining_identity"));
770 neighbourTreeMenuItem.addActionListener(new ActionListener()
773 public void actionPerformed(ActionEvent e)
775 neighbourTreeMenuItem_actionPerformed(e);
779 this.getContentPane().setLayout(new BorderLayout());
780 alignFrameMenuBar.setFont(new java.awt.Font("Verdana", 0, 11));
781 statusBar.setBackground(Color.white);
782 statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
783 statusBar.setBorder(BorderFactory.createLineBorder(Color.black));
784 statusBar.setText(MessageManager.getString("label.status_bar"));
785 outputTextboxMenu.setText(MessageManager
786 .getString("label.out_to_textbox"));
787 clustalColour.setText(MessageManager.getString("label.clustalx"));
788 clustalColour.addActionListener(new ActionListener()
791 public void actionPerformed(ActionEvent e)
793 clustalColour_actionPerformed(e);
796 zappoColour.setText(MessageManager.getString("label.zappo"));
797 zappoColour.addActionListener(new ActionListener()
800 public void actionPerformed(ActionEvent e)
802 zappoColour_actionPerformed(e);
805 taylorColour.setText(MessageManager.getString("label.taylor"));
806 taylorColour.addActionListener(new ActionListener()
809 public void actionPerformed(ActionEvent e)
811 taylorColour_actionPerformed(e);
814 hydrophobicityColour.setText(MessageManager
815 .getString("label.hydrophobicity"));
816 hydrophobicityColour.addActionListener(new ActionListener()
819 public void actionPerformed(ActionEvent e)
821 hydrophobicityColour_actionPerformed(e);
824 helixColour.setText(MessageManager.getString("label.helix_propensity"));
825 helixColour.addActionListener(new ActionListener()
828 public void actionPerformed(ActionEvent e)
830 helixColour_actionPerformed(e);
833 strandColour.setText(MessageManager
834 .getString("label.strand_propensity"));
835 strandColour.addActionListener(new ActionListener()
838 public void actionPerformed(ActionEvent e)
840 strandColour_actionPerformed(e);
843 turnColour.setText(MessageManager.getString("label.turn_propensity"));
844 turnColour.addActionListener(new ActionListener()
847 public void actionPerformed(ActionEvent e)
849 turnColour_actionPerformed(e);
852 buriedColour.setText(MessageManager.getString("label.buried_index"));
853 buriedColour.addActionListener(new ActionListener()
856 public void actionPerformed(ActionEvent e)
858 buriedColour_actionPerformed(e);
861 userDefinedColour.setText(MessageManager
862 .getString("action.user_defined"));
863 userDefinedColour.addActionListener(new ActionListener()
866 public void actionPerformed(ActionEvent e)
868 userDefinedColour_actionPerformed(e);
872 .setText(MessageManager.getString("label.percentage_identity"));
873 PIDColour.addActionListener(new ActionListener()
876 public void actionPerformed(ActionEvent e)
878 PIDColour_actionPerformed(e);
882 .setText(MessageManager.getString("label.blosum62_score"));
883 BLOSUM62Colour.addActionListener(new ActionListener()
886 public void actionPerformed(ActionEvent e)
888 BLOSUM62Colour_actionPerformed(e);
891 nucleotideColour.setText(MessageManager.getString("label.nucleotide"));
892 nucleotideColour.addActionListener(new ActionListener()
895 public void actionPerformed(ActionEvent e)
897 nucleotideColour_actionPerformed(e);
901 purinePyrimidineColour.setText(MessageManager
902 .getString("label.purine_pyrimidine"));
903 purinePyrimidineColour.addActionListener(new ActionListener()
906 public void actionPerformed(ActionEvent e)
908 purinePyrimidineColour_actionPerformed(e);
912 RNAInteractionColour.setText("RNA Interaction type");
913 RNAInteractionColour.addActionListener(new ActionListener()
916 public void actionPerformed(ActionEvent e)
918 RNAInteractionColour_actionPerformed(e);
922 * covariationColour.setText("Covariation");
923 * covariationColour.addActionListener(new ActionListener() { public void
924 * actionPerformed(ActionEvent e) { covariationColour_actionPerformed(e); }
928 JMenuItem avDistanceTreeBlosumMenuItem = new JMenuItem(
929 MessageManager.getString("label.average_distance_bloslum62"));
930 avDistanceTreeBlosumMenuItem.addActionListener(new ActionListener()
933 public void actionPerformed(ActionEvent e)
935 avTreeBlosumMenuItem_actionPerformed(e);
938 JMenuItem njTreeBlosumMenuItem = new JMenuItem(
939 MessageManager.getString("label.neighbour_blosum62"));
940 njTreeBlosumMenuItem.addActionListener(new ActionListener()
943 public void actionPerformed(ActionEvent e)
945 njTreeBlosumMenuItem_actionPerformed(e);
948 annotationPanelMenuItem.setActionCommand("");
949 annotationPanelMenuItem.setText(MessageManager
950 .getString("label.show_annotations"));
951 annotationPanelMenuItem.setState(Cache.getDefault("SHOW_ANNOTATIONS",
953 annotationPanelMenuItem.addActionListener(new ActionListener()
956 public void actionPerformed(ActionEvent e)
958 annotationPanelMenuItem_actionPerformed(e);
961 showAllAlAnnotations.setText(MessageManager
962 .getString("label.show_all_al_annotations"));
963 final boolean isAnnotationPanelShown = annotationPanelMenuItem
965 showAllAlAnnotations.setEnabled(isAnnotationPanelShown);
966 showAllAlAnnotations.addActionListener(new ActionListener()
969 public void actionPerformed(ActionEvent e)
971 showAllAnnotations_actionPerformed(false, true);
974 hideAllAlAnnotations.setText(MessageManager
975 .getString("label.hide_all_al_annotations"));
976 hideAllAlAnnotations.setEnabled(isAnnotationPanelShown);
977 hideAllAlAnnotations.addActionListener(new ActionListener()
980 public void actionPerformed(ActionEvent e)
982 hideAllAnnotations_actionPerformed(false, true);
985 showAllSeqAnnotations.setText(MessageManager
986 .getString("label.show_all_seq_annotations"));
987 showAllSeqAnnotations.setEnabled(isAnnotationPanelShown);
988 showAllSeqAnnotations.addActionListener(new ActionListener()
991 public void actionPerformed(ActionEvent e)
993 showAllAnnotations_actionPerformed(true, false);
996 hideAllSeqAnnotations.setText(MessageManager
997 .getString("label.hide_all_seq_annotations"));
998 hideAllSeqAnnotations.setEnabled(isAnnotationPanelShown);
999 hideAllSeqAnnotations.addActionListener(new ActionListener()
1002 public void actionPerformed(ActionEvent e)
1004 hideAllAnnotations_actionPerformed(true, false);
1007 SequenceAnnotationOrder sortAnnotationsBy = SequenceAnnotationOrder
1008 .valueOf(Cache.getDefault(Preferences.SORT_ANNOTATIONS,
1009 SequenceAnnotationOrder.NONE.name()));
1010 final JCheckBoxMenuItem sortAnnBySequence = new JCheckBoxMenuItem(
1011 MessageManager.getString("label.sort_annotations_by_sequence"));
1012 final JCheckBoxMenuItem sortAnnByLabel = new JCheckBoxMenuItem(
1013 MessageManager.getString("label.sort_annotations_by_label"));
1016 .setSelected(sortAnnotationsBy == SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
1017 sortAnnBySequence.addActionListener(new ActionListener()
1020 public void actionPerformed(ActionEvent e)
1022 boolean newState = sortAnnBySequence.getState();
1023 sortAnnByLabel.setSelected(false);
1024 setAnnotationSortOrder(newState ? SequenceAnnotationOrder.SEQUENCE_AND_LABEL
1025 : SequenceAnnotationOrder.NONE);
1026 sortAnnotations_actionPerformed();
1030 .setSelected(sortAnnotationsBy == SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
1031 sortAnnByLabel.addActionListener(new ActionListener()
1034 public void actionPerformed(ActionEvent e)
1036 boolean newState = sortAnnByLabel.getState();
1037 sortAnnBySequence.setSelected(false);
1038 setAnnotationSortOrder(newState ? SequenceAnnotationOrder.LABEL_AND_SEQUENCE
1039 : SequenceAnnotationOrder.NONE);
1040 sortAnnotations_actionPerformed();
1043 colourTextMenuItem.setText(MessageManager
1044 .getString("label.colour_text"));
1045 colourTextMenuItem.addActionListener(new ActionListener()
1048 public void actionPerformed(ActionEvent e)
1050 colourTextMenuItem_actionPerformed(e);
1054 JMenuItem htmlMenuItem = new JMenuItem(
1055 MessageManager.getString("label.html"));
1056 htmlMenuItem.addActionListener(new ActionListener()
1059 public void actionPerformed(ActionEvent e)
1061 htmlMenuItem_actionPerformed(e);
1065 JMenuItem createBioJS = new JMenuItem(
1066 MessageManager.getString("label.biojs_html_export"));
1067 createBioJS.addActionListener(new java.awt.event.ActionListener()
1070 public void actionPerformed(ActionEvent e)
1072 bioJSMenuItem_actionPerformed(e);
1076 JMenuItem overviewMenuItem = new JMenuItem(
1077 MessageManager.getString("label.overview_window"));
1078 overviewMenuItem.addActionListener(new ActionListener()
1081 public void actionPerformed(ActionEvent e)
1083 overviewMenuItem_actionPerformed(e);
1087 undoMenuItem.setEnabled(false);
1088 undoMenuItem.setText(MessageManager.getString("action.undo"));
1089 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit
1090 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1091 al = new ActionListener()
1094 public void actionPerformed(ActionEvent e)
1096 undoMenuItem_actionPerformed(e);
1099 addMenuActionAndAccelerator(keyStroke, undoMenuItem, al);
1101 redoMenuItem.setEnabled(false);
1102 redoMenuItem.setText(MessageManager.getString("action.redo"));
1103 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit
1104 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1105 al = new ActionListener()
1108 public void actionPerformed(ActionEvent e)
1110 redoMenuItem_actionPerformed(e);
1113 addMenuActionAndAccelerator(keyStroke, redoMenuItem, al);
1115 conservationMenuItem.setText(MessageManager
1116 .getString("action.by_conservation"));
1117 conservationMenuItem.addActionListener(new ActionListener()
1120 public void actionPerformed(ActionEvent e)
1122 conservationMenuItem_actionPerformed(e);
1125 noColourmenuItem.setText(MessageManager.getString("label.none"));
1126 noColourmenuItem.addActionListener(new ActionListener()
1129 public void actionPerformed(ActionEvent e)
1131 noColourmenuItem_actionPerformed(e);
1134 wrapMenuItem.setText(MessageManager.getString("label.wrap"));
1135 wrapMenuItem.addActionListener(new ActionListener()
1138 public void actionPerformed(ActionEvent e)
1140 wrapMenuItem_actionPerformed(e);
1144 JMenuItem printMenuItem = new JMenuItem(
1145 MessageManager.getString("action.print"));
1146 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_P, Toolkit
1147 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1148 al = new ActionListener()
1151 public void actionPerformed(ActionEvent e)
1153 printMenuItem_actionPerformed(e);
1156 addMenuActionAndAccelerator(keyStroke, printMenuItem, al);
1159 .setText(MessageManager.getString("action.show_gaps"));
1160 renderGapsMenuItem.setState(true);
1161 renderGapsMenuItem.addActionListener(new ActionListener()
1164 public void actionPerformed(ActionEvent e)
1166 renderGapsMenuItem_actionPerformed(e);
1170 JMenuItem findMenuItem = new JMenuItem(
1171 MessageManager.getString("action.find"));
1172 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_F, Toolkit
1173 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1174 findMenuItem.setToolTipText(JvSwingUtils.wrapTooltip(true,
1175 MessageManager.getString("label.find_tip")));
1176 al = new ActionListener()
1179 public void actionPerformed(ActionEvent e)
1181 findMenuItem_actionPerformed(e);
1184 addMenuActionAndAccelerator(keyStroke, findMenuItem, al);
1186 abovePIDThreshold.setText(MessageManager
1187 .getString("label.above_identity_threshold"));
1188 abovePIDThreshold.addActionListener(new ActionListener()
1191 public void actionPerformed(ActionEvent e)
1193 abovePIDThreshold_actionPerformed(e);
1196 showSeqFeatures.setText(MessageManager
1197 .getString("label.show_sequence_features"));
1198 showSeqFeatures.addActionListener(new ActionListener()
1201 public void actionPerformed(ActionEvent actionEvent)
1203 showSeqFeatures_actionPerformed(actionEvent);
1207 * showSeqFeaturesHeight.setText("Vary Sequence Feature Height");
1208 * showSeqFeaturesHeight.addActionListener(new ActionListener() { public
1209 * void actionPerformed(ActionEvent actionEvent) {
1210 * showSeqFeaturesHeight_actionPerformed(actionEvent); } });
1212 showDbRefsMenuitem.setText(MessageManager
1213 .getString("label.show_database_refs"));
1214 showDbRefsMenuitem.addActionListener(new ActionListener()
1218 public void actionPerformed(ActionEvent e)
1220 showDbRefs_actionPerformed(e);
1224 showNpFeatsMenuitem.setText(MessageManager
1225 .getString("label.show_non_positional_features"));
1226 showNpFeatsMenuitem.addActionListener(new ActionListener()
1230 public void actionPerformed(ActionEvent e)
1232 showNpFeats_actionPerformed(e);
1236 showGroupConservation.setText(MessageManager
1237 .getString("label.group_conservation"));
1238 showGroupConservation.addActionListener(new ActionListener()
1242 public void actionPerformed(ActionEvent e)
1244 showGroupConservation_actionPerformed(e);
1249 showGroupConsensus.setText(MessageManager
1250 .getString("label.group_consensus"));
1251 showGroupConsensus.addActionListener(new ActionListener()
1255 public void actionPerformed(ActionEvent e)
1257 showGroupConsensus_actionPerformed(e);
1261 showConsensusHistogram.setText(MessageManager
1262 .getString("label.show_consensus_histogram"));
1263 showConsensusHistogram.addActionListener(new ActionListener()
1267 public void actionPerformed(ActionEvent e)
1269 showConsensusHistogram_actionPerformed(e);
1273 showSequenceLogo.setText(MessageManager
1274 .getString("label.show_consensus_logo"));
1275 showSequenceLogo.addActionListener(new ActionListener()
1279 public void actionPerformed(ActionEvent e)
1281 showSequenceLogo_actionPerformed(e);
1285 normaliseSequenceLogo.setText(MessageManager
1286 .getString("label.norm_consensus_logo"));
1287 normaliseSequenceLogo.addActionListener(new ActionListener()
1291 public void actionPerformed(ActionEvent e)
1293 normaliseSequenceLogo_actionPerformed(e);
1297 applyAutoAnnotationSettings.setText(MessageManager
1298 .getString("label.apply_all_groups"));
1299 applyAutoAnnotationSettings.setState(false);
1300 applyAutoAnnotationSettings.setVisible(true);
1301 applyAutoAnnotationSettings.addActionListener(new ActionListener()
1304 public void actionPerformed(ActionEvent e)
1306 applyAutoAnnotationSettings_actionPerformed(e);
1310 ButtonGroup buttonGroup = new ButtonGroup();
1311 final JRadioButtonMenuItem showAutoFirst = new JRadioButtonMenuItem(
1312 MessageManager.getString("label.show_first"));
1313 final JRadioButtonMenuItem showAutoLast = new JRadioButtonMenuItem(
1314 MessageManager.getString("label.show_last"));
1315 buttonGroup.add(showAutoFirst);
1316 buttonGroup.add(showAutoLast);
1317 final boolean autoFirst = Cache.getDefault(
1318 Preferences.SHOW_AUTOCALC_ABOVE, false);
1319 showAutoFirst.setSelected(autoFirst);
1320 setShowAutoCalculatedAbove(autoFirst);
1321 showAutoFirst.addActionListener(new ActionListener()
1324 public void actionPerformed(ActionEvent e)
1326 setShowAutoCalculatedAbove(showAutoFirst.isSelected());
1327 sortAnnotations_actionPerformed();
1330 showAutoLast.setSelected(!showAutoFirst.isSelected());
1331 showAutoLast.addActionListener(new ActionListener()
1334 public void actionPerformed(ActionEvent e)
1336 setShowAutoCalculatedAbove(!showAutoLast.isSelected());
1337 sortAnnotations_actionPerformed();
1341 nucleotideColour.setText(MessageManager.getString("label.nucleotide"));
1342 nucleotideColour.addActionListener(new ActionListener()
1345 public void actionPerformed(ActionEvent e)
1347 nucleotideColour_actionPerformed(e);
1351 tcoffeeColour.setText(MessageManager.getString("label.tcoffee_scores"));
1352 tcoffeeColour.setEnabled(false);
1353 tcoffeeColour.addActionListener(new ActionListener()
1357 public void actionPerformed(ActionEvent e)
1359 tcoffeeColorScheme_actionPerformed(e);
1363 JMenuItem deleteGroups = new JMenuItem(
1364 MessageManager.getString("action.undefine_groups"));
1365 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_U, Toolkit
1366 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1367 al = new ActionListener()
1370 public void actionPerformed(ActionEvent e)
1372 deleteGroups_actionPerformed(e);
1375 addMenuActionAndAccelerator(keyStroke, deleteGroups, al);
1377 JMenuItem createGroup = new JMenuItem(
1378 MessageManager.getString("action.create_groups"));
1379 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, Toolkit
1380 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1381 al = new ActionListener()
1384 public void actionPerformed(ActionEvent e)
1386 createGroup_actionPerformed(e);
1389 addMenuActionAndAccelerator(keyStroke, createGroup, al);
1391 JMenuItem unGroup = new JMenuItem(
1392 MessageManager.getString("action.remove_group"));
1393 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, Toolkit
1394 .getDefaultToolkit().getMenuShortcutKeyMask()
1395 | KeyEvent.SHIFT_MASK, false);
1396 al = new ActionListener()
1399 public void actionPerformed(ActionEvent e)
1401 unGroup_actionPerformed(e);
1404 addMenuActionAndAccelerator(keyStroke, unGroup, al);
1406 copy.setText(MessageManager.getString("action.copy"));
1407 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit
1408 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1410 al = new ActionListener()
1413 public void actionPerformed(ActionEvent e)
1415 copy_actionPerformed(e);
1418 addMenuActionAndAccelerator(keyStroke, copy, al);
1420 cut.setText(MessageManager.getString("action.cut"));
1421 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit
1422 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1423 al = new ActionListener()
1426 public void actionPerformed(ActionEvent e)
1428 cut_actionPerformed(e);
1431 addMenuActionAndAccelerator(keyStroke, cut, al);
1433 JMenuItem delete = new JMenuItem(
1434 MessageManager.getString("action.delete"));
1435 delete.addActionListener(new ActionListener()
1438 public void actionPerformed(ActionEvent e)
1440 delete_actionPerformed(e);
1444 pasteMenu.setText(MessageManager.getString("action.paste"));
1445 JMenuItem pasteNew = new JMenuItem(
1446 MessageManager.getString("label.to_new_alignment"));
1447 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit
1448 .getDefaultToolkit().getMenuShortcutKeyMask()
1449 | KeyEvent.SHIFT_MASK, false);
1450 al = new ActionListener()
1453 public void actionPerformed(ActionEvent e)
1455 pasteNew_actionPerformed(e);
1458 addMenuActionAndAccelerator(keyStroke, pasteNew, al);
1460 JMenuItem pasteThis = new JMenuItem(
1461 MessageManager.getString("label.to_this_alignment"));
1462 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit
1463 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
1464 al = new ActionListener()
1467 public void actionPerformed(ActionEvent e)
1469 pasteThis_actionPerformed(e);
1472 addMenuActionAndAccelerator(keyStroke, pasteThis, al);
1474 applyToAllGroups.setText(MessageManager
1475 .getString("label.apply_colour_to_all_groups"));
1476 applyToAllGroups.addActionListener(new ActionListener()
1479 public void actionPerformed(ActionEvent e)
1481 applyToAllGroups_actionPerformed(e);
1484 JMenuItem createPNG = new JMenuItem("PNG");
1485 createPNG.addActionListener(new ActionListener()
1488 public void actionPerformed(ActionEvent e)
1493 createPNG.setActionCommand(MessageManager
1494 .getString("label.save_png_image"));
1496 JMenuItem font = new JMenuItem(MessageManager.getString("action.font"));
1497 font.addActionListener(new ActionListener()
1500 public void actionPerformed(ActionEvent e)
1502 font_actionPerformed(e);
1505 seqLimits.setText(MessageManager
1506 .getString("label.show_sequence_limits"));
1507 seqLimits.setState(jalview.bin.Cache.getDefault("SHOW_JVSUFFIX", true));
1508 seqLimits.addActionListener(new ActionListener()
1511 public void actionPerformed(ActionEvent e)
1513 seqLimit_actionPerformed(e);
1516 JMenuItem epsFile = new JMenuItem("EPS");
1517 epsFile.addActionListener(new ActionListener()
1520 public void actionPerformed(ActionEvent e)
1526 JMenuItem createSVG = new JMenuItem("SVG");
1527 createSVG.addActionListener(new ActionListener()
1530 public void actionPerformed(ActionEvent e)
1536 JMenuItem loadTreeMenuItem = new JMenuItem(
1537 MessageManager.getString("label.load_associated_tree"));
1538 loadTreeMenuItem.setActionCommand(MessageManager
1539 .getString("label.load_tree_for_sequence_set"));
1540 loadTreeMenuItem.addActionListener(new ActionListener()
1543 public void actionPerformed(ActionEvent e)
1545 loadTreeMenuItem_actionPerformed(e);
1549 scaleAbove.setVisible(false);
1550 scaleAbove.setText(MessageManager.getString("action.scale_above"));
1551 scaleAbove.addActionListener(new ActionListener()
1554 public void actionPerformed(ActionEvent e)
1556 scaleAbove_actionPerformed(e);
1559 scaleLeft.setVisible(false);
1560 scaleLeft.setSelected(true);
1561 scaleLeft.setText(MessageManager.getString("action.scale_left"));
1562 scaleLeft.addActionListener(new ActionListener()
1565 public void actionPerformed(ActionEvent e)
1567 scaleLeft_actionPerformed(e);
1570 scaleRight.setVisible(false);
1571 scaleRight.setSelected(true);
1572 scaleRight.setText(MessageManager.getString("action.scale_right"));
1573 scaleRight.addActionListener(new ActionListener()
1576 public void actionPerformed(ActionEvent e)
1578 scaleRight_actionPerformed(e);
1581 centreColumnLabelsMenuItem.setVisible(true);
1582 centreColumnLabelsMenuItem.setState(false);
1583 centreColumnLabelsMenuItem.setText(MessageManager
1584 .getString("label.centre_column_labels"));
1585 centreColumnLabelsMenuItem.addActionListener(new ActionListener()
1588 public void actionPerformed(ActionEvent e)
1590 centreColumnLabels_actionPerformed(e);
1593 followHighlightMenuItem.setVisible(true);
1594 followHighlightMenuItem.setState(true);
1595 followHighlightMenuItem.setText(MessageManager
1596 .getString("label.automatic_scrolling"));
1597 followHighlightMenuItem.addActionListener(new ActionListener()
1601 public void actionPerformed(ActionEvent e)
1603 followHighlight_actionPerformed();
1608 JMenuItem modifyPID = new JMenuItem(
1609 MessageManager.getString("label.modify_identity_threshold"));
1610 modifyPID.addActionListener(new ActionListener()
1613 public void actionPerformed(ActionEvent e)
1615 modifyPID_actionPerformed(e);
1618 modifyConservation.setText(MessageManager
1619 .getString("label.modify_conservation_threshold"));
1620 modifyConservation.addActionListener(new ActionListener()
1623 public void actionPerformed(ActionEvent e)
1625 modifyConservation_actionPerformed(e);
1629 .setText(MessageManager.getString("action.by_tree_order"));
1630 sort.setText(MessageManager.getString("action.sort"));
1631 sort.addMenuListener(new MenuListener()
1634 public void menuSelected(MenuEvent e)
1640 public void menuDeselected(MenuEvent e)
1645 public void menuCanceled(MenuEvent e)
1649 sortByAnnotScore.setText(MessageManager
1650 .getString("label.sort_by_score"));
1651 sort.add(sortByAnnotScore);
1652 sort.addMenuListener(new javax.swing.event.MenuListener()
1656 public void menuCanceled(MenuEvent e)
1661 public void menuDeselected(MenuEvent e)
1666 public void menuSelected(MenuEvent e)
1668 buildSortByAnnotationScoresMenu();
1671 sortByAnnotScore.setVisible(false);
1674 .setText(MessageManager.getString("action.calculate_tree"));
1676 padGapsMenuitem.setText(MessageManager.getString("label.pad_gaps"));
1677 padGapsMenuitem.setState(jalview.bin.Cache
1678 .getDefault("PAD_GAPS", false));
1679 padGapsMenuitem.addActionListener(new ActionListener()
1682 public void actionPerformed(ActionEvent e)
1684 padGapsMenuitem_actionPerformed(e);
1687 JMenuItem vamsasStore = new JMenuItem(
1688 MessageManager.getString("label.vamsas_store"));
1689 vamsasStore.setVisible(false);
1690 vamsasStore.addActionListener(new ActionListener()
1693 public void actionPerformed(ActionEvent e)
1695 vamsasStore_actionPerformed(e);
1698 showTranslation.setText(MessageManager
1699 .getString("label.translate_cDNA"));
1700 showTranslation.addActionListener(new ActionListener()
1703 public void actionPerformed(ActionEvent e)
1705 showTranslation_actionPerformed(e);
1708 showReverse.setText(MessageManager.getString("label.reverse"));
1709 showReverse.addActionListener(new ActionListener()
1712 public void actionPerformed(ActionEvent e)
1714 showReverse_actionPerformed(false);
1717 showReverseComplement.setText(MessageManager
1718 .getString("label.reverse_complement"));
1719 showReverseComplement.addActionListener(new ActionListener()
1722 public void actionPerformed(ActionEvent e)
1724 showReverse_actionPerformed(true);
1728 JMenuItem extractScores = new JMenuItem(
1729 MessageManager.getString("label.extract_scores"));
1730 extractScores.addActionListener(new ActionListener()
1733 public void actionPerformed(ActionEvent e)
1735 extractScores_actionPerformed(e);
1738 extractScores.setVisible(true);
1739 // JBPNote: TODO: make gui for regex based score extraction
1741 // for show products actions see AlignFrame.canShowProducts
1742 showProducts.setText(MessageManager.getString("label.get_cross_refs"));
1744 runGroovy.setText(MessageManager.getString("label.run_groovy"));
1745 runGroovy.setToolTipText(MessageManager.getString("label.run_groovy_tip"));
1746 runGroovy.addActionListener(new ActionListener()
1749 public void actionPerformed(ActionEvent e)
1751 runGroovy_actionPerformed();
1755 JMenuItem openFeatureSettings = new JMenuItem(
1756 MessageManager.getString("action.feature_settings"));
1757 openFeatureSettings.addActionListener(new ActionListener()
1760 public void actionPerformed(ActionEvent e)
1762 featureSettings_actionPerformed(e);
1765 JMenuItem fetchSequence = new JMenuItem(
1766 MessageManager.getString("label.fetch_sequences"));
1767 fetchSequence.addActionListener(new ActionListener()
1770 public void actionPerformed(ActionEvent e)
1772 fetchSequence_actionPerformed(e);
1776 JMenuItem annotationColour = new JMenuItem(
1777 MessageManager.getString("action.by_annotation"));
1778 annotationColour.addActionListener(new ActionListener()
1781 public void actionPerformed(ActionEvent e)
1783 annotationColour_actionPerformed(e);
1787 JMenuItem annotationColumn = new JMenuItem(
1788 MessageManager.getString("action.select_by_annotation"));
1789 annotationColumn.addActionListener(new ActionListener()
1792 public void actionPerformed(ActionEvent e)
1794 annotationColumn_actionPerformed(e);
1798 rnahelicesColour.setText(MessageManager
1799 .getString("action.by_rna_helixes"));
1800 rnahelicesColour.addActionListener(new ActionListener()
1803 public void actionPerformed(ActionEvent e)
1805 rnahelicesColour_actionPerformed(e);
1809 JMenuItem associatedData = new JMenuItem(
1810 MessageManager.getString("label.load_features_annotations"));
1811 associatedData.addActionListener(new ActionListener()
1814 public void actionPerformed(ActionEvent e)
1816 associatedData_actionPerformed(e);
1819 autoCalculate.setText(MessageManager
1820 .getString("label.autocalculate_consensus"));
1821 autoCalculate.setState(jalview.bin.Cache.getDefault(
1822 "AUTO_CALC_CONSENSUS", true));
1823 autoCalculate.addActionListener(new ActionListener()
1826 public void actionPerformed(ActionEvent e)
1828 autoCalculate_actionPerformed(e);
1831 sortByTree.setText(MessageManager
1832 .getString("label.sort_alignment_new_tree"));
1834 .setToolTipText("<html>"
1836 .getString("label.enable_automatically_sort_alignment_when_open_new_tree"));
1838 .setState(jalview.bin.Cache.getDefault("SORT_BY_TREE", false));
1839 sortByTree.addActionListener(new ActionListener()
1842 public void actionPerformed(ActionEvent e)
1844 sortByTreeOption_actionPerformed(e);
1848 listenToViewSelections.setText(MessageManager
1849 .getString("label.listen_for_selections"));
1850 listenToViewSelections
1851 .setToolTipText("<html>"
1853 .getString("label.selections_mirror_selections_made_same_sequences_other_views"));
1854 listenToViewSelections.setState(false);
1855 listenToViewSelections.addActionListener(new ActionListener()
1858 public void actionPerformed(ActionEvent e)
1860 listenToViewSelections_actionPerformed(e);
1864 JMenu addSequenceMenu = new JMenu(
1865 MessageManager.getString("label.add_sequences"));
1866 JMenuItem addFromFile = new JMenuItem(
1867 MessageManager.getString("label.from_file"));
1868 addFromFile.addActionListener(new ActionListener()
1871 public void actionPerformed(ActionEvent e)
1873 addFromFile_actionPerformed(e);
1876 JMenuItem addFromText = new JMenuItem(
1877 MessageManager.getString("label.from_textbox"));
1878 addFromText.addActionListener(new ActionListener()
1881 public void actionPerformed(ActionEvent e)
1883 addFromText_actionPerformed(e);
1886 JMenuItem addFromURL = new JMenuItem(
1887 MessageManager.getString("label.from_url"));
1888 addFromURL.addActionListener(new ActionListener()
1891 public void actionPerformed(ActionEvent e)
1893 addFromURL_actionPerformed(e);
1896 JMenuItem exportFeatures = new JMenuItem(
1897 MessageManager.getString("label.export_features"));
1898 exportFeatures.addActionListener(new ActionListener()
1901 public void actionPerformed(ActionEvent e)
1903 exportFeatures_actionPerformed(e);
1906 JMenuItem exportAnnotations = new JMenuItem(
1907 MessageManager.getString("label.export_annotations"));
1908 exportAnnotations.addActionListener(new ActionListener()
1911 public void actionPerformed(ActionEvent e)
1913 exportAnnotations_actionPerformed(e);
1916 statusPanel.setLayout(new GridLayout());
1917 JMenuItem showAllSeqs = new JMenuItem(
1918 MessageManager.getString("label.all_sequences"));
1919 showAllSeqs.setToolTipText(MessageManager
1920 .getString("label.toggle_sequence_visibility"));
1921 showAllSeqs.addActionListener(new ActionListener()
1924 public void actionPerformed(ActionEvent e)
1926 showAllSeqs_actionPerformed(e);
1929 JMenuItem showAllColumns = new JMenuItem(
1930 MessageManager.getString("label.all_columns"));
1931 showAllColumns.setToolTipText(MessageManager
1932 .getString("label.toggle_columns_visibility"));
1933 showAllColumns.addActionListener(new ActionListener()
1936 public void actionPerformed(ActionEvent e)
1938 showAllColumns_actionPerformed(e);
1941 JMenu hideMenu = new JMenu(MessageManager.getString("action.hide"));
1942 JMenuItem hideSelSequences = new JMenuItem(
1943 MessageManager.getString("label.selected_sequences"));
1944 hideSelSequences.setToolTipText(MessageManager
1945 .getString("label.toggle_sequence_visibility"));
1946 hideSelSequences.addActionListener(new ActionListener()
1949 public void actionPerformed(ActionEvent e)
1951 hideSelSequences_actionPerformed(e);
1954 JMenuItem hideSelColumns = new JMenuItem(
1955 MessageManager.getString("label.selected_columns"));
1956 hideSelColumns.setToolTipText(MessageManager
1957 .getString("label.toggle_columns_visibility"));
1958 hideSelColumns.addActionListener(new ActionListener()
1961 public void actionPerformed(ActionEvent e)
1963 hideSelColumns_actionPerformed(e);
1966 JMenuItem hideAllSelection = new JMenuItem(
1967 MessageManager.getString("label.selected_region"));
1968 hideAllSelection.addActionListener(new ActionListener()
1971 public void actionPerformed(ActionEvent e)
1973 hideAllSelection_actionPerformed(e);
1976 // TODO: should be hidden if no selection exists.
1977 JMenuItem hideAllButSelection = new JMenuItem(
1978 MessageManager.getString("label.all_but_selected_region"));
1979 hideAllButSelection.addActionListener(new ActionListener()
1982 public void actionPerformed(ActionEvent e)
1984 hideAllButSelection_actionPerformed(e);
1987 JMenuItem showAllhidden = new JMenuItem(
1988 MessageManager.getString("label.all_sequences_columns"));
1989 showAllhidden.setToolTipText(MessageManager
1990 .getString("label.toggles_visibility_hidden_selected_regions"));
1991 showAllhidden.addActionListener(new ActionListener()
1994 public void actionPerformed(ActionEvent e)
1996 showAllhidden_actionPerformed(e);
1999 hiddenMarkers.setText(MessageManager
2000 .getString("action.show_hidden_markers"));
2001 hiddenMarkers.addActionListener(new ActionListener()
2004 public void actionPerformed(ActionEvent e)
2006 hiddenMarkers_actionPerformed(e);
2010 JMenuItem invertColSel = new JMenuItem(
2011 MessageManager.getString("action.invert_column_selection"));
2012 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I, Toolkit
2013 .getDefaultToolkit().getMenuShortcutKeyMask()
2014 | KeyEvent.ALT_MASK, false);
2015 al = new ActionListener()
2018 public void actionPerformed(ActionEvent e)
2020 invertColSel_actionPerformed(e);
2023 addMenuActionAndAccelerator(keyStroke, invertColSel, al);
2025 showComplementMenuItem.setVisible(false);
2026 showComplementMenuItem.addActionListener(new ActionListener()
2029 public void actionPerformed(ActionEvent e)
2031 showComplement_actionPerformed(showComplementMenuItem.getState());
2035 tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()
2038 public void stateChanged(ChangeEvent evt)
2040 JTabbedPane pane = (JTabbedPane) evt.getSource();
2041 int sel = pane.getSelectedIndex();
2042 tabSelectionChanged(sel);
2045 tabbedPane.addMouseListener(new MouseAdapter()
2048 public void mousePressed(MouseEvent e)
2050 if (e.isPopupTrigger()) // Mac
2052 tabbedPane_mousePressed(e);
2057 public void mouseReleased(MouseEvent e)
2059 if (e.isPopupTrigger()) // Windows
2061 tabbedPane_mousePressed(e);
2065 tabbedPane.addFocusListener(new FocusAdapter()
2068 public void focusGained(FocusEvent e)
2070 tabbedPane_focusGained(e);
2074 JMenuItem save = new JMenuItem(MessageManager.getString("action.save"));
2075 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit
2076 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
2077 al = new ActionListener()
2080 public void actionPerformed(ActionEvent e)
2082 save_actionPerformed(e);
2085 addMenuActionAndAccelerator(keyStroke, save, al);
2087 reload.setEnabled(false);
2088 reload.setText(MessageManager.getString("action.reload"));
2089 reload.addActionListener(new ActionListener()
2092 public void actionPerformed(ActionEvent e)
2094 reload_actionPerformed(e);
2098 JMenuItem newView = new JMenuItem(
2099 MessageManager.getString("action.new_view"));
2100 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_T, Toolkit
2101 .getDefaultToolkit().getMenuShortcutKeyMask(), false);
2102 al = new ActionListener()
2105 public void actionPerformed(ActionEvent e)
2107 newView_actionPerformed(e);
2110 addMenuActionAndAccelerator(keyStroke, newView, al);
2112 tabbedPane.setToolTipText("<html><i>"
2113 + MessageManager.getString("label.rename_tab_eXpand_reGroup")
2115 JMenuItem textColour = new JMenuItem(
2116 MessageManager.getString("action.set_text_colour"));
2117 textColour.addActionListener(new ActionListener()
2120 public void actionPerformed(ActionEvent e)
2122 textColour_actionPerformed(e);
2125 formatMenu.setText(MessageManager.getString("action.format"));
2126 JMenu selectMenu = new JMenu(MessageManager.getString("action.select"));
2127 idRightAlign.setText(MessageManager
2128 .getString("label.right_align_sequence_id"));
2129 idRightAlign.addActionListener(new ActionListener()
2132 public void actionPerformed(ActionEvent e)
2134 idRightAlign_actionPerformed(e);
2138 gatherViews.setEnabled(false);
2139 gatherViews.setText(MessageManager.getString("action.gather_views"));
2140 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, 0, false);
2141 al = new ActionListener()
2144 public void actionPerformed(ActionEvent e)
2146 gatherViews_actionPerformed(e);
2149 addMenuActionAndAccelerator(keyStroke, gatherViews, al);
2151 expandViews.setEnabled(false);
2152 expandViews.setText(MessageManager.getString("action.expand_views"));
2153 keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_X, 0, false);
2154 al = new ActionListener()
2157 public void actionPerformed(ActionEvent e)
2159 expandViews_actionPerformed(e);
2162 addMenuActionAndAccelerator(keyStroke, expandViews, al);
2164 JMenuItem pageSetup = new JMenuItem(
2165 MessageManager.getString("action.page_setup"));
2166 pageSetup.addActionListener(new ActionListener()
2169 public void actionPerformed(ActionEvent e)
2171 pageSetup_actionPerformed(e);
2174 JMenuItem alignmentProperties = new JMenuItem(
2175 MessageManager.getString("label.alignment_props"));
2176 alignmentProperties.addActionListener(new ActionListener()
2179 public void actionPerformed(ActionEvent actionEvent)
2181 alignmentProperties();
2184 JMenu tooltipSettingsMenu = new JMenu(
2185 MessageManager.getString("label.sequence_id_tooltip"));
2186 JMenu autoAnnMenu = new JMenu(
2187 MessageManager.getString("label.autocalculated_annotation"));
2189 JMenu exportImageMenu = new JMenu(
2190 MessageManager.getString("label.export_image"));
2191 JMenu fileMenu = new JMenu(MessageManager.getString("action.file"));
2192 alignFrameMenuBar.add(fileMenu);
2193 alignFrameMenuBar.add(editMenu);
2194 alignFrameMenuBar.add(selectMenu);
2195 alignFrameMenuBar.add(viewMenu);
2196 alignFrameMenuBar.add(annotationsMenu);
2197 alignFrameMenuBar.add(formatMenu);
2198 alignFrameMenuBar.add(colourMenu);
2199 alignFrameMenuBar.add(calculateMenu);
2200 alignFrameMenuBar.add(webService);
2202 fileMenu.add(fetchSequence);
2203 fileMenu.add(addSequenceMenu);
2204 fileMenu.add(reload);
2205 fileMenu.addSeparator();
2206 fileMenu.add(vamsasStore);
2208 fileMenu.add(saveAs);
2209 fileMenu.add(outputTextboxMenu);
2210 fileMenu.add(pageSetup);
2211 fileMenu.add(printMenuItem);
2212 fileMenu.addSeparator();
2213 fileMenu.add(exportImageMenu);
2214 fileMenu.add(exportFeatures);
2215 fileMenu.add(exportAnnotations);
2216 fileMenu.add(loadTreeMenuItem);
2217 fileMenu.add(associatedData);
2218 fileMenu.addSeparator();
2219 fileMenu.add(closeMenuItem);
2221 pasteMenu.add(pasteNew);
2222 pasteMenu.add(pasteThis);
2223 editMenu.add(undoMenuItem);
2224 editMenu.add(redoMenuItem);
2227 editMenu.add(pasteMenu);
2228 editMenu.add(delete);
2229 editMenu.addSeparator();
2230 editMenu.add(remove2LeftMenuItem);
2231 editMenu.add(remove2RightMenuItem);
2232 editMenu.add(removeGappedColumnMenuItem);
2233 editMenu.add(removeAllGapsMenuItem);
2234 editMenu.add(removeRedundancyMenuItem);
2235 editMenu.addSeparator();
2236 // dont add these yet in the CVS build - they cannot be undone!
2237 // Excluded from Jalview 2.5 release - undo needs to be implemented.
2238 // editMenu.add(justifyLeftMenuItem);
2239 // editMenu.add(justifyRightMenuItem);
2240 // editMenu.addSeparator();
2241 editMenu.add(padGapsMenuitem);
2243 showMenu.add(showAllColumns);
2244 showMenu.add(showAllSeqs);
2245 showMenu.add(showAllhidden);
2246 hideMenu.add(hideSelColumns);
2247 hideMenu.add(hideSelSequences);
2248 hideMenu.add(hideAllSelection);
2249 hideMenu.add(hideAllButSelection);
2250 viewMenu.add(newView);
2251 viewMenu.add(expandViews);
2252 viewMenu.add(gatherViews);
2253 viewMenu.addSeparator();
2254 viewMenu.add(showMenu);
2255 viewMenu.add(hideMenu);
2256 viewMenu.add(showComplementMenuItem);
2257 viewMenu.addSeparator();
2258 viewMenu.add(followHighlightMenuItem);
2259 viewMenu.addSeparator();
2260 viewMenu.add(showSeqFeatures);
2261 // viewMenu.add(showSeqFeaturesHeight);
2262 viewMenu.add(openFeatureSettings);
2263 tooltipSettingsMenu.add(showDbRefsMenuitem);
2264 tooltipSettingsMenu.add(showNpFeatsMenuitem);
2265 viewMenu.add(tooltipSettingsMenu);
2266 viewMenu.addSeparator();
2267 viewMenu.add(alignmentProperties);
2268 viewMenu.addSeparator();
2269 viewMenu.add(overviewMenuItem);
2271 annotationsMenu.add(annotationPanelMenuItem);
2272 annotationsMenu.addSeparator();
2273 annotationsMenu.add(showAllAlAnnotations);
2274 annotationsMenu.add(hideAllAlAnnotations);
2275 annotationsMenu.addSeparator();
2276 annotationsMenu.add(showAllSeqAnnotations);
2277 annotationsMenu.add(hideAllSeqAnnotations);
2278 annotationsMenu.add(sortAnnBySequence);
2279 annotationsMenu.add(sortAnnByLabel);
2280 annotationsMenu.addSeparator();
2281 autoAnnMenu.add(showAutoFirst);
2282 autoAnnMenu.add(showAutoLast);
2283 autoAnnMenu.addSeparator();
2284 autoAnnMenu.add(applyAutoAnnotationSettings);
2285 autoAnnMenu.add(showConsensusHistogram);
2286 autoAnnMenu.add(showSequenceLogo);
2287 autoAnnMenu.add(normaliseSequenceLogo);
2288 autoAnnMenu.addSeparator();
2289 autoAnnMenu.add(showGroupConservation);
2290 autoAnnMenu.add(showGroupConsensus);
2291 annotationsMenu.add(autoAnnMenu);
2293 colourMenu.add(applyToAllGroups);
2294 colourMenu.add(textColour);
2295 colourMenu.addSeparator();
2296 colourMenu.add(noColourmenuItem);
2297 colourMenu.add(clustalColour);
2298 colourMenu.add(BLOSUM62Colour);
2299 colourMenu.add(PIDColour);
2300 colourMenu.add(zappoColour);
2301 colourMenu.add(taylorColour);
2302 colourMenu.add(hydrophobicityColour);
2303 colourMenu.add(helixColour);
2304 colourMenu.add(strandColour);
2305 colourMenu.add(turnColour);
2306 colourMenu.add(buriedColour);
2307 colourMenu.add(nucleotideColour);
2308 colourMenu.add(purinePyrimidineColour);
2309 colourMenu.add(RNAInteractionColour);
2310 // colourMenu.add(covariationColour);
2311 colourMenu.add(tcoffeeColour);
2312 colourMenu.add(userDefinedColour);
2313 colourMenu.addSeparator();
2314 colourMenu.add(conservationMenuItem);
2315 colourMenu.add(modifyConservation);
2316 colourMenu.add(abovePIDThreshold);
2317 colourMenu.add(modifyPID);
2318 colourMenu.add(annotationColour);
2319 colourMenu.add(rnahelicesColour);
2321 sort.add(sortIDMenuItem);
2322 sort.add(sortLengthMenuItem);
2323 sort.add(sortGroupMenuItem);
2324 sort.add(sortPairwiseMenuItem);
2325 sort.add(sortByTreeMenu);
2326 calculateMenu.add(sort);
2327 calculateMenu.add(calculateTree);
2328 calculateMenu.addSeparator();
2329 calculateMenu.add(pairwiseAlignmentMenuItem);
2330 calculateMenu.add(PCAMenuItem);
2331 calculateMenu.addSeparator();
2332 calculateMenu.add(showTranslation);
2333 calculateMenu.add(showReverse);
2334 calculateMenu.add(showReverseComplement);
2335 calculateMenu.add(showProducts);
2336 calculateMenu.add(autoCalculate);
2337 calculateMenu.add(sortByTree);
2338 calculateMenu.addSeparator();
2339 calculateMenu.add(expandAlignment);
2340 calculateMenu.add(extractScores);
2341 calculateMenu.addSeparator();
2342 calculateMenu.add(runGroovy);
2344 webServiceNoServices = new JMenuItem(
2345 MessageManager.getString("label.no_services"));
2346 webService.add(webServiceNoServices);
2347 exportImageMenu.add(htmlMenuItem);
2348 exportImageMenu.add(epsFile);
2349 exportImageMenu.add(createPNG);
2350 exportImageMenu.add(createBioJS);
2351 exportImageMenu.add(createSVG);
2352 addSequenceMenu.add(addFromFile);
2353 addSequenceMenu.add(addFromText);
2354 addSequenceMenu.add(addFromURL);
2355 this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH);
2356 statusPanel.add(statusBar, null);
2357 this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
2359 formatMenu.add(font);
2360 formatMenu.addSeparator();
2361 formatMenu.add(wrapMenuItem);
2362 formatMenu.add(scaleAbove);
2363 formatMenu.add(scaleLeft);
2364 formatMenu.add(scaleRight);
2365 formatMenu.add(seqLimits);
2366 formatMenu.add(idRightAlign);
2367 formatMenu.add(hiddenMarkers);
2368 formatMenu.add(viewBoxesMenuItem);
2369 formatMenu.add(viewTextMenuItem);
2370 formatMenu.add(colourTextMenuItem);
2371 formatMenu.add(renderGapsMenuItem);
2372 formatMenu.add(centreColumnLabelsMenuItem);
2373 formatMenu.add(showNonconservedMenuItem);
2374 selectMenu.add(findMenuItem);
2375 selectMenu.addSeparator();
2376 selectMenu.add(selectAllSequenceMenuItem);
2377 selectMenu.add(deselectAllSequenceMenuItem);
2378 selectMenu.add(invertSequenceMenuItem);
2379 selectMenu.add(invertColSel);
2380 selectMenu.add(createGroup);
2381 selectMenu.add(unGroup);
2382 selectMenu.add(grpsFromSelection);
2383 selectMenu.add(deleteGroups);
2384 selectMenu.add(annotationColumn);
2385 // TODO - determine if the listenToViewSelections button is needed : see bug
2387 // selectMenu.addSeparator();
2388 // selectMenu.add(listenToViewSelections);
2392 * Generate the reverse sequence (or reverse complement if the flag is true)
2393 * and add it to the alignment
2397 protected void showReverse_actionPerformed(boolean complement)
2402 * Try to run script in a Groovy console, having first ensured that this
2403 * alignframe is set as currentAlignFrame in Desktop
2405 protected void runGroovy_actionPerformed()
2410 * Adds the given action listener and key accelerator to the given menu item.
2411 * Also saves in a lookup table to support lookup of action by key stroke.
2415 * @param actionListener
2417 protected void addMenuActionAndAccelerator(KeyStroke keyStroke,
2418 JMenuItem menuItem, ActionListener actionListener)
2420 menuItem.setAccelerator(keyStroke);
2421 accelerators.put(keyStroke, menuItem);
2422 menuItem.addActionListener(actionListener);
2426 * Action on clicking sort annotations by type.
2430 protected void sortAnnotations_actionPerformed()
2435 * Action on clicking Show all annotations.
2437 * @param forSequences
2438 * update sequence-related annotations
2439 * @param forAlignment
2440 * update non-sequence-related annotations
2442 protected void showAllAnnotations_actionPerformed(boolean forSequences,
2443 boolean forAlignment)
2445 setAnnotationsVisibility(true, forSequences, forAlignment);
2449 * Action on clicking Hide all annotations.
2451 * @param forSequences
2452 * update sequence-related annotations
2453 * @param forAlignment
2454 * update non-sequence-related annotations
2456 protected void hideAllAnnotations_actionPerformed(boolean forSequences,
2457 boolean forAlignment)
2459 setAnnotationsVisibility(false, forSequences, forAlignment);
2463 * Set the visibility of annotations to true or false. Can act on
2464 * sequence-related annotations, or alignment-related, or both.
2467 * @param forSequences
2468 * update sequence-related annotations
2469 * @param forAlignment
2470 * update non-sequence-related annotations
2472 protected void setAnnotationsVisibility(boolean visible,
2473 boolean forSequences, boolean forAlignment)
2478 protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
2480 // TODO Auto-generated method stub
2484 protected void listenToViewSelections_actionPerformed(ActionEvent e)
2486 // TODO Auto-generated method stub
2490 protected void showAllhidden_actionPerformed(ActionEvent e)
2492 // TODO Auto-generated method stub
2496 protected void hideAllButSelection_actionPerformed(ActionEvent e)
2498 // TODO Auto-generated method stub
2502 protected void hideAllSelection_actionPerformed(ActionEvent e)
2504 // TODO Auto-generated method stub
2508 protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
2510 // TODO Auto-generated method stub
2514 protected void showConsensusHistogram_actionPerformed(ActionEvent e)
2516 // TODO Auto-generated method stub
2520 protected void showSequenceLogo_actionPerformed(ActionEvent e)
2522 // TODO Auto-generated method stub
2526 protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
2528 // TODO Auto-generated method stub
2532 protected void showGroupConsensus_actionPerformed(ActionEvent e)
2534 // TODO Auto-generated method stub
2538 protected void showGroupConservation_actionPerformed(ActionEvent e)
2540 // TODO Auto-generated method stub
2544 protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
2546 // TODO Auto-generated method stub
2550 protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
2552 // TODO Auto-generated method stub
2556 protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
2558 // TODO Auto-generated method stub
2562 protected void followHighlight_actionPerformed()
2564 // TODO Auto-generated method stub
2568 protected void showNpFeats_actionPerformed(ActionEvent e)
2570 // TODO Auto-generated method stub
2574 protected void showDbRefs_actionPerformed(ActionEvent e)
2576 // TODO Auto-generated method stub
2580 protected void centreColumnLabels_actionPerformed(ActionEvent e)
2584 protected void buildSortByAnnotationScoresMenu()
2588 protected void extractScores_actionPerformed(ActionEvent e)
2592 protected void outputText_actionPerformed(ActionEvent e)
2596 public void addFromFile_actionPerformed(ActionEvent e)
2601 public void addFromText_actionPerformed(ActionEvent e)
2606 public void addFromURL_actionPerformed(ActionEvent e)
2611 public void exportFeatures_actionPerformed(ActionEvent e)
2616 public void exportAnnotations_actionPerformed(ActionEvent e)
2621 protected void htmlMenuItem_actionPerformed(ActionEvent e)
2625 protected void bioJSMenuItem_actionPerformed(ActionEvent e)
2630 protected void closeMenuItem_actionPerformed(boolean b)
2634 protected void redoMenuItem_actionPerformed(ActionEvent e)
2638 protected void undoMenuItem_actionPerformed(ActionEvent e)
2642 protected void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
2646 protected void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
2650 protected void invertSequenceMenuItem_actionPerformed(ActionEvent e)
2654 protected void remove2LeftMenuItem_actionPerformed(ActionEvent e)
2658 protected void remove2RightMenuItem_actionPerformed(ActionEvent e)
2662 protected void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
2666 protected void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
2670 protected void wrapMenuItem_actionPerformed(ActionEvent e)
2674 protected void viewBoxesMenuItem_actionPerformed(ActionEvent e)
2678 protected void viewTextMenuItem_actionPerformed(ActionEvent e)
2682 protected void colourTextMenuItem_actionPerformed(ActionEvent e)
2686 protected void annotationPanelMenuItem_actionPerformed(ActionEvent e)
2690 protected void overviewMenuItem_actionPerformed(ActionEvent e)
2694 protected void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
2698 protected void sortIDMenuItem_actionPerformed(ActionEvent e)
2702 protected void sortLengthMenuItem_actionPerformed(ActionEvent e)
2706 protected void sortGroupMenuItem_actionPerformed(ActionEvent e)
2710 protected void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
2714 protected void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
2718 protected void PCAMenuItem_actionPerformed(ActionEvent e)
2722 protected void averageDistanceTreeMenuItem_actionPerformed(ActionEvent e)
2726 protected void neighbourTreeMenuItem_actionPerformed(ActionEvent e)
2730 protected void njTreeBlosumMenuItem_actionPerformed(ActionEvent e)
2734 protected void avTreeBlosumMenuItem_actionPerformed(ActionEvent e)
2738 protected void clustalColour_actionPerformed(ActionEvent e)
2742 protected void zappoColour_actionPerformed(ActionEvent e)
2746 protected void taylorColour_actionPerformed(ActionEvent e)
2750 protected void hydrophobicityColour_actionPerformed(ActionEvent e)
2754 protected void helixColour_actionPerformed(ActionEvent e)
2758 protected void strandColour_actionPerformed(ActionEvent e)
2762 protected void turnColour_actionPerformed(ActionEvent e)
2766 protected void buriedColour_actionPerformed(ActionEvent e)
2770 protected void userDefinedColour_actionPerformed(ActionEvent e)
2774 protected void PIDColour_actionPerformed(ActionEvent e)
2778 protected void BLOSUM62Colour_actionPerformed(ActionEvent e)
2782 protected void purinePyrimidineColour_actionPerformed(ActionEvent e)
2786 protected void RNAInteractionColour_actionPerformed(ActionEvent e)
2791 * protected void covariationColour_actionPerformed(ActionEvent e) { }
2794 protected void noColourmenuItem_actionPerformed(ActionEvent e)
2798 protected void conservationMenuItem_actionPerformed(ActionEvent e)
2802 protected void printMenuItem_actionPerformed(ActionEvent e)
2806 protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
2810 protected void findMenuItem_actionPerformed(ActionEvent e)
2814 protected void abovePIDThreshold_actionPerformed(ActionEvent e)
2818 public void showSeqFeatures_actionPerformed(ActionEvent actionEvent)
2822 protected void nucleotideColour_actionPerformed(ActionEvent e)
2826 protected void deleteGroups_actionPerformed(ActionEvent e)
2830 protected void createGroup_actionPerformed(ActionEvent e)
2834 protected void unGroup_actionPerformed(ActionEvent e)
2838 protected void copy_actionPerformed(ActionEvent e)
2842 protected void cut_actionPerformed(ActionEvent e)
2846 protected void delete_actionPerformed(ActionEvent e)
2850 protected void pasteNew_actionPerformed(ActionEvent e)
2854 protected void pasteThis_actionPerformed(ActionEvent e)
2858 protected void applyToAllGroups_actionPerformed(ActionEvent e)
2862 public void createPNG(java.io.File f)
2866 protected void font_actionPerformed(ActionEvent e)
2870 protected void seqLimit_actionPerformed(ActionEvent e)
2874 public void seqDBRef_actionPerformed(ActionEvent e)
2879 public void createEPS(java.io.File f)
2883 public void createSVG(java.io.File f)
2888 protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
2894 * Template method to handle the 'load T-Coffee scores' menu event.
2896 * Subclasses override this method to provide a custom action.
2901 protected void loadScores_actionPerformed(ActionEvent event)
2907 * Template method to handle the 'Color T-Coffee scores' menu event.
2909 * Subclasses override this method to provide a custom action.
2914 protected void tcoffeeColorScheme_actionPerformed(ActionEvent event)
2919 protected void jpred_actionPerformed(ActionEvent e)
2923 protected void scaleAbove_actionPerformed(ActionEvent e)
2927 protected void scaleLeft_actionPerformed(ActionEvent e)
2931 protected void scaleRight_actionPerformed(ActionEvent e)
2935 protected void modifyPID_actionPerformed(ActionEvent e)
2939 protected void modifyConservation_actionPerformed(ActionEvent e)
2943 protected void saveAs_actionPerformed(ActionEvent e)
2947 protected void padGapsMenuitem_actionPerformed(ActionEvent e)
2951 public void vamsasStore_actionPerformed(ActionEvent e)
2956 public void vamsasLoad_actionPerformed(ActionEvent e)
2961 public void showTranslation_actionPerformed(ActionEvent e)
2966 public void featureSettings_actionPerformed(ActionEvent e)
2971 public void fetchSequence_actionPerformed(ActionEvent e)
2976 public void smoothFont_actionPerformed(ActionEvent e)
2981 public void annotationColour_actionPerformed(ActionEvent e)
2986 public void annotationColumn_actionPerformed(ActionEvent e)
2991 public void rnahelicesColour_actionPerformed(ActionEvent e)
2996 public void associatedData_actionPerformed(ActionEvent e)
3001 public void autoCalculate_actionPerformed(ActionEvent e)
3006 public void sortByTreeOption_actionPerformed(ActionEvent e)
3011 public void showAllSeqs_actionPerformed(ActionEvent e)
3016 public void showAllColumns_actionPerformed(ActionEvent e)
3021 public void hideSelSequences_actionPerformed(ActionEvent e)
3026 public void hideSelColumns_actionPerformed(ActionEvent e)
3031 public void hiddenMarkers_actionPerformed(ActionEvent e)
3036 public void findPdbId_actionPerformed(ActionEvent e)
3041 public void enterPdbId_actionPerformed(ActionEvent e)
3046 public void pdbFile_actionPerformed(ActionEvent e)
3051 public void invertColSel_actionPerformed(ActionEvent e)
3056 public void tabSelectionChanged(int sel)
3061 public void tabbedPane_mousePressed(MouseEvent e)
3066 public void tabbedPane_focusGained(FocusEvent e)
3071 public void save_actionPerformed(ActionEvent e)
3076 public void reload_actionPerformed(ActionEvent e)
3081 public void newView_actionPerformed(ActionEvent e)
3086 public void textColour_actionPerformed(ActionEvent e)
3091 public void idRightAlign_actionPerformed(ActionEvent e)
3096 public void expandViews_actionPerformed(ActionEvent e)
3101 public void gatherViews_actionPerformed(ActionEvent e)
3106 public void buildTreeMenu()
3111 public void pageSetup_actionPerformed(ActionEvent e)
3116 public void alignmentProperties()
3121 protected void expand_newalign(ActionEvent e)
3123 // TODO Auto-generated method stub
3127 protected boolean isShowAutoCalculatedAbove()
3129 return showAutoCalculatedAbove;
3132 protected void setShowAutoCalculatedAbove(boolean showAutoCalculatedAbove)
3134 this.showAutoCalculatedAbove = showAutoCalculatedAbove;
3137 protected SequenceAnnotationOrder getAnnotationSortOrder()
3139 return annotationSortOrder;
3142 protected void setAnnotationSortOrder(
3143 SequenceAnnotationOrder annotationSortOrder)
3145 this.annotationSortOrder = annotationSortOrder;
3148 public Map<KeyStroke, JMenuItem> getAccelerators()
3150 return this.accelerators;
3154 * Returns the selected index of the tabbed pane, or -1 if none selected
3155 * (including the case where the tabbed pane has not been made visible).
3159 public int getTabIndex()
3161 return tabbedPane.getSelectedIndex();
3164 public JPanel getStatusPanel()
3170 * Sets a reference to the containing split frame. Also makes the 'toggle
3171 * split view' menu item visible and checked.
3175 public void setSplitFrame(SplitContainerI sf)
3177 this.splitFrame = sf;
3180 this.showComplementMenuItem.setVisible(true);
3181 this.showComplementMenuItem.setState(true);
3185 public SplitContainerI getSplitViewContainer()
3187 return this.splitFrame;
3190 protected void showComplement_actionPerformed(boolean complement)