This commit is contained in:
pro.boooooo
2023-01-05 05:56:05 +01:00
parent 99610d9975
commit e6e8925fd2
16 changed files with 219 additions and 284 deletions

View File

@@ -2,31 +2,37 @@ package Graphics;
import java.io.InputStream;
import java.io.IOException;
import java.util.HashMap;
import javax.swing.JPanel;
import java.awt.GridLayout;
import java.net.URL;
/**
* [Romain]
* Pour gerer l'affichage graphique du code JSON
*/
public class GraphicFile extends JPanel {
/**
* @param url Le chemin vers le fichier JSON
*/
public GraphicFile(URL url) {
super();
try {
System.out.println("[+] Lecture de " + url);
this.setLayout(new GridLayout(100, 1));
InputStream jsonReader = url.openStream();
// ICI le code
/**
* C'est ici que le hashmap est stocke
*/
Traitable fileTraited = new Traitable(jsonReader);
HashMap<String, Object> allVariables = fileTraited.getVariableMap();
jsonReader.close();
} catch (IOException e) {
System.out.println("[!] Fichier " + url.getFile() + " n'existe pas");
}
}
public void addIndentation(StringBuilder sb, int indentLevel) {
for (int i = 0; i < indentLevel; i++) {
sb.append("\t");
}
}
}