diff --git a/Affichage.java b/Affichage.java index f3d1d6a..cc87bf7 100644 --- a/Affichage.java +++ b/Affichage.java @@ -1,3 +1,9 @@ +/** + * Class pour modifier l'affichage + * @version 1.1 + * @author Matthis Fauvet + */ + public class Affichage { private Cellules cetteCellules; private PanneauModification cePanel; @@ -6,7 +12,14 @@ public class Affichage { private int[] caseEntrortie; + /** Constructeur de la class affichage + * @param uneCellules premet de récupérer la cellules a afficher + * @param unPanel panneau de modification pour récupérer les valeurs demandés + * @param tabEntre tableau qui permet de savoir si un entré est déjà placé + * @param unEtat variable qui permet de savoir si un case est un mu ou un couloir + */ public Affichage(Cellules uneCellules, PanneauModification unPanel, int[] tabEntre, boolean unEtat){ + //permet la distribution des différents attributs this.cetteCellules = uneCellules; this.cePanel = unPanel; this.cetEtat = unEtat; @@ -15,20 +28,22 @@ public class Affichage { repaint(); } + /** + * Renvoie l'etat des cellules entre et sortie, si oui ou non elles sont posé ou pas + */ public int[] getGateState(){ return this.caseEntrortie; } + /** + * La fonctions repaint permet de changer les Cellules pour leur mettres leurs bonne couleurs. + */ public void repaint(){ // Accéder aux boutons radios de l'objet Options boolean radio1Selected = this.cePanel.GetButtonBW().isSelected(); // MUR / COULOIR boolean radio2Selected = this.cePanel.GetButtonE().isSelected(); // ENTREE boolean radio3Selected = this.cePanel.GetButtonS().isSelected(); //SORTIE - //System.out.println("le type de la cell vaut : " + this.cetteCellules.getType()); - - //System.out.println("Etat des deux valeur : " + this.caseEntrortie[0] + " "+ this.caseEntrortie[1]); - if(radio2Selected==true && this.caseEntrortie[0]==0){ this.cetEtat=Cellules.LIBRE; this.cetteCellules.setType(Cellules.ENTREE); @@ -40,7 +55,6 @@ public class Affichage { this.cetteCellules.peindre(Cellules.SORTIE); this.caseEntrortie[1]=1; } else if(this.cetEtat == Cellules.LIBRE && radio1Selected==true){ - //System.out.println("cellules peinte en couloir"); if(this.cetteCellules.getType()==Cellules.ENTREE){ this.caseEntrortie[0]=0; } else if(this.cetteCellules.getType()==Cellules.SORTIE){ @@ -49,7 +63,6 @@ public class Affichage { this.cetteCellules.setType(Cellules.COULOIR); this.cetteCellules.peindre(Cellules.COULOIR); } else if(this.cetEtat == Cellules.OCCUPE && radio1Selected==true){ - //System.out.println("cellules peinte en mur"); this.cetteCellules.setType(Cellules.MUR); this.cetteCellules.peindre(Cellules.MUR); }