@Override
		public void mouseReleased(MouseEvent ev) {
			if (ev.getButton() == MouseEvent.BUTTON1 && !wasMenuShowing) {
				if (graph.isNodeSelected() && computation != null) {
					int x = ev.getX();
					int y = ev.getY();
					boolean wasStarted = false;
					if (!computation.isDone()) {
						computation.cancel(true);
						wasStarted = true;
					}
					
					if(graph.getAddSelected()){
						graph.addThisToSelected(x, y);
						graph.setAddSelected(false);
						panel.repaint();
					}else{
						graph.moveSelectedNode(x, y);
					}
					
					
					if (wasStarted) {
						startGraphComputations();
					}
					graph.deselectNode();
				}
			}else if(ev.getButton() == MouseEvent.BUTTON3) {
				maybeShowPopup(ev);
				wasMenuShowing = true;
			}
		}