public void changeLayout(){	
	  //Get the text input and check it for validity
	  double a, r;
	  int i;
	  String a_str = attractionInput.getText();
	  if (a_str.isEmpty()){
		  a = 0.75;
	  }else{
		  a = Double.parseDouble(a_str);
		  if (a==0){
			  a = 0.75;
		  }
	  }
	  
	  String r_str = repulsionInput.getText();
	  if (r_str.isEmpty()){
		  r = 0.75;
	  }else{
		  r = Double.parseDouble(r_str);
		  if (r==0){
			  r = 0.75;
		  }
	  }
	  
	  String i_str = numIterationsInput.getText();
	  if (i_str.isEmpty()){
		  i = 1000;
	  }else{
		  i = Integer.parseInt(i_str);
	  }
	
	 ArrayList<ArrayList<Edge>> edges2D = this.convertEdgeArray(this.graph.edges);
	 this.g.addElements(this.graph.nodes, edges2D);
	 this.g.createLayout(r,a,i,this.width,this.height-90);
	 this.graph.nodes = this.g.updateNodePositions(this.graph.nodes);
	 this.t = 0;
  }