public void draw(Graphics2D g) {
    // Draw the map image
    g.drawImage(_image, 0, 0, null);   
    //Draw the locations
    for(int i=0;i<mygraph.getCurr();i++){
      mygraph.locations[i].draw(g); 
    }
    // Draw the line
    for(int i=0;i<mygraph.getCurr();i++){
      for(int j=i+1;j<mygraph.getCurr();j++){
        if(mygraph.adjacent[i][j]){
          g.setColor(Color.YELLOW);
          g.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
          g.drawLine((int)mygraph.locations[i].getPoint().getX(),(int)mygraph.locations[i].getPoint().getY(),
                     (int)mygraph.locations[j].getPoint().getX(),(int)mygraph.locations[j].getPoint().getY());
        }
      }
    }
    //Draw the selected location
    int index=mygraph.getSelectIndex();
    if((index!=-1) && (index<mygraph.getCurr())){
      mygraph.locations[index]. drawArrow(g);
    }
    //print the direction
    if(mode==DIRECTIONS){
      mygraph.findPrintDirection(g);
    }
  }