public MetroMap(PApplet p) throws DAOException {
    app = p;
    factory = DAOFactory.getInstance();
    daoStation = factory.getDaoStation();
    daoLine = factory.getDaoLine();
    daoMetroGraph = factory.getDaoMetroGraph();

    stations = new ArrayList<Station>();

    // 1. Récupérér depuis la base de données les information sur des stations.
    // Remplir la liste 'stations' avec toutes les stations, SANS INITIALISER des listes d'Edge
    // List<Line> lines = daoLine.getAllLines();
    List<Line> lines = daoLine.getAllLines();
    for (Line line : lines) {
      String lineColor = line.getColor();
      List<Station> stationsOfLine = daoStation.getStationsByLineId(line.getId());
      for (Station stationOfLine : stationsOfLine) {

        // couleur courante peut être changé ensuite, quand on va dessiner le chemin le plus court
        stationOfLine.setCurrentDrawColor(lineColor);
        stations.add(stationOfLine);
      }
    }

    // Pour chaque VERTEX dans le graph initialiser des listes d'Edge
    for (Station currentStation : stations) {
      List<Edge> neighborEdges = currentStation.getNeighborEdges();
      List<Edge> transferEdges = currentStation.getTransferEdges();

      // 2. Parcourir toutes les STATIONS VOISINES. Le poids de Edge = distance entre les stations.
      List<Station> neighbors = daoMetroGraph.getNeighbors(currentStation.getId());
      for (Station neighbor : neighbors) {
        Station targetVertex = stations.get(neighbor.getId() - 1);
        Edge newEdge =
            new Edge(targetVertex, Geometry.getDistanceBetweenTwoStations(currentStation, neighbor));
        neighborEdges.add(newEdge);
      }

      // 3. Parcourir toutes les CORRESPONDANCES. Le poids entre les correspondances = distance
      // entre les stations.
      List<Station> transfers = daoMetroGraph.getTransferStations(currentStation.getId());
      for (Station transfer : transfers) {
        Station targetVertex = stations.get(transfer.getId() - 1);
        Edge newEdge =
            new Edge(targetVertex, Geometry.getDistanceBetweenTwoStations(currentStation, transfer));
        transferEdges.add(newEdge);
      }

      // 4. Sauvegarder les Edges
      currentStation.setNeighborsEdges(neighborEdges);
      currentStation.setTransferEdges(transferEdges);
    }
  }