JAL-2388 Missed file from previous commit
authorkiramt <k.mourao@dundee.ac.uk>
Tue, 25 Apr 2017 13:52:45 +0000 (14:52 +0100)
committerkiramt <k.mourao@dundee.ac.uk>
Tue, 25 Apr 2017 13:52:45 +0000 (14:52 +0100)
src/jalview/appletgui/OverviewPanel.java

index cf72daf..45dfbfc 100755 (executable)
@@ -28,19 +28,18 @@ import jalview.viewmodel.OverviewDimensionsWithHidden;
 
 import java.awt.BorderLayout;
 import java.awt.Dimension;
+import java.awt.MenuItem;
 import java.awt.Panel;
+import java.awt.PopupMenu;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
+import java.awt.event.InputEvent;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
 
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-import javax.swing.SwingUtilities;
-
 public class OverviewPanel extends Panel implements Runnable,
         MouseMotionListener, MouseListener
 {
@@ -105,7 +104,7 @@ public class OverviewPanel extends Panel implements Runnable,
   @Override
   public void mouseClicked(MouseEvent evt)
   {
-    if (SwingUtilities.isRightMouseButton(evt))
+    if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
     {
       showPopupMenu(evt);
     }
@@ -136,7 +135,7 @@ public class OverviewPanel extends Panel implements Runnable,
 
   private void mouseAction(MouseEvent evt)
   {
-    if (SwingUtilities.isRightMouseButton(evt))
+    if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
     {
       if (!Platform.isAMac())
       {
@@ -208,7 +207,7 @@ public class OverviewPanel extends Panel implements Runnable,
    */
   private void showPopupMenu(MouseEvent e)
   {
-    JPopupMenu popup = new JPopupMenu();
+    PopupMenu popup = new PopupMenu();
     ActionListener menuListener = new ActionListener()
     {
       @Override
@@ -218,10 +217,11 @@ public class OverviewPanel extends Panel implements Runnable,
         toggleHiddenColumns();
       }
     };
-    JMenuItem item = new JMenuItem(
+    MenuItem item = new MenuItem(
             MessageManager.getString("label.togglehidden"));
     popup.add(item);
     item.addActionListener(menuListener);
+    this.add(popup);
     popup.show(this, e.getX(), e.getY());
   }