MAJ V4.5.0

This commit is contained in:
pablo rodriguez 2024-04-08 20:46:40 +02:00
parent 782d568a3f
commit c758d996f0
33 changed files with 164 additions and 290 deletions

151
bin/.gitignore vendored
View File

@ -4,160 +4,9 @@
/baseEvaluations/ /baseEvaluations/
/calcul/ /calcul/
/evaluer/ /evaluer/
/extraireFichierAnalysemini.png
/false.png
/false.svg
/falsemini.png
/feedback.png
/feedback.svg
/feedbackmini.png
/feedbackstudent.png
/feedbackstudentmini.png
/fenetres/ /fenetres/
/fichierAnalyse.png
/fichierAnalyseInfo.png
/fichierAnalyseInfo2.png
/fichierAnalyseInfo2max.png
/fichierAnalyseInfo2mini.png
/fichierAnalyseInfomax.png
/fichierAnalyseInfomini.png
/fichierAnalyseModif.png
/fichierAnalyseModifmax.png
/fichierAnalyseModifmini.png
/fichierAnalyseRenomme.png
/fichierAnalyseRenommemini.png
/fichierAnalysemax.png
/fichierAnalysemini.png
/fichierCSV.png
/fichierCSVInfo.png
/fichierCSVInfoXML.png
/fichierCSVInfoXMLmax.png
/fichierCSVInfoXMLmini.png
/fichierCSVInfomax.png
/fichierCSVInfomini.png
/fichierCSV_delete.png
/fichierCSV_deletemini.png
/fichierCSVmax.png
/fichierCSVmini.png
/fichierODF.png
/fichierODFmax.png
/fichierODFmini.png
/fichierSVG.png
/fichierSVGmax.png
/fichierSVGmini.png
/fichier_analyse.svg
/fichier_analyseXML info.svg
/fichier_analyseXML info1.svg
/fichier_analyseXML.svg
/fichier_analyse_ODF.svg
/fichier_csv_studen_delete.svg
/fichier_csv_studen_modif.png
/fichier_csv_studen_modif.svg
/fichier_csv_studen_modifmini.png
/fichier_csv_studen_suppr.svg
/fichier_csv_student.svg
/fichier_csv_student_info.svg
/fichier_csv_student_xml.svg
/fichier_svg.svg
/fichieretudiant.png
/fichieretudiant.svg
/fichieretudiantmini.png
/fichiergestion.png
/fichiergestion.svg
/fusionneBaseEvaluation.png
/fusionneBaseEvaluation.svg
/fusionneBaseEvaluationmini.png
/heritagestyle.png
/heritagestyle.svg
/heritagestylefalse.png
/heritagestylefalsemini.png
/heritagestylemini.png
/heritagestyletouslesnodes.png
/heritagestyletouslesnodes.svg
/heritagestyletouslesnodesmini.png
/heritagestyletrue.png
/heritagestyletruemini.png
/indexfigure.png
/indexfigure.svg
/indexmatiere.png
/indexmatiere.svg
/information.png
/information.svg
/informationmaxi.png
/informationmini.png
/informationmultiple.png
/informationmultiple.svg
/informationmultiplemini.png
/intervalle.png
/intervalle.svg
/intervallemini.png
/legacystyleparentpresent.svg
/lesnodesevaluer.png
/lesnodesevaluer.svg
/lesnodesevaluermaxi.png
/lesnodesevaluermini.png
/list/ /list/
/loadpreference.svg
/loadpreferencemini.png
/loadpreferences.png
/logo analyseWriter accueill.svg
/logo.png
/logo.svg
/marquenode.png
/marquenode.svg
/marquenodemini.png
/menuEvalTousParagraphe.png
/menuEvalTousParagraphe.svg
/menuEvalTousParagraphemini.png
/menucontextuel/ /menucontextuel/
/menulegacystyleparentpresent.png
/menulegacystyleparentpresentmini.png
/meta.png
/meta.svg
/new.png
/newlogo.png
/newlogo.svg
/newlogomini.png
/nocsvstudent.png
/nocsvstudentmini.png
/nodeFichier.png
/nodeFichier_FichierAnalyse.svg
/nodeFichiermax.png
/nodeFichiermini.png
/nodetail.png
/nodetail.svg
/nodetailfeedback.png
/nodetailfeedbackmini.png
/nodetailmini.png
/nofeedback.png
/nofeedbackmini.png
/nofeedbackstudent.png
/nofeedbackstudent.svg
/nofeedbackstudentmini.png
/nologo.png
/nonewlogo.png
/nonewlogomini.png
/nonotestudent.png
/nonotestudentl.svg
/nonotestudentmini.png
/notestudent.png
/notestudentmini.png
/noverifhistoriquestudent.png
/noverifhistoriquestudentmini.png
/nozipstudent.png
/nozipstudentmini.png
/numerotationchapitre.png
/numerotationchapitre.svg
/objet.png
/objet.svg
/odreparagraphe.png
/odreparagraphemini.png
/open.png
/open.svg
/open2.png
/openmax.png
/openmini.png
/ordreparagraphe.svg
/ou.png /ou.png
/ouenviron.png /ouenviron.png
/ouenviron.svg /ouenviron.svg

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -127,10 +127,24 @@ public class commandes {
public static String analyse_hash = ""; public static String analyse_hash = "";
public static String analysis_filename = ""; public static String analysis_filename = "";
//** Variables pour l'interface du logiciel //********************************************
//** Variables pour l'interface du logiciel **
//********************************************
/**
* Titre de l'application<br>
* Affiché dans les fenêtre de l'application.
*/
public static String Titre = "analyseWriter"; public static String Titre = "analyseWriter";
public static String PathFilenameAnalysis=""; //Chemin vers le fichier d'analyse /**
public static boolean fichierAnalyseValide = false; //mise à jour de la valeur dans MEPTL.verificationFichierAnalyse * Chemin absolue vers le fichier d'analyse<br>
* Le chemain contient le nom du fichier.
*/
public static String PathFilenameAnalysis="";
/**
* Flag de mise à jour de la valeur pour la méthode<br>
* MEPTL.verificationFichierAnalyse.
*/
public static boolean fichierAnalyseValide = false;
public static int analyse_Nbre_Fichier_Student = 0; public static int analyse_Nbre_Fichier_Student = 0;
public static int analyse_index_Fichier_Student = 0; public static int analyse_index_Fichier_Student = 0;
public static StringBuilder message = new StringBuilder(); public static StringBuilder message = new StringBuilder();

View File

@ -11,10 +11,10 @@ import javax.swing.KeyStroke;
import MEPTL.commandes; import MEPTL.commandes;
import baseEvaluations.creerNouvelleEvaluation; import baseEvaluations.creerNouvelleEvaluation;
import baseEvaluations.ecritureBaseEvaluation;
import baseEvaluations.recupeNodeBaseEvaluations; import baseEvaluations.recupeNodeBaseEvaluations;
import cXML.node; import cXML.node;
public class actSaveEvaluation extends AbstractAction{ public class actSaveEvaluation extends AbstractAction{
/** /**
@ -33,41 +33,21 @@ public class actSaveEvaluation extends AbstractAction{
if(!commandes.sujet.isVide()) { if(!commandes.sujet.isVide()) {
if(commandes.IndexEvaluationCharger!=-1) { if(commandes.IndexEvaluationCharger!=-1) {
new creerNouvelleEvaluation(commandes.evaluationChargeEnMemoire);
new recupeNodeBaseEvaluations(); new recupeNodeBaseEvaluations();
node evaluation = commandes.evaluationsBase.getNodes().get(commandes.IndexEvaluationCharger);
if(evaluation.getAttributs().get("name").equals(commandes.NameEvaluationCharger)) {
commandes.evaluationsBase.getNodes().add(commandes.IndexEvaluationCharger, new creerNouvelleEvaluation(evaluation, commandes.NameEvaluationCharger, false).getEvaluation());
new ecritureBaseEvaluation();
JOptionPane.showMessageDialog(null,"L'évaluation encours " + commandes.NameEvaluationCharger + " a été mise à jour\ndans la base des évaluations.");
}else {
JOptionPane.showMessageDialog(null,"L'évaluation encours n'a été enregistrée\ndans la base des évaluations.\n"
+ "Il y a un problème avec l'index de cette évaluation dans la base.");
}
}else { }else {
new recupeNodeBaseEvaluations();
String name = "Nouvelle évaluation"; String name = "Nouvelle évaluation";
name = JOptionPane.showInputDialog(null,"Donner un nom à cette évaluation ?",name); name = JOptionPane.showInputDialog(null,"Donner un nom à cette évaluation ?",name);
if(!name.isBlank()) { if(!name.isBlank()) {
new creerNouvelleEvaluation(name,true); new creerNouvelleEvaluation(new node(), name, false);
new ecritureBaseEvaluation();
commandes.IndexEvaluationCharger=0; commandes.IndexEvaluationCharger=0;
commandes.NameEvaluationCharger=name; commandes.NameEvaluationCharger=name;
new recupeNodeBaseEvaluations();
JOptionPane.showMessageDialog(null,"L'évaluation encours " + name + " a été enregistrée\ndans la base des évaluations."); JOptionPane.showMessageDialog(null,"L'évaluation encours " + name + " a été enregistrée\ndans la base des évaluations.");
}else { }else {
JOptionPane.showMessageDialog(null,"L'évaluation encours n'a été enregistrée\ndans la base des évaluations."); JOptionPane.showMessageDialog(null,"L'évaluation encours n'a pas été enregistrée\ndans la base des évaluations.");
} }
} }
} }
} }
} }

View File

@ -60,8 +60,7 @@ public class chargeEvaluationSelected {
+ "<p>Sinon, une nouvelle base de données sera créé dans le dossier de l'application.</p></html>"); + "<p>Sinon, une nouvelle base de données sera créé dans le dossier de l'application.</p></html>");
JOptionPane.showMessageDialog(frame, texte); JOptionPane.showMessageDialog(frame, texte);
} }
}
//* Charge le node sujet provisoirement //* Charge le node sujet provisoirement
commandes.evaluationChargeEnMemoire = evaluation; commandes.evaluationChargeEnMemoire = evaluation;
@ -155,9 +154,12 @@ public class chargeEvaluationSelected {
//** Remise à zéro de la base dans la mémoire de l'application //** Remise à zéro de la base dans la mémoire de l'application
commandes.evaluationsBase = null; commandes.evaluationsBase = null;
}
} }
/** /**
* Charge le fichier d'analyse de l'évaluation.<br> * Charge le fichier d'analyse de l'évaluation.<br>
* @param file * @param file

View File

@ -9,44 +9,44 @@ import cXML.node;
public class creerNouvelleEvaluation { public class creerNouvelleEvaluation {
node evaluation = new node(); boolean majBase = false;
boolean addBase = false;
public node getEvaluation() {
return evaluation;
}
public creerNouvelleEvaluation(String nameEval, boolean addBase) { /**
this.addBase=addBase; * Mise à jour d'une évaluation
evaluation = nouvelleEvaluation(evaluation, nameEval); * @param evaluation
} */
public creerNouvelleEvaluation(node evaluation) { public creerNouvelleEvaluation(node evaluation) {
String name = "Nouvelle évaluation"; this.majBase=true;
evaluation = nouvelleEvaluation(evaluation, name); commandes.evaluationChargeEnMemoire = nouvelleEvaluation(evaluation, evaluation.getAttributs().get("name"));
} }
public creerNouvelleEvaluation(node evaluation, String name, boolean addBase) { public creerNouvelleEvaluation(node evaluation, String name, boolean majBase) {
this.addBase = addBase; this.majBase = majBase;
evaluation = nouvelleEvaluation(evaluation, name); commandes.evaluationChargeEnMemoire = nouvelleEvaluation(evaluation, name);
commandes.evaluationChargeEnMemoire = evaluation; // if(!majBase) commandes.evaluationChargeEnMemoire = evaluation;
} }
private node nouvelleEvaluation(node evaluation, String nameEvaluation) { private node nouvelleEvaluation(node evaluation, String nameEvaluation) {
// création du nouveau node evaluation
evaluation.setNomElt("evaluation"); evaluation.setNomElt("evaluation");
if(addBase) {
Date aujourdhui = new Date(); // La date est modifiée à la création de l'évaluation..
Date aujourdhui = new Date();
try { try {
evaluation.getAttributs().put("date", calcul.formatDateWriter.DateLibreOffice(aujourdhui)); if(!majBase) {
evaluation.getAttributs().put("date", calcul.formatDateWriter.DateLibreOffice(aujourdhui));
}else {
evaluation.getAttributs().put("dateModification", calcul.formatDateWriter.DateLibreOffice(aujourdhui));
}
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
}
// informations de l'évaluation
evaluation.getAttributs().put("version", commandes.version); evaluation.getAttributs().put("version", commandes.version);
evaluation.getAttributs().put("name", nameEvaluation); evaluation.getAttributs().put("name", nameEvaluation);
evaluation.getAttributs().put("PathFilenameAnalysis", commandes.PathFilenameAnalysis); evaluation.getAttributs().put("PathFilenameAnalysis", commandes.PathFilenameAnalysis);
@ -111,16 +111,16 @@ public class creerNouvelleEvaluation {
} }
} }
if(addBase) { //Création d'une évaluation
if(!majBase) {
if(commandes.evaluationsBase!=null) { if(commandes.evaluationsBase!=null) {
commandes.evaluationsBase.getNodes().add(0, evaluation); commandes.evaluationsBase.getNodes().add(0, evaluation);
commandes.IndexEvaluationCharger=0; commandes.IndexEvaluationCharger=0;
} }
}else {
commandes.evaluationsBase.getNodes().remove(commandes.IndexEvaluationCharger);
commandes.evaluationsBase.getNodes().add(commandes.IndexEvaluationCharger, evaluation);
} }
new ecritureBaseEvaluation(evaluation);
return evaluation; return evaluation;
} }

View File

@ -1,20 +1,25 @@
package baseEvaluations; package baseEvaluations;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import MEPTL.commandes; import MEPTL.commandes;
import cXML.Run; import cXML.Run;
import cXML.node;
public class ecritureBaseEvaluation { public class ecritureBaseEvaluation {
public ecritureBaseEvaluation() { public ecritureBaseEvaluation(node evaluation) {
String directoryName = ""; String directoryName = "";
@ -45,15 +50,35 @@ public class ecritureBaseEvaluation {
} }
String baseToString = targetString.toString().replace("\t","").replace("\r", "").replace("\n", "").replaceAll(">/{1,}<","><"); String baseToString = targetString.toString().replace("\t","").replace("\r", "").replace("\n", "").replaceAll(">/{1,}<","><");
Pattern p = Pattern.compile("<\\bevaluation\\b.*?name=\""+commandes.NameEvaluationCharger+".*?\\bevaluation\\b>"); Pattern p = Pattern.compile("<\\bevaluation\\b.{1,500}\\bdate\\b=\\\""+ evaluation.getAttributs().get("date") +"\\\".*?<\\/\\bevaluation\\b>");
Matcher m = p.matcher(baseToString.trim()); Matcher m = p.matcher(baseToString.trim());
String debut;
String fin;
String XMLBase="";
if(m.find()) { if(m.find()) {
baseToString=baseToString.substring(0,m.start())+ baseToString.substring(m.start(),baseToString.length()); System.out.println("match start ="+ m.start());
System.out.println("match end ="+ m.end());
//Supprime le node évluation pour le remplacer
debut = baseToString.substring(0,m.start());
fin = baseToString.substring(m.end());
String codeXMLEvaluation = Run.ecritureNode(evaluation, 0).toString().replace("\t","").replace("\r", "").replace("\n", "").replaceAll(">/{1,}<","><");
XMLBase = debut + codeXMLEvaluation + fin;
} }
// écriture du node try {
baseToString = Run.ecritureNode(commandes.evaluationChargeEnMemoire, 0).toString().replace("\t","").replace("\r", "").replace("\n", "").replaceAll(">/{1,}<","><") + baseToString;
// écriture du node
Path outputFilePath = Paths.get("C:/Users/pabr6/Downloads/test.xml");
BufferedWriter fichier = Files.newBufferedWriter(outputFilePath, StandardCharsets.UTF_8);
fichier.write(XMLBase);
fichier.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}catch (Exception e) { }catch (Exception e) {

View File

@ -2,14 +2,17 @@ package baseEvaluations;
import MEPTL.commandes; import MEPTL.commandes;
/**
* Classe permettant de savoir si une évaluation est déjà présente dans la base.
* @author pabr6
*
*/
public class evaluationExist { public class evaluationExist {
public static Boolean isEvaluationExist(String nameEvaluation, String date) { public static Boolean isEvaluationExist(String date) {
if(commandes.evaluationsBase.retourneFirstNodeByNameAndAttributValueExactStrict("evaluation", "name", nameEvaluation)!=null) { if(commandes.evaluationsBase.retourneFirstNodeByNameAndAttributValueExactStrict("evaluation", "date", date)!=null) {
if(commandes.evaluationsBase.getAttributs().get("date").equals(date)) { return true;
return true;
}
} }
return false; return false;
} }

View File

@ -69,5 +69,52 @@ public class recupeNodeBaseEvaluations {
} }
} }
public recupeNodeBaseEvaluations(String directoryName, String NameNewBase) {
File file = null;
if(commandes.os.contains("Win")) {
file = new File(directoryName + "\\" + NameNewBase);
}else {
file = new File(directoryName + "/" + NameNewBase);
}
if(file!=null) {
BufferedReader br;
try {
br = new BufferedReader(
new InputStreamReader(
new FileInputStream(file.getAbsoluteFile()), "UTF-8"));
String line;
StringBuilder targetString = new StringBuilder();
while ((line = br.readLine()) != null) {
targetString.append(line);
}
node evaluations = new node();
evaluations = evaluations.allFirstNodesEvaluationFichierOnly(targetString.toString().replace("\t","").replace("\r", "").replace("\n", ""));
if(evaluations!=null) {
if(evaluations.getNodes().size()>0) {
if(evaluations.getNomElt().equals("evaluations")) {
commandes.evaluationsBase = evaluations;
commandes.PathBaseEvaluations = (directoryName);
commandes.NameBaseEvaluations = NameNewBase;
commandes.PathBaseEvaluationDefaut = false;
}
}
}
}catch (Exception e) {
JFrame frame = new JFrame();
JLabel texte = new JLabel("<html><p>La base de données ne se trouve pas dans le même dossier que celui de l'application.</p><br>"
+"<p>Vous pouvez charger la base de données depuis la fenêtre \"<b>base de données d'évaluation</b>\" de l'application.</p>"
+ "<p>Sinon, une nouvelle base de données sera créé dans le dossier de l'application.</p></html>");
JOptionPane.showMessageDialog(frame, texte);
}
}
}
} }

View File

@ -4,24 +4,14 @@ import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.HeadlessException; import java.awt.HeadlessException;
import java.awt.Image; import java.awt.Image;
import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileNameExtensionFilter;
import MEPTL.commandes; import MEPTL.commandes;
import cXML.node; import baseEvaluations.recupeNodeBaseEvaluations;
public class ChargePathBaseEvaluation extends JFileChooser { public class ChargePathBaseEvaluation extends JFileChooser {
@ -81,49 +71,11 @@ public class ChargePathBaseEvaluation extends JFileChooser {
commandes.path = file.getPath().substring(0,file.getPath().lastIndexOf("/")); // Sur mac & Linux commandes.path = file.getPath().substring(0,file.getPath().lastIndexOf("/")); // Sur mac & Linux
} }
String PathFilenameAnalysis = getCurrentDirectory().getPath(); String directoryName = getCurrentDirectory().getPath();
String nameSujet = file.getName().toString(); String nameNewBase = file.getName().toString();
BufferedReader br;
try { new recupeNodeBaseEvaluations(directoryName,nameNewBase);
br = new BufferedReader(
new InputStreamReader(
new FileInputStream(file.getAbsoluteFile()), "UTF-8"));
String line;
StringBuilder targetString = new StringBuilder();
while ((line = br.readLine()) != null) {
targetString.append(line);
}
node nodeEvaluation = new node(targetString.toString().replace("\t","").replace("\r", "").replace("\n", ""));
if(nodeEvaluation.getNomElt().equals("evaluations")) {
if(!avecFusion) {
commandes.NameBaseEvaluations=nameSujet;
commandes.PathBaseEvaluations=PathFilenameAnalysis;
commandes.evaluationsBase = nodeEvaluation;
commandes.PathBaseEvaluationDefaut=false;
}else {
ArrayList<node> A = nodeEvaluation.retourneEnfantsByName("evaluation", new ArrayList<node>());
for(int i = 0 ; i < A.size();i++) {
commandes.evaluationsBase.getNodes().add(A.get(i));
}
}
}else {
JFrame frame = new JFrame();
JLabel texte = new JLabel("<html><p>Ce n'est pas une base de données des évaluations.</p></html>");
JOptionPane.showMessageDialog(frame, texte);
}
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
} catch (FileNotFoundException e1) {
e1.printStackTrace();
} catch (Exception e) {
}
} }

View File

@ -34,7 +34,6 @@ import MEPTL.commandes;
import action.actOpenBaseEvaluation; import action.actOpenBaseEvaluation;
import baseEvaluations.chargeEvaluationSelected; import baseEvaluations.chargeEvaluationSelected;
import baseEvaluations.creerNouvelleEvaluation; import baseEvaluations.creerNouvelleEvaluation;
import baseEvaluations.ecritureBaseEvaluation;
import baseEvaluations.evaluationExist; import baseEvaluations.evaluationExist;
import baseEvaluations.myTableBaseEvaluation; import baseEvaluations.myTableBaseEvaluation;
import baseEvaluations.recupeNodeBaseEvaluations; import baseEvaluations.recupeNodeBaseEvaluations;
@ -243,7 +242,11 @@ public static baseDonneesEvaluations getInstance() {
selectRow(commandes.IndexEvaluationCharger); selectRow(commandes.IndexEvaluationCharger);
} }
isDispose=false; isDispose=false;
lblCheminVersBase.setText(commandes.PathBaseEvaluations); if(commandes.PathBaseEvaluationDefaut) {
lblCheminVersBase.setText(commandes.PathBaseEvaluations);
}else {
lblCheminVersBase.setText(commandes.PathBaseEvaluations+"/"+commandes.NameBaseEvaluations);
}
return instance; return instance;
} }
@ -360,7 +363,6 @@ private void ListenerAction() {
if(name!=null) { if(name!=null) {
if(!name.isBlank()) { if(!name.isBlank()) {
new creerNouvelleEvaluation(new node(),name,true); new creerNouvelleEvaluation(new node(),name,true);
new ecritureBaseEvaluation();
new recupeNodeBaseEvaluations(); new recupeNodeBaseEvaluations();
model.addOrUpdate(); model.addOrUpdate();
table.setModel(model); table.setModel(model);
@ -382,7 +384,6 @@ private void ListenerAction() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
new ChargePathBaseEvaluation(true); new ChargePathBaseEvaluation(true);
new trierParDateDecroissanteLaBase(); new trierParDateDecroissanteLaBase();
new ecritureBaseEvaluation();
model.addOrUpdate(); model.addOrUpdate();
table.setModel(model); table.setModel(model);
selectRow(commandes.IndexEvaluationCharger); selectRow(commandes.IndexEvaluationCharger);
@ -409,7 +410,11 @@ private void ListenerAction() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
new ChargePathBaseEvaluation(false); new ChargePathBaseEvaluation(false);
new actOpenBaseEvaluation(); new actOpenBaseEvaluation();
lblCheminVersBase.setText(commandes.PathBaseEvaluations); if(commandes.PathBaseEvaluationDefaut) {
lblCheminVersBase.setText(commandes.PathBaseEvaluations);
}else {
lblCheminVersBase.setText(commandes.PathBaseEvaluations+"/"+commandes.NameBaseEvaluations);
}
model.addOrUpdate(); model.addOrUpdate();
table = new JTable(model); table = new JTable(model);
} }
@ -469,29 +474,25 @@ private void ListenerAction() {
btnSaveEvaluation.addActionListener(new ActionListener() { btnSaveEvaluation.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(commandes.fichierAnalyseValide) { if(commandes.fichierAnalyseValide) {
String name ="Nom de l'évaluation"; String name ="Nom de l'évaluation";
if(lsm!=null) { if(lsm!=null) {
if (!lsm.isSelectionEmpty()) { if (!lsm.isSelectionEmpty()) {
indexSelect = lsm.getMinSelectionIndex(); indexSelect = lsm.getMinSelectionIndex();
name = model.getNameEvaluation(indexSelect); name = model.getNameEvaluation(indexSelect);
} }
} }
name = JOptionPane.showInputDialog(null,"Donner un nom ou renommer l'évaluation.",name);
name = JOptionPane.showInputDialog(null,"Donner un nom à cette évaluation ?",name);
if(name!=null) { if(name!=null) {
if(!name.isBlank()) { if(!name.isBlank()) {
if(evaluationExist.isEvaluationExist(name ,commandes.evaluationChargeEnMemoire.getAttributs().get("date"))) { if(evaluationExist.isEvaluationExist(commandes.evaluationChargeEnMemoire.getAttributs().get("date"))) {
new creerNouvelleEvaluation(commandes.evaluationsBase.retourneFirstNodeByNameAndAttributValueExactStrict("evaluation", "name", name), name,true); //L'évaluation existe déjà
new creerNouvelleEvaluation(commandes.evaluationChargeEnMemoire, name,true);
}else { }else {
new creerNouvelleEvaluation(new node(), name, false).getEvaluation(); // Nouvelle évaluation
new creerNouvelleEvaluation(new node(), name, false);
} }
new ecritureBaseEvaluation();
new trierParDateDecroissanteLaBase(); new trierParDateDecroissanteLaBase();
new recupeNodeBaseEvaluations(); new recupeNodeBaseEvaluations();
@ -531,7 +532,6 @@ private void ListenerAction() {
if(commandes.IndexEvaluationCharger>indexSelect) commandes.IndexEvaluationCharger--; if(commandes.IndexEvaluationCharger>indexSelect) commandes.IndexEvaluationCharger--;
} }
new ecritureBaseEvaluation();
new recupeNodeBaseEvaluations(); new recupeNodeBaseEvaluations();
model.addOrUpdate(); model.addOrUpdate();
table.setModel(model); table.setModel(model);
@ -573,7 +573,6 @@ private void ListenerAction() {
evaluation.retourneFirstEnfantsByName("fichier").getAttributs().put("analysis_filename", nomFichierAnalyse); evaluation.retourneFirstEnfantsByName("fichier").getAttributs().put("analysis_filename", nomFichierAnalyse);
evaluation.retourneFirstEnfantsByName("fichier").getAttributs().put("filenameAnalyse", nomFichierAnalyse); evaluation.retourneFirstEnfantsByName("fichier").getAttributs().put("filenameAnalyse", nomFichierAnalyse);
evaluation.getAttributs().put("analysis_filename", nomFichierAnalyse); evaluation.getAttributs().put("analysis_filename", nomFichierAnalyse);
new ecritureBaseEvaluation();
new recupeNodeBaseEvaluations(); new recupeNodeBaseEvaluations();
model.addOrUpdate(); model.addOrUpdate();
table.setModel(model); table.setModel(model);
@ -601,7 +600,6 @@ private void ListenerAction() {
if(!nomEvaluation.isBlank()) { if(!nomEvaluation.isBlank()) {
evaluation.getAttributs().put("name",nomEvaluation); evaluation.getAttributs().put("name",nomEvaluation);
new ecritureBaseEvaluation();
new recupeNodeBaseEvaluations(); new recupeNodeBaseEvaluations();
model.addOrUpdate(); model.addOrUpdate();
table.setModel(model); table.setModel(model);

View File

@ -547,6 +547,10 @@ public class evaluate extends JFrame {
private void createToolBar() { private void createToolBar() {
toolBar = new JToolBar(); toolBar = new JToolBar();
btnChargeEvaluation = toolBar.add( new actOpenBaseEvaluation()); btnChargeEvaluation = toolBar.add( new actOpenBaseEvaluation());
btnChargeEvaluation.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnChargeEvaluation.setIcon(new ImageIcon(create.class.getResource("/resources/chargehistoriqueevaluation.png"))); btnChargeEvaluation.setIcon(new ImageIcon(create.class.getResource("/resources/chargehistoriqueevaluation.png")));
btnChargeEvaluation.setHideActionText(true); btnChargeEvaluation.setHideActionText(true);
toolBar.add(btnChargeEvaluation); toolBar.add(btnChargeEvaluation);