X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=af8a172ee0885fef913a7f7236de04ce5f26bcbd;hb=8ef09062d96fd0287fbdf4a54b6cc72a9c249ac8;hp=b2eb094295c7f40329c362973afce745c750203a;hpb=69bab27e77ceaca6d12e0de49f8fc62e01678f53;p=jalview.git diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index b2eb094..af8a172 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -136,8 +136,6 @@ public class GAlignFrame extends JInternalFrame public JCheckBoxMenuItem showSeqFeatures = new JCheckBoxMenuItem(); - public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem(); - JMenuItem copy = new JMenuItem(); JMenuItem cut = new JMenuItem(); @@ -294,34 +292,50 @@ public class GAlignFrame extends JInternalFrame @Override public void mousePressed(MouseEvent evt) { - if (evt.isPopupTrigger()) + if (evt.isPopupTrigger()) // Mac { - radioItem.removeActionListener(radioItem.getActionListeners()[0]); - - int option = JOptionPane.showInternalConfirmDialog( - jalview.gui.Desktop.desktop, - MessageManager - .getString("label.remove_from_default_list"), - MessageManager - .getString("label.remove_user_defined_colour"), - JOptionPane.YES_NO_OPTION); - if (option == JOptionPane.YES_OPTION) - { - jalview.gui.UserDefinedColours - .removeColourFromDefaults(radioItem.getText()); - colourMenu.remove(radioItem); - } - else + offerRemoval(radioItem); + } + } + + @Override + public void mouseReleased(MouseEvent evt) + { + if (evt.isPopupTrigger()) // Windows + { + offerRemoval(radioItem); + } + } + + /** + * @param radioItem + */ + void offerRemoval(final JRadioButtonMenuItem radioItem) + { + radioItem.removeActionListener(radioItem.getActionListeners()[0]); + + int option = JOptionPane.showInternalConfirmDialog( + jalview.gui.Desktop.desktop, MessageManager + .getString("label.remove_from_default_list"), + MessageManager + .getString("label.remove_user_defined_colour"), + JOptionPane.YES_NO_OPTION); + if (option == JOptionPane.YES_OPTION) + { + jalview.gui.UserDefinedColours + .removeColourFromDefaults(radioItem.getText()); + colourMenu.remove(radioItem); + } + else + { + radioItem.addActionListener(new ActionListener() { - radioItem.addActionListener(new ActionListener() + @Override + public void actionPerformed(ActionEvent evt) { - @Override - public void actionPerformed(ActionEvent evt) - { - userDefinedColour_actionPerformed(evt); - } - }); - } + userDefinedColour_actionPerformed(evt); + } + }); } } }); @@ -1591,7 +1605,7 @@ public class GAlignFrame extends JInternalFrame }); JMenuItem modifyPID = new JMenuItem( - MessageManager.getString("label.modify_identity_thereshold")); + MessageManager.getString("label.modify_identity_threshold")); modifyPID.addActionListener(new ActionListener() { @Override @@ -1601,7 +1615,7 @@ public class GAlignFrame extends JInternalFrame } }); modifyConservation.setText(MessageManager - .getString("label.modify_conservation_thereshold")); + .getString("label.modify_conservation_threshold")); modifyConservation.addActionListener(new ActionListener() { @Override @@ -1727,7 +1741,8 @@ public class GAlignFrame extends JInternalFrame showProducts.setText(MessageManager.getString("label.get_cross_refs")); runGroovy.setText(MessageManager.getString("label.run_groovy")); - runGroovy.setToolTipText(MessageManager.getString("label.run_groovy_tip")); + runGroovy.setToolTipText(MessageManager + .getString("label.run_groovy_tip")); runGroovy.addActionListener(new ActionListener() { @Override @@ -2032,7 +2047,19 @@ public class GAlignFrame extends JInternalFrame @Override public void mousePressed(MouseEvent e) { - tabbedPane_mousePressed(e); + if (e.isPopupTrigger()) // Mac + { + tabbedPane_mousePressed(e); + } + } + + @Override + public void mouseReleased(MouseEvent e) + { + if (e.isPopupTrigger()) // Windows + { + tabbedPane_mousePressed(e); + } } }); tabbedPane.addFocusListener(new FocusAdapter() @@ -2154,6 +2181,19 @@ public class GAlignFrame extends JInternalFrame alignmentProperties(); } }); + JMenuItem selectHighlighted = new JMenuItem( + MessageManager.getString("action.select_highlighted_columns")); + selectHighlighted.setToolTipText(MessageManager + .getString("tooltip.select_highlighted_columns")); + al = new ActionListener() + { + @Override + public void actionPerformed(ActionEvent actionEvent) + { + selectHighlightedColumns_actionPerformed(actionEvent); + } + }; + selectHighlighted.addActionListener(al); JMenu tooltipSettingsMenu = new JMenu( MessageManager.getString("label.sequence_id_tooltip")); JMenu autoAnnMenu = new JMenu( @@ -2355,12 +2395,20 @@ public class GAlignFrame extends JInternalFrame selectMenu.add(grpsFromSelection); selectMenu.add(deleteGroups); selectMenu.add(annotationColumn); + selectMenu.add(selectHighlighted); // TODO - determine if the listenToViewSelections button is needed : see bug // JAL-574 // selectMenu.addSeparator(); // selectMenu.add(listenToViewSelections); } + protected void selectHighlightedColumns_actionPerformed( + ActionEvent actionEvent) + { + // TODO Auto-generated method stub + + } + /** * Generate the reverse sequence (or reverse complement if the flag is true) * and add it to the alignment @@ -2379,6 +2427,7 @@ public class GAlignFrame extends JInternalFrame { } + /** * Adds the given action listener and key accelerator to the given menu item. * Also saves in a lookup table to support lookup of action by key stroke. @@ -2520,13 +2569,6 @@ public class GAlignFrame extends JInternalFrame } - protected void showSeqFeaturesHeight_actionPerformed( - ActionEvent actionEvent) - { - // TODO Auto-generated method stub - - } - protected void justifyRightMenuItem_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub