public void updateNodePosition(float x,float y){
    
    	 //First see which node is selected    	 
    	 int nodeId = -1;
    	 Node currentNode;
    	 for (int i = 0;i<this.nodes.size();i++){
     		currentNode = this.nodes.get(i);   
     		if (parent.dist(x, y, currentNode.x, currentNode.y)<=(currentNode.RADIUS/2)){
     			nodeId = currentNode.id;
     			break;
     		}            
     	 }   
    	 
    	 if (nodeId==-1) return;
    	 
    	 //Then, update the position in array of nodes
    	 this.nodes.get(nodeId).x = x;
    	 this.nodes.get(nodeId).y = y;    	 
     }