activated = false; repaint();
        public void cancelPan()        {            if(timer != null && activeTask != null)            {                activeTask.cancel();                timer.cancel();                activated = false;            }        }