From: kiramt Date: Tue, 25 Apr 2017 13:52:45 +0000 (+0100) Subject: JAL-2388 Missed file from previous commit X-Git-Tag: Release_2_10_2~3^2~92^2~8 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=12a719d6bf88315a02b1e04b9ad4dba3d6114481;p=jalview.git JAL-2388 Missed file from previous commit --- 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()); }