|
@@ -14,6 +14,7 @@ import org.insa.graphs.gui.drawing.components.BasicDrawing;
|
14
|
14
|
import org.insa.graphs.model.Graph;
|
15
|
15
|
import org.insa.graphs.model.Path;
|
16
|
16
|
import org.insa.graphs.model.io.BinaryGraphReader;
|
|
17
|
+import org.insa.graphs.model.io.BinaryPathReader;
|
17
|
18
|
import org.insa.graphs.model.io.GraphReader;
|
18
|
19
|
import org.insa.graphs.model.io.PathReader;
|
19
|
20
|
|
|
@@ -46,28 +47,31 @@ public class Launch {
|
46
|
47
|
public static void main(String[] args) throws Exception {
|
47
|
48
|
|
48
|
49
|
// Visit these directory to see the list of available files on Commetud.
|
49
|
|
- final String mapName = "/home/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Maps/insa.mapgr";
|
50
|
|
- final String pathName = "/home/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Paths/path_fr31insa_rangueil_r2.path";
|
|
50
|
+ final String mapName = "C:/Users/guill/OneDrive/Bureau/Graphes/GraphesGit/Cartes/insa.mapgr";
|
|
51
|
+ final String pathName = "C:/Users/guill/OneDrive/Bureau/Graphes/GraphesGit/Cartes/paths/path_fr31insa_rangueil_r2.path";
|
51
|
52
|
|
52
|
53
|
// Create a graph reader.
|
53
|
54
|
final GraphReader reader = new BinaryGraphReader(
|
54
|
55
|
new DataInputStream(new BufferedInputStream(new FileInputStream(mapName))));
|
55
|
56
|
|
56
|
57
|
// TODO: Read the graph.
|
57
|
|
- final Graph graph = null;
|
|
58
|
+ final Graph graph = reader.read();
|
58
|
59
|
|
59
|
60
|
// Create the drawing:
|
60
|
61
|
final Drawing drawing = createDrawing();
|
61
|
62
|
|
62
|
63
|
// TODO: Draw the graph on the drawing.
|
|
64
|
+ drawing.drawGraph(graph);
|
63
|
65
|
|
64
|
66
|
// TODO: Create a PathReader.
|
65
|
|
- final PathReader pathReader = null;
|
66
|
|
-
|
|
67
|
+ final PathReader pathReader = new BinaryPathReader(
|
|
68
|
+ new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
|
|
69
|
+
|
67
|
70
|
// TODO: Read the path.
|
68
|
|
- final Path path = null;
|
69
|
|
-
|
|
71
|
+ final Path path = pathReader.readPath(graph);
|
|
72
|
+
|
70
|
73
|
// TODO: Draw the path.
|
|
74
|
+ drawing.drawPath(path);
|
71
|
75
|
}
|
72
|
76
|
|
73
|
77
|
}
|