1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| public static void poursuivreCreation(String[] tabArticles,
String varSectionEnCours, double[][] tabLignes, String varArticle,
String[] tabSections, int varIndiceSection,String varSection) {
// Demande à l'utilisateur s'il veut poursuivre
// la création d'une autre ligne ou section par un sous-menu
// et teste si le choix rentré est correct
int choixPoursuivre = 0;
Terminal.sautDeLigne();
Terminal.sautDeLigne();
Terminal.ecrireString(" ==> " + "\t" + "\t"
+ "Que desirez vous faire ?");
Terminal.sautDeLigne();
Terminal.sautDeLigne();
Terminal.ecrireStringln("\t" + "1. = Creer une nouvelle ligne");
Terminal.ecrireStringln("\t" + "2. = Creer une nouvelle section");
Terminal.ecrireStringln("\t" + "3. = Voir document");
Terminal.ecrireStringln("\t" + "4. = Menu Principal");
Terminal.sautDeLigne();
Terminal.ecrireString(" ==> " + "\t" + "\t"
+ "Veuillez entrer votre choix : ");
// Teste la réponse utilisateur
boolean testReponse = false;
while (testReponse == false) {
Terminal.sautDeLigne();
choixPoursuivre = Terminal.lireInt();
if (choixPoursuivre < 1 || choixPoursuivre > 4) {
testReponse = false;
Terminal.ecrireString(" ==> "
+ "\t"
+ "Le choix rentré n'est pas valide, vous devez rentrer un nombre entre 1 et 4");
Terminal.sautDeLigne();
Terminal.ecrireString(" ==> " + "\t" + "\t"
+ "Veuillez entrer votre choix : ");
} else {
testReponse = true;
}
// Actions à éxécuter suivant le choix effectué dans le menu
if (choixPoursuivre == 1) {
creerLigne(tabArticles, tabLignes, varArticle,
varSectionEnCours, tabSections, varIndiceSection, varSection);
}
if (choixPoursuivre == 2) {
creerSection(tabSections, varArticle, varSectionEnCours,
tabSections, tabLignes, varIndiceSection);
}
if (choixPoursuivre == 3) {
afficherDocument(tabLignes, tabArticles, tabSections,
varArticle, varSectionEnCours, varIndiceSection);
}
if (choixPoursuivre == 4) {
afficherMenu(tabSections, varArticle, varSectionEnCours,
tabArticles, tabLignes, varIndiceSection, varSection);
}
}
} |