@Override
    public void mouseDragged(MouseEvent e) {
        drawMapComponent.getTimer().purge();
		drawMapComponent.getTimer().cancel();
		if (pressedKeyCode == 17) // press ctrl key
        {
            newPosition = e.getPoint();
            drawMapComponent.drawRectangle((int) oldPosition.getX(), (int) oldPosition.getY(), (int) newPosition.getX(), (int) newPosition.getY(), true);
        } else // just move
        {
            if (newPosition != null) {
                oldPosition = newPosition;
            }
            newPosition = e.getPoint();
            int x = (int) getDeltaPoint(oldPosition, newPosition).getX();
            int y = (int) getDeltaPoint(oldPosition, newPosition).getY();
            drawMapComponent.moveVisibleArea(x, y);
            //System.out.println(x + " " + y);
        }
        repaint();
    }