activeTask.cancel();
    public void mouseMoved(PInputEvent e)    {        PCamera camera = e.getCamera();        Point2D point = e.getCanvasPosition();        Rectangle2D totalBounds = camera.getBounds().getBounds2D();                // optimized (save)        if(!totalBounds.equals(cachedBounds))        {            recalculateBounds(totalBounds);        }                // do nothing if this is the case        if(invalidRegion)        {            return;        }                // stop panning or cancel the pan        if(excludeRegion.contains(point))        {            if(activated)            {                activationTimer.cancel();                activated = false;            }            return; // and bail        }                // time to assign/change panning parameters if necessary        double dX = 0;        double dY = 0;                // ok: max per second scroll = 20 pixels.  period.        if(nRegion.contains(point))        {            if(inverseIncrease)            {                dY = -20 * ((cachedBounds.getY() +                             edgeDistance -                             point.getY())                             /                             (double)edgeDistance);            }            else            {                dY = -advanceDistance;            }        }        else if(sRegion.contains(point))        {            if(inverseIncrease)            {                dY = 20 * ((point.getY() -                           (cachedBounds.getY()+cachedBounds.getHeight()-                            edgeDistance))                          /                          (double)edgeDistance);            }            else            {                dY = advanceDistance;            }        }                if(wRegion.contains(point))        {            if(inverseIncrease)            {                dY = -20 * ((cachedBounds.getX() +                             edgeDistance -                             point.getX())                             /                             (double)edgeDistance);            }            else            {                dX = -advanceDistance;            }        }        else if(eRegion.contains(point))        {            if(inverseIncrease)            {                dX = 20 * ((point.getX() -                           (cachedBounds.getX()+cachedBounds.getWidth()-                            edgeDistance))                          /                          (double)edgeDistance);            }            else            {                dX = advanceDistance;            }        }                System.err.println("incoming: "+dX+","+dY);        Point2D xForm = camera.localToView(new Point2D.Double(dX,dY));        dX = xForm.getX();        dY = xForm.getY();                if(!activated)        {            activationTimer = new Timer();            activeTask = new PanTask(camera,dX,dY);            activationTimer.scheduleAtFixedRate(activeTask,DEFAULT_WAITTIME,                                                advanceInterval);            activated = true;        }        else        {            activeTask.setDX(dX);            activeTask.setDY(dY);        }            }