|
@@ -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
|
|
|
@@ -54,20 +55,23 @@ public class Launch {
|
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;
|
|
67
|
+ final PathReader pathReader = new BinaryPathReader(
|
|
68
|
+ new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));
|
66
|
69
|
|
67
|
70
|
// TODO: Read the path.
|
68
|
|
- final Path path = null;
|
|
71
|
+ final Path path = pathReader.readPath(graph);
|
69
|
72
|
|
70
|
73
|
// TODO: Draw the path.
|
|
74
|
+ drawing.drawPath(path);
|
71
|
75
|
}
|
72
|
76
|
|
73
|
77
|
}
|