diff --git a/build/Graphics/GraphicFile.class b/build/Graphics/GraphicFile.class index 28b4821..e2db5c4 100644 Binary files a/build/Graphics/GraphicFile.class and b/build/Graphics/GraphicFile.class differ diff --git a/build/Graphics/Type/Array.class b/build/Graphics/Type/Array.class index 5902cc6..6fb1de3 100644 Binary files a/build/Graphics/Type/Array.class and b/build/Graphics/Type/Array.class differ diff --git a/build/Graphics/Type/Bool.class b/build/Graphics/Type/Bool.class index 2d6cf95..25036eb 100644 Binary files a/build/Graphics/Type/Bool.class and b/build/Graphics/Type/Bool.class differ diff --git a/build/Graphics/Type/Chaine.class b/build/Graphics/Type/Chaine.class index be3f0da..929530c 100644 Binary files a/build/Graphics/Type/Chaine.class and b/build/Graphics/Type/Chaine.class differ diff --git a/build/Graphics/Type/Entier.class b/build/Graphics/Type/Entier.class index 8b091da..2e85271 100644 Binary files a/build/Graphics/Type/Entier.class and b/build/Graphics/Type/Entier.class differ diff --git a/build/Graphics/Type/Flottant.class b/build/Graphics/Type/Flottant.class index 906a8cf..7f77b55 100644 Binary files a/build/Graphics/Type/Flottant.class and b/build/Graphics/Type/Flottant.class differ diff --git a/build/Graphics/Type/Type.class b/build/Graphics/Type/Type.class index 38e343b..28943c3 100644 Binary files a/build/Graphics/Type/Type.class and b/build/Graphics/Type/Type.class differ diff --git a/src/Graphics/GraphicFile.java b/src/Graphics/GraphicFile.java index 6917c8f..3194caa 100644 --- a/src/Graphics/GraphicFile.java +++ b/src/Graphics/GraphicFile.java @@ -3,12 +3,12 @@ package Graphics; import java.io.InputStream; import java.io.IOException; import java.util.HashMap; - import javax.swing.JLabel; import javax.swing.JPanel; import Graphics.Type.*; import java.awt.FlowLayout; import java.awt.GridLayout; +import java.util.List; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Color; @@ -48,18 +48,28 @@ public class GraphicFile extends JPanel { settings.gridx = 2; for (String key : allVariables.keySet()) { + JPanel fusion = new JPanel(new GridLayout(1, 1)); + settings.gridy = rows; JLabel name = new JLabel("\"" + key + "\": "); name.setForeground(new Color(163, 90, 0)); - - JLabel value = new JLabel(allVariables.get(key).display()); - value.setForeground(allVariables.get(key).getColor()); - - JPanel fusion = new JPanel(new GridLayout(1, 1)); fusion.add(name); - - fusion.add(value); + if (allVariables.get(key).getClass().getName() != "Graphics.Type.Array") { + JLabel value = new JLabel(allVariables.get(key).display()); + value.setForeground(allVariables.get(key).getColor()); + fusion.add(value); + } else { + JPanel speForArray = new JPanel(); + speForArray.add(new JLabel("[ ")); + for (int i = 0; i <= allVariables.get(key).listGet().size() - 1; i++) { + JLabel tmp = new JLabel(String.valueOf(allVariables.get(key).listGet().get(i).display())); + tmp.setForeground(allVariables.get(key).listGet().get(i).getColor()); + speForArray.add(tmp); + } + speForArray.add(new JLabel(" ]")); + fusion.add(speForArray); + } core.add(fusion, settings); rows++; diff --git a/src/Graphics/Type/Array.java b/src/Graphics/Type/Array.java index f3cc123..38ca715 100644 --- a/src/Graphics/Type/Array.java +++ b/src/Graphics/Type/Array.java @@ -74,6 +74,11 @@ public class Array implements Type>> { return this.valueRaw; } + @Override + public List> listGet() { + return this.value; + } + @Override public Color getColor() { return this.color; diff --git a/src/Graphics/Type/Bool.java b/src/Graphics/Type/Bool.java index b95aa77..df5b351 100644 --- a/src/Graphics/Type/Bool.java +++ b/src/Graphics/Type/Bool.java @@ -1,6 +1,7 @@ package Graphics.Type; import java.awt.Color; +import java.util.List; /** * Representation du type boolean @@ -19,6 +20,11 @@ public class Bool implements Type { } } + @Override + public List> listGet() { + return null; + } + @Override public Color getColor() { return this.color; diff --git a/src/Graphics/Type/Chaine.java b/src/Graphics/Type/Chaine.java index 04ccfdb..e798ae9 100644 --- a/src/Graphics/Type/Chaine.java +++ b/src/Graphics/Type/Chaine.java @@ -1,6 +1,7 @@ package Graphics.Type; import java.awt.Color; +import java.util.List; /** * Representation du type string @@ -15,6 +16,11 @@ public class Chaine implements Type { this.color = Color.PINK; } + @Override + public List> listGet() { + return null; + } + @Override public Color getColor() { return this.color; diff --git a/src/Graphics/Type/Entier.java b/src/Graphics/Type/Entier.java index f040e33..a00c6ab 100644 --- a/src/Graphics/Type/Entier.java +++ b/src/Graphics/Type/Entier.java @@ -1,6 +1,7 @@ package Graphics.Type; import java.awt.Color; +import java.util.List; /** * Representation du type int @@ -15,6 +16,11 @@ public class Entier implements Type { this.color = Color.BLUE; } + @Override + public List> listGet() { + return null; + } + @Override public Color getColor() { return this.color; diff --git a/src/Graphics/Type/Flottant.java b/src/Graphics/Type/Flottant.java index 8930d0e..fc7fe89 100644 --- a/src/Graphics/Type/Flottant.java +++ b/src/Graphics/Type/Flottant.java @@ -1,6 +1,7 @@ package Graphics.Type; import java.awt.Color; +import java.util.List; /** * Representation du type double @@ -15,6 +16,11 @@ public class Flottant implements Type { this.color = Color.BLUE; } + @Override + public List> listGet() { + return null; + } + @Override public Color getColor() { return this.color; diff --git a/src/Graphics/Type/Type.java b/src/Graphics/Type/Type.java index e205ac1..f1c853c 100644 --- a/src/Graphics/Type/Type.java +++ b/src/Graphics/Type/Type.java @@ -1,6 +1,7 @@ package Graphics.Type; import java.awt.Color; +import java.util.List; public interface Type { /** @@ -11,9 +12,8 @@ public interface Type { public String getType(); /** - * Recuperer la valeur de la variable * - * @return La valeur du resultat + * @return */ public T getValue(); @@ -26,4 +26,11 @@ public interface Type { * Afficher la valeur / toutes les valeurs */ public String display(); + + /** + * UNIQUEMENT POUR Graphics.Type.Chaine + * + * @return La liste contenant les valeurs du tableau + */ + public List> listGet(); }