+ sortByTreeMenu
+ .setText(MessageManager.getString("action.by_tree_order"));
+ sort.setText(MessageManager.getString("action.sort"));
+ sort.addMenuListener(new MenuListener()
+ {
+ @Override
+ public void menuSelected(MenuEvent e)
+ {
+ buildTreeMenu();
+ }
+
+ @Override
+ public void menuDeselected(MenuEvent e)
+ {
+ }
+
+ @Override
+ public void menuCanceled(MenuEvent e)
+ {
+ }
+ });
+ sortByAnnotScore.setText(MessageManager
+ .getString("label.sort_by_score"));
+ sort.add(sortByAnnotScore);
+ sort.addMenuListener(new javax.swing.event.MenuListener()
+ {
+
+ @Override
+ public void menuCanceled(MenuEvent e)
+ {
+ }
+
+ @Override
+ public void menuDeselected(MenuEvent e)
+ {
+ }
+
+ @Override
+ public void menuSelected(MenuEvent e)
+ {
+ buildSortByAnnotationScoresMenu();
+ }
+ });
+ sortByAnnotScore.setVisible(false);
+
+ calculateTree
+ .setText(MessageManager.getString("action.calculate_tree"));
+
+ padGapsMenuitem.setText(MessageManager.getString("label.pad_gaps"));
+ padGapsMenuitem.setState(jalview.bin.Cache
+ .getDefault("PAD_GAPS", false));
+ padGapsMenuitem.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ padGapsMenuitem_actionPerformed(e);
+ }
+ });
+ JMenuItem vamsasStore = new JMenuItem(
+ MessageManager.getString("label.vamsas_store"));
+ vamsasStore.setVisible(false);
+ vamsasStore.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ vamsasStore_actionPerformed(e);
+ }
+ });
+ showTranslation.setText(MessageManager
+ .getString("label.translate_cDNA"));
+ showTranslation.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showTranslation_actionPerformed(e);
+ }
+ });
+
+ JMenuItem extractScores = new JMenuItem(
+ MessageManager.getString("label.extract_scores") + "...");
+ extractScores.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ extractScores_actionPerformed(e);
+ }
+ });
+ extractScores.setVisible(true);
+ // JBPNote: TODO: make gui for regex based score extraction
+
+ // for show products actions see AlignFrame.canShowProducts
+ showProducts.setText(MessageManager.getString("label.get_cross_refs"));
+
+ JMenuItem openFeatureSettings = new JMenuItem(
+ MessageManager.getString("label.feature_settings"));
+ openFeatureSettings.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ featureSettings_actionPerformed(e);
+ }
+ });
+ JMenuItem fetchSequence = new JMenuItem(
+ MessageManager.getString("label.fetch_sequences"));
+ fetchSequence.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ fetchSequence_actionPerformed(e);
+ }
+ });
+
+ JMenuItem annotationColour = new JMenuItem(
+ MessageManager.getString("action.by_annotation"));
+ annotationColour.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ annotationColour_actionPerformed(e);
+ }
+ });
+
+ JMenuItem annotationColumn = new JMenuItem(
+ MessageManager.getString("action.select_by_annotation"));
+ annotationColumn.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ annotationColumn_actionPerformed(e);
+ }
+ });
+
+ rnahelicesColour.setText(MessageManager
+ .getString("action.by_rna_helixes"));
+ rnahelicesColour.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ rnahelicesColour_actionPerformed(e);
+ }
+ });
+
+ JMenuItem associatedData = new JMenuItem(
+ MessageManager.getString("label.load_features_annotations"));
+ associatedData.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ associatedData_actionPerformed(e);
+ }
+ });
+ autoCalculate.setText(MessageManager
+ .getString("label.autocalculate_consensus"));
+ autoCalculate.setState(jalview.bin.Cache.getDefault(
+ "AUTO_CALC_CONSENSUS", true));
+ autoCalculate.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ autoCalculate_actionPerformed(e);
+ }
+ });
+ sortByTree.setText(MessageManager
+ .getString("label.sort_alignment_new_tree"));
+ sortByTree
+ .setToolTipText("<html>"
+ + MessageManager
+ .getString("label.enable_automatically_sort_alignment_when_open_new_tree"));
+ sortByTree
+ .setState(jalview.bin.Cache.getDefault("SORT_BY_TREE", false));
+ sortByTree.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ sortByTreeOption_actionPerformed(e);
+ }
+ });
+
+ listenToViewSelections.setText(MessageManager
+ .getString("label.listen_for_selections"));
+ listenToViewSelections
+ .setToolTipText("<html>"
+ + MessageManager
+ .getString("label.selections_mirror_selections_made_same_sequences_other_views"));
+ listenToViewSelections.setState(false);
+ listenToViewSelections.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ listenToViewSelections_actionPerformed(e);
+ }
+ });
+
+ JMenu addSequenceMenu = new JMenu(
+ MessageManager.getString("label.add_sequences"));
+ JMenuItem addFromFile = new JMenuItem(
+ MessageManager.getString("label.from_file"));
+ addFromFile.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ addFromFile_actionPerformed(e);
+ }
+ });
+ JMenuItem addFromText = new JMenuItem(
+ MessageManager.getString("label.from_textbox"));
+ addFromText.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ addFromText_actionPerformed(e);
+ }
+ });
+ JMenuItem addFromURL = new JMenuItem(
+ MessageManager.getString("label.from_url"));
+ addFromURL.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ addFromURL_actionPerformed(e);
+ }
+ });
+ JMenuItem exportFeatures = new JMenuItem(
+ MessageManager.getString("label.export_features"));
+ exportFeatures.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ exportFeatures_actionPerformed(e);
+ }
+ });
+ JMenuItem exportAnnotations = new JMenuItem(
+ MessageManager.getString("label.export_annotations"));
+ exportAnnotations.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ exportAnnotations_actionPerformed(e);
+ }
+ });
+ statusPanel.setLayout(new GridLayout());
+ JMenuItem showAllSeqs = new JMenuItem(
+ MessageManager.getString("label.all_sequences"));
+ showAllSeqs.setToolTipText(MessageManager
+ .getString("label.toggle_sequence_visibility"));
+ showAllSeqs.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showAllSeqs_actionPerformed(e);
+ }
+ });
+ JMenuItem showAllColumns = new JMenuItem(
+ MessageManager.getString("label.all_columns"));
+ showAllColumns.setToolTipText(MessageManager
+ .getString("label.toggle_columns_visibility"));
+ showAllColumns.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showAllColumns_actionPerformed(e);
+ }
+ });
+ JMenu hideMenu = new JMenu(MessageManager.getString("action.hide"));
+ JMenuItem hideSelSequences = new JMenuItem(
+ MessageManager.getString("label.selected_sequences"));
+ hideSelSequences.setToolTipText(MessageManager
+ .getString("label.toggle_sequence_visibility"));
+ hideSelSequences.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hideSelSequences_actionPerformed(e);
+ }
+ });
+ JMenuItem hideSelColumns = new JMenuItem(
+ MessageManager.getString("label.selected_columns"));
+ hideSelColumns.setToolTipText(MessageManager
+ .getString("label.toggle_columns_visibility"));
+ hideSelColumns.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hideSelColumns_actionPerformed(e);
+ }
+ });
+ JMenuItem hideAllSelection = new JMenuItem(
+ MessageManager.getString("label.selected_region"));
+ hideAllSelection.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hideAllSelection_actionPerformed(e);
+ }
+ });
+ // TODO: should be hidden if no selection exists.
+ JMenuItem hideAllButSelection = new JMenuItem(
+ MessageManager.getString("label.all_but_selected_region"));
+ hideAllButSelection.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hideAllButSelection_actionPerformed(e);
+ }
+ });
+ JMenuItem showAllhidden = new JMenuItem(
+ MessageManager.getString("label.all_sequences_columns"));
+ showAllhidden.setToolTipText(MessageManager
+ .getString("label.toggles_visibility_hidden_selected_regions"));
+ showAllhidden.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showAllhidden_actionPerformed(e);
+ }
+ });
+ hiddenMarkers.setText(MessageManager
+ .getString("action.show_hidden_markers"));
+ hiddenMarkers.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hiddenMarkers_actionPerformed(e);
+ }
+ });
+
+ JMenuItem invertColSel = new JMenuItem(
+ MessageManager.getString("action.invert_column_selection"));
+ keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I,
+ Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()
+ | KeyEvent.ALT_MASK, false);
+ al = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ invertColSel_actionPerformed(e);
+ }
+ };
+ addMenuActionAndAccelerator(keyStroke, invertColSel, al);
+
+ showComplementMenuItem.setVisible(false);
+ showComplementMenuItem.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showComplement_actionPerformed(showComplementMenuItem.getState());
+ }
+ });
+
+ tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()
+ {
+ @Override
+ public void stateChanged(ChangeEvent evt)
+ {
+ JTabbedPane pane = (JTabbedPane) evt.getSource();
+ int sel = pane.getSelectedIndex();
+ tabSelectionChanged(sel);
+ }
+ });
+ tabbedPane.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent e)
+ {
+ tabbedPane_mousePressed(e);
+ }
+ });
+ tabbedPane.addFocusListener(new FocusAdapter()
+ {
+ @Override
+ public void focusGained(FocusEvent e)
+ {
+ tabbedPane_focusGained(e);
+ }
+ });
+
+ JMenuItem save = new JMenuItem(MessageManager.getString("action.save"));
+ keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit
+ .getDefaultToolkit().getMenuShortcutKeyMask(), false);
+ al = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ save_actionPerformed(e);
+ }
+ };
+ addMenuActionAndAccelerator(keyStroke, save, al);
+
+ reload.setEnabled(false);
+ reload.setText(MessageManager.getString("action.reload"));
+ reload.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ reload_actionPerformed(e);
+ }
+ });
+
+ JMenuItem newView = new JMenuItem(
+ MessageManager.getString("action.new_view"));
+ keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_T, Toolkit
+ .getDefaultToolkit().getMenuShortcutKeyMask(), false);
+ al = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ newView_actionPerformed(e);
+ }
+ };
+ addMenuActionAndAccelerator(keyStroke, newView, al);
+
+ tabbedPane.setToolTipText("<html><i>"
+ + MessageManager.getString("label.rename_tab_eXpand_reGroup")
+ + "</i></html>");
+ JMenuItem textColour = new JMenuItem(
+ MessageManager.getString("label.colour_text") + "...");
+ textColour.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ textColour_actionPerformed(e);
+ }
+ });
+ formatMenu.setText(MessageManager.getString("action.format"));
+ JMenu selectMenu = new JMenu(MessageManager.getString("action.select"));
+ idRightAlign.setText(MessageManager
+ .getString("label.right_align_sequence_id"));
+ idRightAlign.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ idRightAlign_actionPerformed(e);
+ }
+ });
+
+ gatherViews.setEnabled(false);
+ gatherViews.setText(MessageManager.getString("action.gather_views"));
+ keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, 0, false);
+ al = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ gatherViews_actionPerformed(e);
+ }
+ };
+ addMenuActionAndAccelerator(keyStroke, gatherViews, al);
+
+ expandViews.setEnabled(false);
+ expandViews.setText(MessageManager.getString("action.expand_views"));
+ keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_X, 0, false);
+ al = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ expandViews_actionPerformed(e);
+ }
+ };
+ addMenuActionAndAccelerator(keyStroke, expandViews, al);
+
+ JMenuItem pageSetup = new JMenuItem(
+ MessageManager.getString("action.page_setup") + "...");
+ pageSetup.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ pageSetup_actionPerformed(e);
+ }
+ });
+ JMenuItem alignmentProperties = new JMenuItem(
+ MessageManager.getString("label.alignment_props") + "...");
+ alignmentProperties.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ alignmentProperties();
+ }
+ });
+ JMenu tooltipSettingsMenu = new JMenu(
+ MessageManager.getString("label.sequence_id_tooltip"));
+ JMenu autoAnnMenu = new JMenu(
+ MessageManager.getString("label.autocalculated_annotation"));
+
+ JMenu exportImageMenu = new JMenu(
+ MessageManager.getString("label.export_image"));
+ JMenu fileMenu = new JMenu(MessageManager.getString("action.file"));