@Override
		public void mousePressed(MouseEvent evt) {
		int x = evt.getX();
		int y = evt.getY();
		if ((evt.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) {
			if (pd == PD.RightMouseB)  {
				Dimension d = getSize();

				jumpX = x;
				jumpY = y;
				// Draw distribution only inside the visible region
				if (jumpX > (0.75 * d.width))
					jumpX = (int) (0.75 * d.width);

				if (jumpY > (0.75 * d.height))
					jumpY = (int) (0.75 * d.height);

				repaint();
				return;// true;
			} else return;
		} else if ((evt.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) {

			float bestDist = Float.MAX_VALUE;
			NodeGNG n;
			float dist;

			for (int i = 0 ; i < nNodes ; i++) {
				n = nodes[i];
				dist = (n.x - x) * (n.x - x) + (n.y - y) * (n.y - y);
				if (dist <= bestDist) {
					pick = n;
					bestDist = dist;
				}
			}
			pickfixed = pick.isMouseSelected;
			pick.isMouseSelected = true;
			pick.x = x;
			pick.y = y;

			if (algo.isDiscrete())
				pick.hasMoved = true;

			nodesMovedB = true;
			repaint();
		}
	}