JAL-2077 - reinstate popups on osx
authorJim Procter <jprocter@issues.jalview.org>
Sun, 24 Apr 2016 12:17:30 +0000 (13:17 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Sun, 24 Apr 2016 12:18:03 +0000 (13:18 +0100)
15 files changed:
src/MCview/PDBViewer.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/CutAndPasteHtmlTransfer.java
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/gui/DasSourceBrowser.java
src/jalview/gui/Desktop.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/IdPanel.java
src/jalview/gui/OptsAndParamsPage.java
src/jalview/gui/ScalePanel.java
src/jalview/gui/SeqPanel.java
src/jalview/gui/TreeCanvas.java
src/jalview/jbgui/GAlignFrame.java

index da744a4..e032c7a 100755 (executable)
@@ -62,7 +62,6 @@ import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
 import javax.swing.JRadioButtonMenuItem;
-import javax.swing.SwingUtilities;
 
 public class PDBViewer extends JInternalFrame implements Runnable
 {
@@ -416,8 +415,7 @@ public class PDBViewer extends JInternalFrame implements Runnable
           @Override
           public void mousePressed(MouseEvent evt)
           {
-            if (evt.isControlDown()
-                    || SwingUtilities.isRightMouseButton(evt))
+            if (evt.isPopupTrigger())
             {
               radioItem.removeActionListener(radioItem.getActionListeners()[0]);
 
index 67152f2..44d1d94 100644 (file)
@@ -3641,8 +3641,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           @Override
           public void mousePressed(MouseEvent evt)
           {
-            if (evt.isControlDown()
-                    || SwingUtilities.isRightMouseButton(evt))
+            if (evt.isPopupTrigger())
             {
               radioItem.removeActionListener(radioItem.getActionListeners()[0]);
 
@@ -5395,7 +5394,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void tabbedPane_mousePressed(MouseEvent e)
   {
-    if (SwingUtilities.isRightMouseButton(e))
+    if (e.isPopupTrigger())
     {
       String msg = MessageManager.getString("label.enter_view_name");
       String reply = JOptionPane.showInternalInputDialog(this, msg, msg,
index 3105ab9..f92d67f 100755 (executable)
@@ -617,7 +617,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         }
       }
     }
-    if (!SwingUtilities.isRightMouseButton(evt))
+    if (!evt.isPopupTrigger())
     {
       return;
     }
index a70d4b9..bb311ef 100755 (executable)
@@ -54,7 +54,6 @@ import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.Scrollable;
-import javax.swing.SwingUtilities;
 import javax.swing.ToolTipManager;
 
 /**
@@ -511,7 +510,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       }
     }
 
-    if (SwingUtilities.isRightMouseButton(evt) && activeRow != -1)
+    if (evt.isPopupTrigger() && activeRow != -1)
     {
       if (av.getColumnSelection() == null)
       {
index 7d5d8d7..9c06f95 100644 (file)
@@ -222,7 +222,7 @@ public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer
 
   public void textarea_mousePressed(MouseEvent e)
   {
-    if (SwingUtilities.isRightMouseButton(e))
+    if (e.isPopupTrigger())
     {
       JPopupMenu popup = new JPopupMenu(
               MessageManager.getString("action.edit"));
index 76f1041..1161340 100644 (file)
@@ -358,7 +358,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
   @Override
   public void textarea_mousePressed(MouseEvent e)
   {
-    if (SwingUtilities.isRightMouseButton(e))
+    if (e.isPopupTrigger())
     {
       JPopupMenu popup = new JPopupMenu(
               MessageManager.getString("action.edit"));
index 53e3c8d..8158ee6 100644 (file)
@@ -96,8 +96,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements
     {
       public void mouseClicked(MouseEvent evt)
       {
-        if (evt.getClickCount() == 2
-                || SwingUtilities.isRightMouseButton(evt))
+        if (evt.getClickCount() == 2 || evt.isPopupTrigger())
         {
           editRemoveLocalSource(evt);
         }
index b7c4098..8e863c1 100644 (file)
@@ -383,7 +383,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
       @Override
       public void mousePressed(MouseEvent evt)
       {
-        if (SwingUtilities.isRightMouseButton(evt))
+        if (evt.isPopupTrigger())
         {
           showPasteMenu(evt.getX(), evt.getY());
         }
index c2be241..6633156 100644 (file)
@@ -170,7 +170,7 @@ public class FeatureSettings extends JPanel implements
       public void mousePressed(MouseEvent evt)
       {
         selectedRow = table.rowAtPoint(evt.getPoint());
-        if (SwingUtilities.isRightMouseButton(evt))
+        if (evt.isPopupTrigger())
         {
           popupSort(selectedRow, (String) table.getValueAt(selectedRow, 0),
                   table.getValueAt(selectedRow, 1), fr.getMinMax(),
index eb5faa1..e247793 100755 (executable)
@@ -191,7 +191,7 @@ public class IdPanel extends JPanel implements MouseListener,
      * Ignore single click. Ignore 'left' click followed by 'right' click (user
      * selects a row then its pop-up menu).
      */
-    if (e.getClickCount() < 2 || SwingUtilities.isRightMouseButton(e))
+    if (e.getClickCount() < 2 || e.isPopupTrigger())
     {
       return;
     }
@@ -316,7 +316,7 @@ public class IdPanel extends JPanel implements MouseListener,
 
     int seq = alignPanel.getSeqPanel().findSeq(e);
 
-    if (SwingUtilities.isRightMouseButton(e))
+    if (e.isPopupTrigger())
     {
       Sequence sq = (Sequence) av.getAlignment().getSequenceAt(seq);
       // build a new links menu based on the current links + any non-positional
index 8a0fe77..c591feb 100644 (file)
@@ -208,7 +208,7 @@ public class OptsAndParamsPage
 
     public void mouseClicked(MouseEvent e)
     {
-      if (javax.swing.SwingUtilities.isRightMouseButton(e))
+      if (e.isPopupTrigger())
       {
         showUrlPopUp(this, finfo.toString(), e.getX(), e.getY());
       }
@@ -528,7 +528,7 @@ public class OptsAndParamsPage
 
     public void mouseClicked(MouseEvent e)
     {
-      if (javax.swing.SwingUtilities.isRightMouseButton(e))
+      if (e.isPopupTrigger())
       {
         showUrlPopUp(this, finfo.toString(), e.getX(), e.getY());
       }
index 41de58f..3ab681c 100755 (executable)
@@ -39,7 +39,6 @@ import java.awt.event.MouseMotionListener;
 import javax.swing.JMenuItem;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
-import javax.swing.SwingUtilities;
 import javax.swing.ToolTipManager;
 
 /**
@@ -107,7 +106,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
     min = res;
     max = res;
 
-    if (SwingUtilities.isRightMouseButton(evt))
+    if (evt.isPopupTrigger())
     {
       rightMouseButtonPressed(evt, res);
     }
index 1f1dd2f..3fbb809 100644 (file)
@@ -1599,7 +1599,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     }
 
-    if (SwingUtilities.isRightMouseButton(evt))
+    if (evt.isPopupTrigger())
     {
       List<SequenceFeature> allFeatures = ap.getFeatureRenderer()
               .findFeaturesAtRes(sequence.getDatasetSequence(),
index 90c74be..f21c5e7 100755 (executable)
@@ -59,7 +59,6 @@ import java.util.Vector;
 import javax.swing.JColorChooser;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
 import javax.swing.ToolTipManager;
 
 /**
@@ -791,7 +790,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
   {
     if (highlightNode != null)
     {
-      if (SwingUtilities.isRightMouseButton(evt))
+      if (evt.isPopupTrigger())
       {
         Color col = JColorChooser.showDialog(this,
                 MessageManager.getString("label.select_subtree_colour"),
index 1eb558e..b2eb094 100755 (executable)
@@ -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;
@@ -295,8 +294,7 @@ public class GAlignFrame extends JInternalFrame
           @Override
           public void mousePressed(MouseEvent evt)
           {
-            if (evt.isControlDown()
-                    || SwingUtilities.isRightMouseButton(evt))
+            if (evt.isPopupTrigger())
             {
               radioItem.removeActionListener(radioItem.getActionListeners()[0]);