JAL-3071 corrections to IdPanel$ScrollThread
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 15 Mar 2019 09:08:01 +0000 (09:08 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 15 Mar 2019 09:08:01 +0000 (09:08 +0000)
src/jalview/gui/IdPanel.java
src/jalview/gui/SeqPanel.java

index 46e5f14..5908810 100755 (executable)
@@ -273,6 +273,7 @@ public class IdPanel extends JPanel
     if (scrollThread != null)
     {
       scrollThread.stopScrolling();
+      scrollThread = null;
     }
   }
 
@@ -348,7 +349,7 @@ public class IdPanel extends JPanel
         {
           if (scrollThread == null)
           {
-            // finished and nulled itself
+            // IdPanel.stopScrolling called
             t.stop();
           }
         }
@@ -549,7 +550,7 @@ public class IdPanel extends JPanel
   {
     if (scrollThread != null)
     {
-      scrollThread.stopScrolling();
+      stopScrolling();
     }
     MousePos pos = alignPanel.getSeqPanel().findMousePosition(e);
 
@@ -618,7 +619,6 @@ public class IdPanel extends JPanel
     {
       this.up = up;
       setName("IdPanel$ScrollThread$" + String.valueOf(up));
-      start();
     }
 
     /**
index 546838d..04ceea6 100644 (file)
@@ -2418,20 +2418,6 @@ public class SeqPanel extends JPanel
          * Javascript - run every 20ms until scrolling stopped
          * or reaches the limit of scrollable alignment
          */
-        // java.util.Timer version:
-        // Timer t = new Timer("ScrollThreadTimer", true);
-        // TimerTask task = new TimerTask()
-        // {
-        // @Override
-        // public void run()
-        // {
-        // if (!scrollThread.scrollOnce())
-        // {
-        // cancel();
-        // }
-        // }
-        // };
-        // t.schedule(task, 20, 20);
         Timer t = new Timer(20, new ActionListener()
         {
           @Override
@@ -2451,7 +2437,7 @@ public class SeqPanel extends JPanel
           {
             if (scrollThread == null)
             {
-              // finished and nulled itself
+              // SeqPanel.stopScrolling called
               t.stop();
             }
           }