public void mousePressed(){	  
	  toggleButtons();
	 
	  if (this.editModeButton.toggle==1) {
		  if (this.saveButton.toggle == 1){ //In edit mode, save the current layout				  
			  this.save();
		  }
		  if (this.newLayoutButton.toggle ==1){ //In edit mode, create a new force directed layout
			  this.changeLayout();
		  }
		  return;
	  }
	  
	  timeSlider.selectTick(mouseX,mouseY);
	  if (!timeSlider.dragging){ //Avoid interference between selecting graph elements and slider tick
		 graph.selectElement(); //Select elements on the graph	     		    
	  } 
	  if (!graph.inGlobalView){
		  this.globalViewButton.toggle = 0;
	  }	  
	  
	 /** if (!this.globalViewButton.clicked){
		  if (graph.selectedNode==-1 && graph.selectedEdge==-1){			  
			  graph.clearQueries();				
		  }			 	 
	  }  */
	 //Check if queries should be cleared
	  if (this.onBorder()){		  
		  graph.clearQueries();
		  this.clickedBorder = true;
		  this.t = 0;
	  }
	  
	  //Check if glyphs should be aggregated
	  if (this.aggregateButton.toggle ==1){
		 graph.aggregate = 1;
       }else{
		 graph.aggregate = 0;
	   }
  }