diff --git a/be-graphes-gui/src/main/java/org/insa/graphs/gui/simple/Launch.java b/be-graphes-gui/src/main/java/org/insa/graphs/gui/simple/Launch.java index 7be58b3..dc447da 100644 --- a/be-graphes-gui/src/main/java/org/insa/graphs/gui/simple/Launch.java +++ b/be-graphes-gui/src/main/java/org/insa/graphs/gui/simple/Launch.java @@ -1,7 +1,9 @@ package org.insa.graphs.gui.simple; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; +import java.awt.color.*; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.FileInputStream; @@ -14,6 +16,7 @@ import org.insa.graphs.gui.drawing.components.BasicDrawing; import org.insa.graphs.model.Graph; import org.insa.graphs.model.Path; import org.insa.graphs.model.io.BinaryGraphReader; +import org.insa.graphs.model.io.BinaryPathReader; import org.insa.graphs.model.io.GraphReader; import org.insa.graphs.model.io.PathReader; @@ -46,28 +49,32 @@ public class Launch { public static void main(String[] args) throws Exception { // Visit these directory to see the list of available files on Commetud. - final String mapName = "/home/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Maps/insa.mapgr"; - final String pathName = "/home/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Paths/path_fr31insa_rangueil_r2.path"; + final String mapName = "/mnt/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Maps/insa.mapgr"; + final String pathName = "/mnt/commetud/3eme Annee MIC/Graphes-et-Algorithmes/Paths/path_fr31insa_rangueil_r2.path"; // Create a graph reader. final GraphReader reader = new BinaryGraphReader( new DataInputStream(new BufferedInputStream(new FileInputStream(mapName)))); // TODO: Read the graph. - final Graph graph = null; + final Graph graph = reader.read(); // Create the drawing: final Drawing drawing = createDrawing(); // TODO: Draw the graph on the drawing. + drawing.drawGraph(graph); // TODO: Create a PathReader. - final PathReader pathReader = null; + final PathReader pathReader = new BinaryPathReader(new DataInputStream(new BufferedInputStream(new FileInputStream(pathName))));; // TODO: Read the path. - final Path path = null; + final Path path = pathReader.readPath(graph); + // TODO: Draw the path. + drawing.drawPath(path,Color.green); + } } diff --git a/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch$1.class b/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch$1.class index ec3f973..4fdcf7d 100644 Binary files a/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch$1.class and b/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch$1.class differ diff --git a/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch.class b/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch.class index e633107..6e8b432 100644 Binary files a/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch.class and b/be-graphes-gui/target/classes/org/insa/graphs/gui/simple/Launch.class differ