예제 #1
0
 private void declSimpleFormu(Programme prog, StringBuffer buf, int indent, Argument arg) {
   String zone = "zone_" + arg.nom;
   zone = Divers.remplacer(zone, ".", "_");
   if (arg.isEntier() || arg.isReel()) {
     Divers.indenter(buf, indent);
     Divers.ecrire(buf, "JTextField " + zone + "; ");
   } else if (arg.isTexte()) {
     this.declTexteFormu(prog, buf, indent, arg);
   } else if (arg.isBooleen()) {
     Divers.indenter(buf, indent);
     Divers.ecrire(buf, "Checkbox " + zone + "; ");
   }
 }
예제 #2
0
 private void constrSimpleFormu(
     Programme prog, StringBuffer buf, int indent, String msg, String p_pere, Argument arg) {
   String zone = "zone_" + arg.nom;
   zone = Divers.remplacer(zone, ".", "_");
   if (arg.isEntier() || arg.isReel()) {
     this.constrLabelFormu(prog, buf, indent, msg, p_pere, arg);
     Divers.indenter(buf, indent);
     Divers.ecrire(buf, zone + "=new JTextField(); ");
     Divers.ecrire(buf, p_pere + ".add(" + zone + ");");
   } else if (arg.isTexte()) {
     this.constrTexteFormu(prog, buf, indent, msg, p_pere, arg);
   } else if (arg.isBooleen()) {
     this.constrLabelFormu(prog, buf, indent, msg, p_pere, arg);
     Divers.indenter(buf, indent);
     Divers.ecrire(buf, zone + "=new Checkbox(); ");
     Divers.ecrire(buf, p_pere + ".add(" + zone + ");");
   }
 }
예제 #3
0
 private void lireSimpleFormu(Programme prog, StringBuffer buf, int indent, Argument arg) {
   String zone = "zone_" + arg.nom;
   zone = Divers.remplacer(zone, ".", "_");
   if (arg.isEntier()) {
     Divers.indenter(buf, indent);
     Divers.ecrire(buf, arg.nom + " = Integer.parseInt( ");
     Divers.ecrire(buf, zone + ".getText() ); ");
   } else if (arg.isReel()) {
     Divers.indenter(buf, indent);
     Divers.ecrire(buf, arg.nom + " = Double.parseDouble( ");
     Divers.ecrire(buf, zone + ".getText() ); ");
   } else if (arg.isTexte()) {
     this.lireTexteFormu(prog, buf, indent, arg);
   } else if (arg.isBooleen()) {
     Divers.indenter(buf, indent);
     Divers.ecrire(buf, arg.nom + " = ");
     Divers.ecrire(buf, zone + ".getState(); ");
   }
 }