From e6e8925fd27eede2c727242c5dc1bdceb8e1f220 Mon Sep 17 00:00:00 2001 From: "pro.boooooo" Date: Thu, 5 Jan 2023 05:56:05 +0100 Subject: [PATCH] $ --- Makefile | 6 +- build/Console/DisplayConsole.class | Bin 2217 -> 2217 bytes build/Core.class | Bin 1296 -> 841 bytes build/Graphics/GraphicFile.class | Bin 1551 -> 1448 bytes build/Graphics/GraphicsCore.class | Bin 5284 -> 5153 bytes build/Graphics/ListNodes.class | Bin 3601 -> 0 bytes build/Graphics/Node.class | Bin 4212 -> 0 bytes build/Graphics/Traitable.class | Bin 0 -> 2602 bytes src/Console/DisplayConsole.java | 5 + src/Core.java | 7 +- src/Graphics/GraphicFile.java | 22 ++-- src/Graphics/GraphicsCore.java | 34 +++++++ src/Graphics/ListNodes.java | 128 ----------------------- src/Graphics/Node.java | 143 -------------------------- src/Graphics/Traitable.java | 156 +++++++++++++++++++++++++++++ toFormat.json | 2 +- 16 files changed, 219 insertions(+), 284 deletions(-) delete mode 100644 build/Graphics/ListNodes.class delete mode 100644 build/Graphics/Node.class create mode 100644 build/Graphics/Traitable.class delete mode 100644 src/Graphics/ListNodes.java delete mode 100644 src/Graphics/Node.java create mode 100644 src/Graphics/Traitable.java diff --git a/Makefile b/Makefile index 11e1d06..6719aa1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ JAVA = java JAVAC = javac JAVADOC = javadoc -OPTIONSDOCS = -d docs +OPTIONSDOCS = -d docs -noqualifier all OPTIONS = -d build -Xlint:unchecked -Xlint:deprecation EXT = .java @@ -17,8 +17,8 @@ ConsolePACKAGE = Console/ # POUR ALLER PLUS VITE (Core, package:Console, ) ALL = $(SRC)*$(EXT) $(SRC)$(ConsolePACKAGE)*$(EXT) $(SRC)$(GraphicsPACKAGE)*$(EXT) -# LE FICHIER JSON -JSON = toFormat.json +# LE FICHIER JSON (Pour mon test) +JSON = /home/bilal-linux/toFormat.json .PHONY: console graphics clean docs diff --git a/build/Console/DisplayConsole.class b/build/Console/DisplayConsole.class index 561333cefc76bb8d172b68807c39a6887ddc986c..01f7aa518dceb141b5518c4cb1ed48acff229074 100644 GIT binary patch delta 243 zcmWNGyGuf007uUcl50UeGK)|YsU#~Y$^@$mrahJ(P?U)cElH2NSP^bgYgcVT3bAsWL{5ajr;m%@j9G(;!8Q8SY4P&m2$8^Nh_4SzcM-jYZyB;)7*A zS>c;iepus|b^h28Y|5HtOI_^9OF@0?YJj4mloV%A3HCL~fzp(f;ZQb5%5khbC)&oT Ue_0pZ6)aBiP@$Ley5qM00X6$87ytkO delta 243 zcmWNMyGw#`07cIQP4LzWshc&bmy_PQ;f^ZXC+Y%HU1V@{M zpiS@(2-;fO+M=Z`X!5rlxEIca+x2(-y_z%V!NCY_yo}*v)^L%)OT*bxHH3=^Q-ldH zNsuTJrkEy1+|Xu*J0ny~s*>P=B#+GV!~#t-(k4ZRC7wz1$})Xc7_i10S>DO>L4i+- zd{N?u4Sw0=k1hV$7VOB%uqzLH8f9N04ix54F^&}HSaX~x#i`PqX_a&3xKN2pt#hR^ V*Y$7f-fLrVV?No8b6dAvxgoHDDf<8b diff --git a/build/Core.class b/build/Core.class index aad6669c4d0898064ffa21c6fcf83b6fc0c2eb78..06e49f44861c1b74270092cb6828e5982847d831 100644 GIT binary patch delta 424 zcmYL_OG`pQ7>1uYUPi~0rQI)f&-7%Oc86M3tAc11E={D8uqcUk{e{F$v})(t777V& zqkckvC5XP$rWyDy?>F<#!#tV~|KaD)TL;)+%h1D!W>hm~@DOvuxM6}xgT<6)I>-#O zhB@Mzc|(Yi013BGY8=f%_4w8kAzFP;?ASy|*(|c8N!u)wah0s1x0Jujr!Vv6v-JLb zp?F=nxGHN_Y*ty*tlL7eSvydBu?FBgnEL3XW>g$0ix`o+Y7E0`+ z5__eKNmi15P7BqLLeVGD|0f!P^fMr}d-O?EOY*+c@xG93W98a-a*ik4!rR2x#NR@n z)QKOy5?p9v>Wn&_XTt4sLb(>U%tA7Xb~On%#MRHZfCa?Webd26v_%bz9{EF_7U-n= cKLVT)if!T9V^B82=FMvYrdx~EkO&sTzn8E(;Q#;t literal 1296 zcmaJ>TTc@~7(G);hc3%qMMV(gR*H7T8w!YGrCcm(ENTexVJM?4Yuu_YW&_+OlY4qX4sxN&SKXi?l)5akNrDyYq%D08lHPG(gg zGse$GE7~YbR{5dwr1R1Z%bwV-m<;xDa925zWAh88bf^PSUXXfCt%gkrjMU+tjr(|D zVm-9+2%{X2Z9Ku4LB<){PAi=LT9jq&DxYJ*##2mkJhSl}Qw*19DD0YB44spOsghxE zx#v^&d+mB|D2(S=cg9%{m7h~VNoXyD?uoL{Ym+9-!(+vaSMzDkH!JJ1s4cuembNn) zhcUF5#D=6Ui$Z^N^_uBd3txu}1E~uHt%j)Hi-@Frtyb^f%~1uZp~%gb+98C5h}5ju z6=uGQnI~pTC3wWmA0O$NmI~XUmL<9*YEx4sQ64&_w{-rRZh;h~f4ZNC8F<-{Ji0vR zI*3%FL>w>8an3UIooeX%TWUjAE?A^nP878YwmIhM*5;Mk*ep|rbG|QwtS7=yl9=Dl zYE+34-JDtBuX-}F)K2#wJ^pFWEJMCK5& zr9;##rEBgTAP(%Kb`Oa?@O{*M+`&Np7p&nu)bF4pee@lThp?CS(Lh`EwA0$Sho)VM zoIo!IC{OG-ZyFY5;Dja#w`s@1AnK8!^#~g1;WlE5TA8C3t`ake_-Br!)x_yLc8!1- Xu49H~i$YHmEk|e<*>z;!q<{BczfVJB diff --git a/build/Graphics/GraphicFile.class b/build/Graphics/GraphicFile.class index 25828c7d5acdeb984c920918045e1381d12b8e7d..b78811e117ed2945b3fb83421ff9ff489c85a0da 100644 GIT binary patch delta 551 zcmW-ePj3=o5XOJ+vUOqE0xrekKTs$Ng%+hs75`MLwNOi2wZ(W`D-ld11Xg3bc=KwS z{ScaX(pXGtV(-0r_vQ!i3s{G~lRT4oW}cZhGasx^!HxZYyFY1x7Vtww7s7y*~}PRvbaoH z5t;9F+`ij$y7i{p>OAX*k1*@!ip5nb2G=aEbH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=JUSR1WYt?Zd2) z?>9lxVOo!{;K`u}tRh%-zQ{;&sEm%KJ^3_O{Jz9~e1*gKn&(IHBC(_jrA{SwgFGm+ ks1EpTAmQT#IKjOTUV_JGj9w0I!bJyWxsGx@$N%}i0XHUze*gdg literal 0 HcmV?d00001 diff --git a/src/Console/DisplayConsole.java b/src/Console/DisplayConsole.java index f8873c3..01d9d74 100644 --- a/src/Console/DisplayConsole.java +++ b/src/Console/DisplayConsole.java @@ -4,6 +4,11 @@ import java.net.URL; import java.io.InputStream; import java.io.IOException; +/** + * [Bilal] + * Afficher le code JSON dans la console une fois formatter + */ + public class DisplayConsole { private URL jsonFile; diff --git a/src/Core.java b/src/Core.java index d3c163b..76358f9 100644 --- a/src/Core.java +++ b/src/Core.java @@ -2,11 +2,16 @@ import java.io.File; import Console.DisplayConsole; import Graphics.GraphicsCore; +/** + * [Bilal et Romain] + * Programme pour afficher un code json dans le teminal ou sur une JFrame (avec + * les options tel que: la coloration syntaxique, repli de tableau etc...) + */ public class Core { public static void main(String[] args) { if (args.length == 1) { try { - new DisplayConsole(new File("../" + args[0]).toURI().toURL()); + new DisplayConsole(new File(args[0]).toURI().toURL()); } catch (Exception e) { System.out.println(e); } diff --git a/src/Graphics/GraphicFile.java b/src/Graphics/GraphicFile.java index f358e2e..d41d00a 100644 --- a/src/Graphics/GraphicFile.java +++ b/src/Graphics/GraphicFile.java @@ -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 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"); - } - } } diff --git a/src/Graphics/GraphicsCore.java b/src/Graphics/GraphicsCore.java index c9b06b1..e6af82d 100644 --- a/src/Graphics/GraphicsCore.java +++ b/src/Graphics/GraphicsCore.java @@ -19,6 +19,12 @@ import java.awt.BorderLayout; import javax.swing.filechooser.FileSystemView; import javax.swing.filechooser.FileNameExtensionFilter; +/** + * [Romain] + * Faire le pont entre la selection du fichier JSON et l'affichage + * graphique du code JSON + */ + public class GraphicsCore extends JFrame { private final Dimension DEFAULT_FRAME_SIZE; private final Dimension MINIMUM_FRAME_SIZE; @@ -42,6 +48,9 @@ public class GraphicsCore extends JFrame { this.setVisible(true); } + /** + * Initalisation des parametres de la Frame par defaut. + */ private void init() { this.setSize(DEFAULT_FRAME_SIZE); this.setDefaultCloseOperation(EXIT_ON_CLOSE); @@ -51,6 +60,11 @@ public class GraphicsCore extends JFrame { cards.first(this.getContentPane()); } + /** + * Creation de la fenetre ou l'on nous demande de chemin absolut du fichier JSON + * + * @return Le JPanel de la premiere card du CardLayout + */ private JPanel firstCard() { GridBagLayout layout = new GridBagLayout(); GridBagConstraints gbc = new GridBagConstraints(); @@ -83,6 +97,12 @@ public class GraphicsCore extends JFrame { return panel; } + /** + * Creation de la fenetre ou sera afficher le code du fichier JSON + * + * @return Le JPanel contenant le rendu de Traitable + * @see Graphics.Traitable + */ private JPanel secondCard() { GraphicFile file = new GraphicFile(this.url); @@ -104,6 +124,11 @@ public class GraphicsCore extends JFrame { return mainPanel; } + /** + * Permet de la fenetre ou l'on nous demande de chemin absolut du fichier JSON + * + * @param field Le chemin absolue du fichier JSON + */ private void validationAction(String field) { try { this.url = new File(field).toURI().toURL(); @@ -114,11 +139,20 @@ public class GraphicsCore extends JFrame { } } + /** + * Retourner dans la selection du fichier JSON + * + * @param panel Le JPanel ou l'on demande a l'utilisateur de choisir le fichier + * JSON + */ private void backAction(JPanel panel) { this.remove(panel); cards.first(this.getContentPane()); } + /** + * Selection du fichier JSON + */ public void getPathOf() { JFileChooser jc = new JFileChooser(FileSystemView.getFileSystemView().getHomeDirectory()); diff --git a/src/Graphics/ListNodes.java b/src/Graphics/ListNodes.java deleted file mode 100644 index 1d1cb3b..0000000 --- a/src/Graphics/ListNodes.java +++ /dev/null @@ -1,128 +0,0 @@ -package Graphics; - -import java.util.ArrayList; -import java.util.Objects; - -public class ListNodes { - private Node begin; - - public ListNodes() { - this.begin = null; - } - - public void add(String name, String value) { - try { - if (this.begin == null) { - this.begin = new Node(name, value); - this.begin.addNext(new Node(name, value)); - } else { - Node cpy = this.begin; - - while (cpy.getNext() != null) { - cpy = cpy.getNext(); - } - - cpy.addNext(new Node(name, value)); - - System.out.println( - "[+] Noeud " + - cpy.getName() + " -> " + cpy.getValue().toString() + " ajouté ! " + - "(" + cpy.detectType(cpy.getValue().toString()) + ")"); - } - } catch (NullPointerException ignore) { - } - } - - public void addChild(String name, ArrayList an) { - try { - ArrayList finalList = new ArrayList<>(); - - for (int i = 0; i <= an.size() - 1; i++) { - finalList.add(new Node(null, an.get(i))); - } - - if (this.begin == null) { - this.begin = new Node(name, finalList); - this.begin.addNextChild(new Node(name, finalList)); - } else { - getBegin(name, finalList); - int i = 0; - - for (; i <= an.size() - 1; i++) { - System.out.print(an.get(i) + ", "); - } - - System.out.println("} (taille: " + i + ")"); - } - - } catch (NullPointerException ignore) { - } - } - - private void getBegin(String name, ArrayList finalList) { - Node cpy = this.begin; - - while (cpy.getNext() != null) { - cpy = cpy.getNext(); - } - - cpy.addNextChild(new Node(name, finalList)); - - System.out.print("[+] Noeud " + name + " -> { "); - } - - public void addChild(String name, ArrayList names, ArrayList values) { - try { - ArrayList finalList = new ArrayList<>(); - - for (int i = 0; i <= names.size() - 1; i++) { - finalList.add(new Node(names.get(i), values.get(i))); - } - - if (this.begin == null) { - this.begin = new Node(name, finalList); - this.begin.addNextChild(new Node(name, finalList)); - } else { - getBegin(name, finalList); - int i = 0; - - for (; i <= values.size() - 1; i++) { - System.out.print(names.get(i) + ": " + values.get(i) + ", "); - } - - System.out.println("} (taille: " + i + ")"); - } - - } catch (NullPointerException ignore) { - } - } - - public void displayNodes() { - Node cpy = this.begin; - - while (cpy.getNext() != null) { - cpy = cpy.getNext(); - if (!Objects.equals(cpy.getName().length(), 0)) { - System.out.println(cpy.toString()); - } - } - } - - public boolean isExist(String name) { - Node cpy = this.begin; - - while (cpy.getNext() != null) { - cpy = cpy.getNext(); - - if (Objects.equals(name, cpy.getName())) { - return true; - } - } - - return false; - } - - public boolean isEmpty() { - return this.begin == null || this.begin.getNext() == null; - } -} diff --git a/src/Graphics/Node.java b/src/Graphics/Node.java deleted file mode 100644 index 4692f2b..0000000 --- a/src/Graphics/Node.java +++ /dev/null @@ -1,143 +0,0 @@ -package Graphics; - -import java.util.ArrayList; - -public class Node { - private Node next; - private final String name; - private Object value; - private final ArrayList childs; - - public Node() { - this.name = null; - this.next = null; - this.value = null; - this.childs = new ArrayList<>(); - } - - public Node(String name, ArrayList childs) { - this.name = name; - this.value = null; - this.next = null; - this.childs = childs; - } - - public Node(String name, String value) { - this.name = name; - this.value = value; - this.next = null; - this.childs = null; - } - - public void addNext(Node node) { - try { - switch (this.detectType((String) node.getValue())) { - case "int": { - node.setValue(Integer.valueOf(node.getValue().toString())); - break; - } - - case "boolean": { - node.setValue(Boolean.valueOf(node.getValue().toString())); - break; - } - - case "float": { - node.setValue(Float.valueOf(node.getValue().toString())); - break; - } - - case "char": { - node.setValue(node.getValue().toString().charAt(0)); - break; - } - - default: { - node.setValue(node.getValue().toString()); - break; - } - } - - this.next = node; - } catch (Exception e) { - System.err.println(e); - System.err.println("[!] Probleme lors de l'ajout du noeud : " + this.name + " vers " + node.getName()); - } - } - - public void addNextChild(Node node) { - try { - this.next = node; - } catch (Exception e) { - System.err.println(e); - System.err.println("[!] Probleme lors de l'ajout du noeud : " + this.name + " vers " + node.getName()); - } - } - - public boolean haveChild() { - return this.childs == null; - } - - public String detectType(String str) { - if (str == null) { - return "null"; - } - - if (str.matches("[0-9]+")) { - return "int"; - } else if (str.length() == 1) { - return "char"; - } else if (str.equals("true") || str.equals("false")) { - return "boolean"; - } else if (str.matches("[0-9]+\\.[0-9]+")) { - return "float"; - } else if (str.matches("[a-zA-Z]+")) { - return "string"; - } else if (str.matches("[a-zA-Z0-9]+")) { - return "hexadecimal"; - } else { - return "string"; - } - } - - public String getName() { - return this.name; - } - - public Object getValue() { - return this.value; - } - - public Node getNext() { - return this.next; - } - - public ArrayList getChilds() { - return this.childs; - } - - public void setValue(Object toSet) { - this.value = toSet; - } - - @Override - public String toString() { - if (this.childs == null) { - return "Node: " + this.name + " => " + this.value; - } else { - StringBuilder toReturn = new StringBuilder("Node: " + this.name + " => { "); - for (int i = 0; i <= this.childs.size() - 1; i++) { - if (this.childs.get(i).getName() != null) { - toReturn.append(this.childs.get(i).getName()).append(": ").append(this.childs.get(i).getValue()) - .append(", "); - } else { - toReturn.append(this.childs.get(i).getValue()).append(", "); - } - } - - toReturn.append("} "); - - return toReturn.toString(); - } - } -} diff --git a/src/Graphics/Traitable.java b/src/Graphics/Traitable.java new file mode 100644 index 0000000..76c9aeb --- /dev/null +++ b/src/Graphics/Traitable.java @@ -0,0 +1,156 @@ +package Graphics; + +import java.util.HashMap; +import java.io.IOException; +import java.io.InputStream; + +/** + * [Bilal] + * Classe qui sert a stocke les valeurs contenue dans le JSON dans une liste. + */ + +public class Traitable { + private final HashMap content; + private final InputStream file; + + public Traitable(InputStream file) { + this.content = new HashMap<>(); + this.file = file; + this.Run(); + } + + /** + * Lancement automatique une fois que Traitable est instantie + * + * @see Graphics.GraphicFile + */ + private void Run() { + System.out.println("[+] Preparation..."); + + try { + try { + StringBuilder allJson = new StringBuilder(); + StringBuilder tmp = new StringBuilder(); + int i = 0; + + for (int cursor = this.file.read(); cursor != -1; cursor = this.file.read()) { + char c = (char) cursor; + allJson.append(c); + } + + while (i < allJson.length()) { + if (allJson.charAt(i) == '"') { + while (allJson.charAt(i) != ',') { + tmp.append(allJson.charAt(i)); + i++; + } + + // System.out.println(this.getNomOfRecord(tmp)); + tmp.setLength(0); + } + + i++; + } + } catch (StringIndexOutOfBoundsException ignore) { + } + + } catch (IOException e) { + System.out.println("[!] Probleme lors de la lecture du fichier"); + } + } + + private String getNomOfRecord(StringBuilder sb) { + int i = 0; + StringBuilder name = new StringBuilder(); + + while (i < sb.length()) { + if (sb.charAt(i) == ':') { + return name.toString().replaceAll("\"", ""); + } + + name.append(sb.charAt(i)); + + i++; + } + + return null; + } + + // TODO: a finir (Bilal) + private Object getValueOfRecord(StringBuilder sb) { + // int i; + // int counter; + // StringBuilder value = new StringBuilder(); + // String type = ""; + + // /** + // * Tableau + // */ + // if (sb.indexOf("[") != -1) { + // type = "tableau"; + // } + + // /** + // * Chaine de characteres + // */ + // for (i = 0, counter = 0; i <= sb.length() - 1; i++) { + // if (sb.charAt(i) == '"') { + // counter++; + // } + // } + + // if (counter < 2 && sb.indexOf(".") != -1) { + // type = "float"; + // } + + // /* + // * Objet + // */ + // if (sb.indexOf("{") != -1) { + // type = "objet"; + // } + + // /* + // * Integer + // */ + // for (i = 0, counter = 0; i <= sb.length() - 1; i++) { + // if (sb.charAt(i) == '"') { + // counter++; + // } + // } + + // if (counter < 2) { + // type = "int"; + // } + + // /** + // * Flottant + // */ + // for (i = 0, counter = 0; i <= sb.length() - 1; i++) { + // if (sb.charAt(i) == '"') { + // counter++; + // } + // } + + // if (counter < 2 && sb.indexOf(".") != -1) { + // type = "float"; + // } + + return null; + } + + /** + * Ajouter le jeu de cle valeur dans la liste + * + * @param name Nom de la variable + * @param value Contenue de la variable + */ + private void addToList(String name, Object value) { + System.out.println("[+] => " + name + ": " + value); + this.content.put(name, value); + } + + public HashMap getVariableMap() { + return this.content; + } +} \ No newline at end of file diff --git a/toFormat.json b/toFormat.json index dd859bf..25ad443 100644 --- a/toFormat.json +++ b/toFormat.json @@ -1 +1 @@ -{"ecole":"I.U.T Senart-Fontainebleau","eleves":["Romain Besson","Bilal Boudjemline"],"classe":"BUT Informatique","matiere":{"mat1":"SCR", "mat2":"Java"}} \ No newline at end of file +{"prenom":"Bilal", "age": 19,} \ No newline at end of file