@Override
	public void mouseReleased(MouseEvent e) {
		if(graph != null ) {
			dragging = false;
			draggedNode = null;
			if(dToolsPointer.currentOperation() != dToolsPointer.ADD_NODE || 
					dToolsPointer.currentOperation() == dToolsPointer.RM_NODE) {
				double touchX = e.getX();
				double touchY = e.getY();
				GraphNode node = getTouchedNode(touchX, touchY);
				if(node != null && node != fromNode && fromNode != null) {
					if(dToolsPointer.currentOperation() == dToolsPointer.ADD_EDGE)
						drawEdge(node);
					else if(dToolsPointer.currentOperation() == dToolsPointer.RM_EDGE)
						eraseAndRemoveEdge(graph.getEdge(fromNode.id(), node.id()));
				}
				else { // if the user didn't drag to any node
					fromNode = null;
					node = null;
				}
			}
		}
	}