Commit 3985745a authored by pfreon's avatar pfreon
Browse files

Prevent a crash of the software when the user close the html windows without using it.

Prevent a crash of the software when the user close the "Build a history html & graphs folder" windows without using it.
parent 3f8e66df
......@@ -20,7 +20,6 @@ import java.io.InputStream;
import java.util.StringTokenizer;
public class Global {
static boolean JackknifePlot; // Flag graphique Jackknife en onglets en même temps que questions. Rajout 2020
static final String[] influenceEnv = {"", "abundance", "catchability", "both"};//probl�me du both
static JFrame CadreQuestion; //Une seule instance est permise pour l'instant
static JFrame CadreModeleDirect;
......@@ -38,7 +37,7 @@ public class Global {
static JFrame CadreMain;
/**
* ******* Hypothses de base *******
* ******* Hypothèses de base *******
*/
static double temp;
......@@ -53,7 +52,7 @@ public class Global {
static int effet_delais_abundance_negligeable; // Do time-lags and deviations from the stable age structure have negligible effects on production rate
/**
* ******* Stabilite de la modlisation *****
* ******* Stabilite de la modélisation *****
*/
static int under_and_over_exploited; // Do you think that the data-set covers periods both of overexploitation and of underexploitation
static int under_and_optimaly; // Do you think that the data-set cover periods both of underexploitation and optimal exploitation
......@@ -105,6 +104,7 @@ public class Global {
static int Max_95_Noteworthy_MSE;
static int Max_95_Noteworthy_MSY;
static int[] AllPredictedNegative = new int[5];
static boolean JackknifePlot; // Flag graphique Jackknife en onglets en même temps que questions. Rajout 2020
static int Flag_pb_jackknife_Tot;
static int[] Flag_pb_jackknife=new int[4];
static boolean test_jackknife;
......@@ -117,7 +117,7 @@ public class Global {
* *******Variables de travail ********
*/
static boolean bavard = false; // Do you want to trace all the procedure of rule application
static boolean FlagNewHtmlFolder = false;
static String nom_fichier = null; //Name of the data file
static int decalmax = 0;
static int etapeEnCours = 0; //num�ro d'�tape dans la fixation du modele
......@@ -387,7 +387,13 @@ public class Global {
double[] ext=Stat1.Extremas(effort);
return (((ext[1]-ext[0])/ext[0]));
}
public static double RangeYear(){ // Computes year range.
double[] year=Data.getYears();
double[] ext=Stat1.Extremas(year);
return (ext[1]-ext[0]);
}
public static double fF(double R2, double p, double n){ // Fisher Fcalc; p = nombre de paramètres autres que constante (a en général)
return((R2/p)/((1 - R2) / (n-p-1)));
}
......
......@@ -30,6 +30,7 @@ public class RapportHtml extends JDialog {
choice = 0;
folderList = null;
facts = currentFacts;
System.out.println("RapportHtml Ligne 33 FlagNewHtmlFolder = " + Global.FlagNewHtmlFolder);
fileSep = System.getProperty("file.separator");
if (fileSep.equals("/")) {
fileSep = "//";
......@@ -190,6 +191,8 @@ public class RapportHtml extends JDialog {
if (folderName.trim().equals("")) {
folderName = "defaultFolder";
}
Global.FlagNewHtmlFolder = true;
System.out.println("Ligne 194 FlagNewHtmlFolder = " + Global.FlagNewHtmlFolder);
String folderPath = path + fileSep + folderName;
File fPath = new File(folderPath);
if (!fPath.exists()) {
......
Markdown is supported
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