From b684259a739eb46eff65520adbae8f5d0d0e27c5 Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Sat, 29 Jun 2013 22:09:39 +0900 Subject: [PATCH] skin: cancel a scrollbar timer cancel a scrollbar timer Change-Id: I669425cdb2e3dc6eac47d6a6f9f5ece9cc27cabd Signed-off-by: GiWoong Kim --- .../emulator/skin/custom/CustomScrollBar.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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); } }); -- 2.34.1