public void mouseReleased(MouseEvent e) {
		switch (e.getButton()) {
		case MouseEvent.BUTTON1:
			btn1Pressed = false;
			oldX = e.getX();
			oldY = e.getY();
			break;
		default:
			btn2Pressed = false;
			oldX = e.getX();
			oldY = e.getY();

			if (!dragged) {
				Dimension d = viewport.getSize();
				Point newPoint = new Point((int) (e.getX() - d.getWidth() / 2),
						(int) (e.getY() - d.getHeight() / 2));
				viewport.setViewPosition(newPoint);
			}
			dragged = false;
			break;
		}
	}