X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fjbgui%2FGAlignFrame.java;h=af8a172ee0885fef913a7f7236de04ce5f26bcbd;hb=9ecc7ec6a4eb1d0713c2c050a79c5b04c2092309;hp=1eb558e9cf04abfd1dff7bd9b28b9a6aaa3c3333;hpb=d953e0e3aa04e00c1d1b8fd94e05c6ba744f8416;p=jalview.git diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 1eb558e..af8a172 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -55,7 +55,6 @@ import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; import javax.swing.JTabbedPane; import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; @@ -137,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(); @@ -295,35 +292,50 @@ public class GAlignFrame extends JInternalFrame @Override public void mousePressed(MouseEvent evt) { - if (evt.isControlDown() - || SwingUtilities.isRightMouseButton(evt)) + 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); + } + }); } } }); @@ -1593,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 @@ -1603,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 @@ -1729,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 @@ -2034,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() @@ -2156,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( @@ -2357,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 @@ -2381,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. @@ -2522,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