}
ap.getScalePanel().mousePressed(evt);
-
}
/**
mouseDragging = false;
ap.getScalePanel().mouseReleased(evt);
+ /*
+ * isPopupTrigger is set in mouseReleased on Windows
+ * (in mousePressed on Mac)
+ */
if (evt.isPopupTrigger() && activeRow != -1)
{
showPopupMenu(evt.getY(), evt.getX());
import jalview.datamodel.SequenceI;
import jalview.io.SequenceAnnotationReport;
import jalview.util.MessageManager;
-import jalview.util.Platform;
import jalview.util.UrlLink;
import jalview.viewmodel.AlignmentViewport;
if (e.isPopupTrigger()) // Mac reports this in mousePressed
{
showPopupMenu(e);
-
return;
}
+
/*
- * defer right-mouse click handling to mouse up on Mac
+ * defer right-mouse click handling to mouseReleased on Windows
* (where isPopupTrigger() will answer true)
+ * NB isRightMouseButton is also true for Cmd-click on Mac
*/
- if (SwingUtilities.isRightMouseButton(e) && !Platform.isAMac())
+ if (SwingUtilities.isRightMouseButton(e))
{
return;
}
@Override
public void mousePressed(MouseEvent evt)
{
- /*
- * defer right-mouse click handling to mouse up on Mac
- * (where isPopupTrigger() will answer true)
- */
- if (SwingUtilities.isRightMouseButton(evt) && !Platform.isAMac())
- {
- return;
- }
-
int x = (evt.getX() / av.getCharWidth()) + av.getStartRes();
final int res;
{
rightMouseButtonPressed(evt, res);
}
+ else if (SwingUtilities.isRightMouseButton(evt) && !Platform.isAMac())
+ {
+ /*
+ * defer right-mouse click handling to mouse up on Windows
+ * (where isPopupTrigger() will answer true)
+ * but accept Cmd-click on Mac which passes isRightMouseButton
+ */
+ return;
+ }
else
{
leftMouseButtonPressed(evt, res);
import jalview.util.Comparison;
import jalview.util.MappingUtils;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import jalview.viewmodel.AlignmentViewport;
import java.awt.BorderLayout;
return;
}
+ /*
+ * defer right-mouse click handling to mouseReleased on Windows
+ * (where isPopupTrigger() will answer true)
+ * NB isRightMouseButton is also true for Cmd-click on Mac
+ */
+ if (SwingUtilities.isRightMouseButton(evt) && !Platform.isAMac())
+ {
+ return;
+ }
+
if (av.cursorMode)
{
seqCanvas.cursorX = findRes(evt);
import javax.swing.JColorChooser;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
/**
{
return;
}
+
+ /*
+ * isPopupTrigger is set on mouseReleased /
+ * mouseClicked on Windows
+ */
if (evt.isPopupTrigger())
{
chooseSubtreeColour();
public void mousePressed(MouseEvent e)
{
av.setCurrentTree(tree);
- if (highlightNode != null && e.isPopupTrigger())
+
+ /*
+ * isPopupTrigger is set for mousePressed (Mac)
+ * or mouseReleased / mouseClicked (Windows)
+ */
+ if (e.isPopupTrigger())
+ {
+ if (highlightNode != null)
+ {
+ chooseSubtreeColour();
+ }
+ return;
+ }
+
+ /*
+ * defer right-click handling on Windows to
+ * mouseClicked; this also matches Cmd-click on Mac
+ * which should do nothing here
+ */
+ if (SwingUtilities.isRightMouseButton(e))
{
- chooseSubtreeColour();
return;
}