Commit 3337dcb3 authored by pfreon's avatar pfreon
Browse files

Minor changes in Cadre_Question.java

Modification (rajout de précisions et conseils) des messages émis en fin de sélection et d'ajustement de modèle.
parent fb51d7a8
......@@ -3,7 +3,6 @@
* Gère les fenêtres de "Select the appropriate model and fit it" (=Questions)
*/
package fr.ird.climprod;
import static fr.ird.climprod.UtilCadre.Centrer;
import javax.swing.*;
import java.awt.*;
......@@ -11,8 +10,8 @@ import java.awt.event.*;
import javax.swing.border.*;
import javax.swing.event.*;
public class Cadre_Question extends JFrame {
public class Cadre_Question extends JFrame
{
JPanel jpanBouton = new JPanel();
JButton cmdPrevious = new JButton();
JButton cmdNext = new JButton();
......@@ -37,10 +36,12 @@ public class Cadre_Question extends JFrame {
JScrollPane jScrollPane3 = new JScrollPane();
JTextArea jTextAreaMessage = new JTextArea();
Cadre_SplitPlot dlgSp;
public static int nim, i, jk;
private JFrame parent;
public Cadre_Question(JFrame parent) {
public Cadre_Question(JFrame parent)
{
try {
this.parent = parent;
initWindow();
......@@ -49,8 +50,8 @@ public class Cadre_Question extends JFrame {
UtilCadre.Centrer(this);
QuestionReponse.reset();
this.loadQuestion(true);
} catch (Exception e) {
e.printStackTrace();
}
catch (Exception e) {e.printStackTrace();
}
}
......@@ -357,7 +358,7 @@ public class Cadre_Question extends JFrame {
RechercheModele.select();
//System.out.println("retour equation " +RechercheModele.getEquation());
if (RechercheModele.getType() == -1) {
new MsgDialogBox(0, "There is no available model fully appropriate to your case\nIn order to found an appropriate model,\nyou can revise your previous answers", 1, this.parent);
new MsgDialogBox(0, "There is no available model fully appropriate to your case. \nIn order to found an appropriate model, you can revise \nyour previous answers. \nIt is not recommended to modify your answers too much upward \ndue to re-initialization issues.", 1, this.parent);
return;
}
......@@ -394,7 +395,6 @@ public class Cadre_Question extends JFrame {
}
}
private void loadQuestion(boolean next) {
int numQ, numR;
......@@ -405,50 +405,60 @@ public class Cadre_Question extends JFrame {
numQ = QuestionReponse.getNum();
numR = QuestionReponse.getNumRegle();
System.out.println("Dans Cadre_Question ligne 406: n° de question numQ = " + numQ + " n° de règle numR = " +numR);
if (numQ == -1) {
String m$ = "Your data set is not appropriate";
if (!Global.bavard) {
if (numQ == -1)
{
String m$ = "Your data set is not appropriate for this model (see statistical results in the'Current Known facts' table.)";
if (!Global.bavard)
{
m$ = m$ + "\n" + TexteRegles.getComment();
}
}
new MsgDialogBox(0, m$, 0, this.parent);
stopProcess();
return;
} else if (numQ == -2 || numQ == -3) {
new MsgDialogBox(0, "The model is not validated", 0, this.parent);
QuestionReponse.reset();
}
else
if (numQ == -2 || numQ == -3)
{
new MsgDialogBox(0, "Problem in Jackknife computation \ndue to CPUE values <1. \nPlease modifiy your units of production (catches) and/or effort.", 0, this.parent);//System.out.println("Texte_erreur_jackknife$1 = "); // + Texte_erreur_jackknife$[1]
QuestionReponse.reset();
this.dispose();
Global.CadreQuestion = null;
if (dlgSp != null){
if (dlgSp != null)
{
dlgSp.setVisible(false);
dlgSp = null;
}
}
return;
} else if (numQ == -4) {
if (dlgSp != null){
}
else
if (numQ == -4)
{
if (dlgSp != null)
{
dlgSp.setVisible(false);
dlgSp = null;
}
new MsgDialogBox(0, "The model is validated\n You can use it for prediction", 1, this.parent);
}
new MsgDialogBox(0, "The model is validated. \nYou can have a look at the MSY and MS_E graphs \nin the 'Plots' menu and use this model \nfor prediction.", 1, this.parent);
QuestionReponse.reset();
this.dispose();
Global.CadreQuestion = null;
return;
}
}
TexteRegles.loadRegles(numR);
if (numR >= 0) {
if (numR >= 0)
{
//TexteRegles.loadRegles(numR);
jTextAreaRegle.setText(TexteRegles.getScript());
String[] itemR = TexteRegles.getItem();
for (int i = 0; i < itemR.length; i++) {
for (int i = 0; i < itemR.length; i++)
{
jTextAreaRegle.append("\n\t");
jTextAreaRegle.append(itemR[i]);
}
}
jTextAreaRegle.setCaretPosition(0);
} else {
jTextAreaRegle.setText("");
}
}
else { jTextAreaRegle.setText("");}
QuestionReponse.loadQuestion();
Script = QuestionReponse.getScript();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment