From 12a719d6bf88315a02b1e04b9ad4dba3d6114481 Mon Sep 17 00:00:00 2001 From: kiramt Date: Tue, 25 Apr 2017 14:52:45 +0100 Subject: [PATCH] JAL-2388 Missed file from previous commit --- src/jalview/appletgui/OverviewPanel.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jalview/appletgui/OverviewPanel.java b/src/jalview/appletgui/OverviewPanel.java index cf72daf..45dfbfc 100755 --- a/src/jalview/appletgui/OverviewPanel.java +++ b/src/jalview/appletgui/OverviewPanel.java @@ -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()); } -- 1.7.10.2