X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSeqPanel.java;h=3f740a1f36e82f23f7ba146f902c56edaa9b7305;hb=620da661f54acba8fdb13f388dbed8b77d9113ed;hp=e678738efb6edcf25904d662538ba4720c90751b;hpb=d0e1239635b38ef37d3cd35a6943dc0cd713d903;p=jalview.git diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index e678738..3f740a1 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -113,6 +113,11 @@ public class SeqPanel extends JPanel annotationIndex = ann; } + boolean isOverAnnotation() + { + return annotationIndex != -1; + } + @Override public boolean equals(Object obj) { @@ -889,7 +894,7 @@ public class SeqPanel extends JPanel } lastMousePosition = mousePos; - if (mousePos.annotationIndex != -1) + if (mousePos.isOverAnnotation()) { mouseMovedOverAnnotation(mousePos); return; @@ -1178,7 +1183,7 @@ public class SeqPanel extends JPanel public void mouseDragged(MouseEvent evt) { MousePos pos = findMousePosition(evt); - if (pos.annotationIndex != -1) + if (pos.isOverAnnotation()) { // mouse is over annotation row in wrapped mode return; @@ -1770,7 +1775,7 @@ public class SeqPanel extends JPanel { SequenceGroup sg = null; MousePos pos = findMousePosition(evt); - if (pos.annotationIndex != -1) + if (pos.isOverAnnotation()) { // mouse is over annotation label in wrapped mode return; @@ -1863,7 +1868,7 @@ public class SeqPanel extends JPanel */ protected void doMousePressedDefineMode(MouseEvent evt, MousePos pos) { - if (pos.annotationIndex != -1) + if (pos.isOverAnnotation()) { // JvOptionPane.showInternalMessageDialog(Desktop.desktop, // MessageManager.getString( @@ -2058,7 +2063,7 @@ public class SeqPanel extends JPanel public void doMouseDraggedDefineMode(MouseEvent evt) { MousePos pos = findMousePosition(evt); - if (pos.annotationIndex != -1) + if (pos.isOverAnnotation()) { // mouse is over annotation in wrapped mode return;