private void constrClasseFormu( Programme prog, StringBuffer buf, int indent, String msg, String p_pere, Argument arg) { this.constrLabelFormu(prog, buf, indent, msg, p_pere, arg); Classe cl = (Classe) arg.getClasse(prog); String p_zone = "p_" + arg.nom; p_zone = Divers.remplacer(p_zone, ".", "_"); int nb_prop = cl.proprietes.size() - cl.compterMode("OUT"); Divers.ecrire(buf, p_zone + "=new JPanel(new GridLayout(" + (2 * nb_prop) + "," + 1 + ")); "); Divers.ecrire(buf, p_pere + ".add(" + p_zone + ");"); for (Iterator<org.javascool.proglets.plurialgo.langages.modele.Variable> iter = cl.proprietes.iterator(); iter.hasNext(); ) { Variable prop = (Variable) iter.next(); if (prop.isOut()) continue; String msg1 = prog.quote(prop.nom); Argument arg1 = new Argument(arg.nom + "." + prop.nom, prop.type, arg.mode); constrFormu(prog, buf, indent, msg1, p_zone, arg1); } }
private void constrTabClasseFormu( Programme prog, StringBuffer buf, int indent, String msg, String p_pere, Argument arg) { this.constrLabelFormu(prog, buf, indent, msg, p_pere, arg); Classe cl = (Classe) arg.getClasseOfTab(prog); Divers.indenter(buf, indent); String p_zone = "p_" + arg.nom; p_zone = Divers.remplacer(p_zone, ".", "_"); String zone = "zone_" + arg.nom; zone = Divers.remplacer(zone, ".", "_"); int nb_prop = cl.proprietes.size() - cl.compterMode("OUT"); Divers.ecrire(buf, p_zone + "=new JPanel(new GridLayout(" + 2 + "," + nb_prop + ")); "); Divers.ecrire(buf, p_pere + ".add(" + p_zone + ");"); for (Iterator<org.javascool.proglets.plurialgo.langages.modele.Variable> iter = cl.proprietes.iterator(); iter.hasNext(); ) { Variable prop = (Variable) iter.next(); if (prop.isOut()) continue; String msg1 = prog.quote(prop.nom); String label1 = "new JLabel(" + msg1 + ")"; Divers.indenter(buf, indent); Divers.ecrire(buf, p_zone + ".add(" + label1 + ");"); } for (Iterator<org.javascool.proglets.plurialgo.langages.modele.Variable> iter = cl.proprietes.iterator(); iter.hasNext(); ) { Variable prop = (Variable) iter.next(); if (prop.isOut()) continue; instr_pere.addVariable(new Variable("ii", "ENTIER")); if (prop.isSimple()) { Argument arg1 = new Argument(arg.nom + "." + prop.nom, "TAB_" + prop.type, arg.mode); String msg1 = null; constrTabFormu(prog, buf, indent, msg1, p_zone, arg1, "ii"); } if (prop.isTabSimple()) { Argument arg1 = new Argument(arg.nom + "." + prop.nom, "MAT_" + prop.getTypeOfTab(), arg.mode); String msg1 = null; constrMatFormu(prog, buf, indent, msg1, p_zone, arg1); } } }