$
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user