JAL-3093 added MousePos.isOverAnnotation() for extra clarity of
[jalview.git] / src / jalview / gui / SeqPanel.java
index e678738..3f740a1 100644 (file)
@@ -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;