X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=bb22d6490da64b18b3b47cd14e278f8786c5f6ba;hb=db93a1adcbe0a4eaaf06e0a70ade0d6c5c1961c3;hp=b2eb094295c7f40329c362973afce745c750203a;hpb=69bab27e77ceaca6d12e0de49f8fc62e01678f53;p=jalview.git diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index b2eb094..bb22d64 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -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() @@ -2379,6 +2406,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 +2548,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