From: GiWoong Kim Date: Sat, 29 Jun 2013 13:09:39 +0000 (+0900) Subject: skin: cancel a scrollbar timer X-Git-Tag: 2.2.1_release~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b684259a739eb46eff65520adbae8f5d0d0e27c5;p=sdk%2Femulator%2Fqemu.git skin: cancel a scrollbar timer cancel a scrollbar timer Change-Id: I669425cdb2e3dc6eac47d6a6f9f5ece9cc27cabd Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java index 1478f9f672..93a1708129 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/custom/CustomScrollBar.java @@ -151,7 +151,7 @@ public class CustomScrollBar { this.dataThumb = new CustomScrollBarThumbData(); this.dataShaft = new CustomScrollBarShaftData(); - this.timerScroller = new Timer(); + this.timerScroller = null; createContents(); addScrollBarListener(); @@ -251,7 +251,7 @@ public class CustomScrollBar { public void mouseUp(MouseEvent e) { if (timerScroller != null) { timerScroller.cancel(); - timerScroller = new Timer(); + timerScroller = null; } } @@ -267,9 +267,12 @@ public class CustomScrollBar { logger.info("ArrowUp dragDetected : " + e.button); if (timerScroller != null) { - timerScroller.schedule(new ScrollerTask(false), - 1, ScrollerTask.SCROLLER_PERIOD_TIME); + timerScroller.cancel(); } + + timerScroller = new Timer(); + timerScroller.schedule(new ScrollerTask(false), + 1, ScrollerTask.SCROLLER_PERIOD_TIME); } }); @@ -283,7 +286,7 @@ public class CustomScrollBar { public void mouseUp(MouseEvent e) { if (timerScroller != null) { timerScroller.cancel(); - timerScroller = new Timer(); + timerScroller = null; } } @@ -299,9 +302,12 @@ public class CustomScrollBar { logger.info("ArrowDown dragDetected : " + e.button); if (timerScroller != null) { - timerScroller.schedule(new ScrollerTask(true), - 1, ScrollerTask.SCROLLER_PERIOD_TIME); + timerScroller.cancel(); } + + timerScroller = new Timer(); + timerScroller.schedule(new ScrollerTask(true), + 1, ScrollerTask.SCROLLER_PERIOD_TIME); } });