JAL-2778 Adjust cursor changes in overview panel
authorkiramt <k.mourao@dundee.ac.uk>
Wed, 21 Feb 2018 09:28:40 +0000 (09:28 +0000)
committerkiramt <k.mourao@dundee.ac.uk>
Wed, 21 Feb 2018 09:28:40 +0000 (09:28 +0000)
src/jalview/appletgui/OverviewPanel.java
src/jalview/gui/OverviewPanel.java

index 8ce597d..3bbbe95 100755 (executable)
@@ -155,6 +155,10 @@ public class OverviewPanel extends Panel implements Runnable,
       if (!od.isPositionInBox(evt.getX(), evt.getY()))
       { 
        draggingBox = false;
+
+        // display drag cursor at mouse position
+        setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
+
         od.updateViewportFromMouse(evt.getX(), evt.getY(),
                 av.getAlignment().getHiddenSequences(),
                 av.getAlignment().getHiddenColumns());
@@ -172,6 +176,7 @@ public class OverviewPanel extends Panel implements Runnable,
   @Override
   public void mouseReleased(MouseEvent evt)
   {
+    draggingBox = false;
   }
 
   @Override
index 28ad3c5..02d54a8 100755 (executable)
@@ -208,6 +208,10 @@ public class OverviewPanel extends JPanel
           if (!od.isPositionInBox(evt.getX(), evt.getY()))
           {
             draggingBox = false;
+
+            // display drag cursor at mouse position
+            setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
+
             od.updateViewportFromMouse(evt.getX(), evt.getY(),
                     av.getAlignment().getHiddenSequences(),
                     av.getAlignment().getHiddenColumns());
@@ -230,6 +234,13 @@ public class OverviewPanel extends JPanel
           showPopupMenu(evt);
         }
       }
+
+      @Override
+      public void mouseReleased(MouseEvent evt)
+      {
+        draggingBox = false;
+      }
+
     });
   }