public void findPrintDirection(Graphics2D g){
    if((dirFrom==-1)||(dirTo==-1)){
      return;
    }
    if(dirFrom>=current || dirTo>=current){
      return; 
    }
    Path p = shortestPath(dirFrom);
    if(p.distance[dirTo]==MaxDistance){
      return; 
    }
    
    int u=dirTo;
    int newu;
    do {
      newu = p.path[u];
      g.setColor(Color.BLUE);
      g.setStroke(new BasicStroke(2, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
      g.drawLine((int)locations[u].getPoint().getX(),(int)locations[u].getPoint().getY(),
                 (int)locations[newu].getPoint().getX(),(int)locations[newu].getPoint().getY());
      u=newu;
    } while (u != dirFrom);
  }