public boolean deleteLoc(Point point){
    int curr=findIndex(point);
    //If not found, return false.
    if(curr==-1){
      return false; 
    }
    //found.
    //if curr,dirFrom,dirTo is equal to selectIndex, then set it to -1;if not, then do not change.
    if(curr==selectIndex){
      selectIndex=-1; 
    }
    if(curr==dirFrom){
      dirFrom=-1; 
    }
    if(curr==dirTo){
      dirTo=-1; 
    }
    //(1)delete it in locations[]
    for(int i=curr;i<current-1;i++){
      locations[i].setName(locations[i+1].getName());
      locations[i].setPoint(locations[i+1].getPoint());
      locations[i].setID(i);
    }
    //(2)delete all the paths
    for(int i=curr;i<current-1;i++){
      for(int j=0;j<current;j++){
        adjacent[i][j]=adjacent[i+1][j];
        adjacent[j][i]=adjacent[i][j];
        weight[i][j]=weight[i+1][j];
        weight[j][i]=weight[i][j];
      }
    }
    for(int j=0;j<current;j++){
      adjacent[current-1][j]=false;
      adjacent[j][current-1]=false;
      weight[current-1][j]=0;
      weight[j][current-1]=0;
    }
    current--;
    return true;
  }