From 09976d9f77b1a3a6486735b0fd9caeb158f1834f Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 15 Mar 2019 09:08:01 +0000 Subject: [PATCH] JAL-3071 corrections to IdPanel$ScrollThread --- src/jalview/gui/IdPanel.java | 6 +++--- src/jalview/gui/SeqPanel.java | 16 +--------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 46e5f14..5908810 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -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(); } /** diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 546838d..04ceea6 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -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(); } } -- 1.7.10.2