Favary Pierre 3 years ago
parent
commit
c3d9577472

+ 7
- 3
be-graphes-gui/src/main/java/org/insa/graphs/gui/simple/Launch.java View File

14
 import org.insa.graphs.model.Graph;
14
 import org.insa.graphs.model.Graph;
15
 import org.insa.graphs.model.Path;
15
 import org.insa.graphs.model.Path;
16
 import org.insa.graphs.model.io.BinaryGraphReader;
16
 import org.insa.graphs.model.io.BinaryGraphReader;
17
+import org.insa.graphs.model.io.BinaryPathReader;
17
 import org.insa.graphs.model.io.GraphReader;
18
 import org.insa.graphs.model.io.GraphReader;
18
 import org.insa.graphs.model.io.PathReader;
19
 import org.insa.graphs.model.io.PathReader;
19
 
20
 
54
                 new DataInputStream(new BufferedInputStream(new FileInputStream(mapName))));
55
                 new DataInputStream(new BufferedInputStream(new FileInputStream(mapName))));
55
 
56
 
56
         // TODO: Read the graph.
57
         // TODO: Read the graph.
57
-        final Graph graph = null;
58
+        final Graph graph = reader.read();
58
 
59
 
59
         // Create the drawing:
60
         // Create the drawing:
60
         final Drawing drawing = createDrawing();
61
         final Drawing drawing = createDrawing();
61
 
62
 
62
         // TODO: Draw the graph on the drawing.
63
         // TODO: Draw the graph on the drawing.
64
+        drawing.drawGraph(graph);
63
 
65
 
64
         // TODO: Create a PathReader.
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
         // TODO: Read the path.
70
         // TODO: Read the path.
68
-        final Path path = null;
71
+        final Path path = pathReader.readPath(graph);
69
 
72
 
70
         // TODO: Draw the path.
73
         // TODO: Draw the path.
74
+        drawing.drawPath(path);
71
     }
75
     }
72
 
76
 
73
 }
77
 }

Loading…
Cancel
Save