MAJ V4.5.0

This commit is contained in:
pablo rodriguez 2024-04-13 13:19:50 +02:00
parent 4eb22b4ca2
commit ab1930d8d2
94 changed files with 222 additions and 44 deletions

View File

@ -12,6 +12,6 @@
<classpathentry kind="lib" path="C:/Users/pabr6/git/analyseWriter/MEPTL/miglayout15-swing.jar"/> <classpathentry kind="lib" path="C:/Users/pabr6/git/analyseWriter/MEPTL/miglayout15-swing.jar"/>
<classpathentry kind="lib" path="jgoodies-forms-1.8.0.jar" sourcepath="jgoodies-forms-1.8.0-sources.jar"/> <classpathentry kind="lib" path="jgoodies-forms-1.8.0.jar" sourcepath="jgoodies-forms-1.8.0-sources.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/Exportation documentation analyseWriter/plugins/documentation.analyseWriter_1.0.0.202212032022.jar"/> <classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/Exportation documentation analyseWriter/plugins/documentation.analyseWriter_1.0.0.202212032022.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar" sourcepath="/cXML"/> <classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

58
bin/.gitignore vendored
View File

@ -4,7 +4,56 @@
/baseEvaluations/ /baseEvaluations/
/calcul/ /calcul/
/evaluer/ /evaluer/
/evaluertrue.png
/evaluertruemini.png
/evalwriter.ico
/evalwriter.png
/evalwriter.svg
/evalwriter32.png
/exit.png
/exit.svg
/exitmini.png
/expandAll.svg
/expandNode.svg
/expandall.png
/expandallmini.png
/expandnode.png
/expandnodemini.png
/extraireFichierAnalyse.png
/extraireFichierAnalyseXML.svg
/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 /fichierCSVmax.png
/fichierCSVmini.png /fichierCSVmini.png
/fichierODF.png /fichierODF.png
@ -299,12 +348,3 @@
/zipstudent.png /zipstudent.png
/zipstudent.svg /zipstudent.svg
/zipstudentmini.png /zipstudentmini.png
/resources/
/actEvalEnteteActivefalse.png
/actEvalEnteteActivefalsemini.png
/actEvalEnteteActivetrue.png
/actEvalEnteteActivetruemini.png
/actEvalEntetePasActivefalse.png
/actEvalEntetePasActivefalsemini.png
/actEvalEntetePasActivetrue.png
/actEvalEntetePasActivetruemini.png

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

View File

@ -4,7 +4,7 @@
inkscape:export-xdpi="51.200001" inkscape:export-xdpi="51.200001"
inkscape:export-filename="evalnode." inkscape:export-filename="evalnode."
sodipodi:docname="evalnode.svg" sodipodi:docname="evalnode.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)" inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
id="svg8" id="svg8"
version="1.1" version="1.1"
viewBox="0 0 11.90625 11.90625" viewBox="0 0 11.90625 11.90625"
@ -37,8 +37,8 @@
inkscape:snap-global="false" inkscape:snap-global="false"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:window-y="-8" inkscape:window-y="-8"
inkscape:window-x="-8" inkscape:window-x="1912"
inkscape:window-height="1009" inkscape:window-height="1057"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:object-nodes="true" inkscape:object-nodes="true"
inkscape:bbox-nodes="true" inkscape:bbox-nodes="true"
@ -50,9 +50,9 @@
inkscape:document-rotation="0" inkscape:document-rotation="0"
inkscape:current-layer="g1030" inkscape:current-layer="g1030"
inkscape:document-units="mm" inkscape:document-units="mm"
inkscape:cy="28.82167" inkscape:cy="60.099364"
inkscape:cx="34.029324" inkscape:cx="33.960257"
inkscape:zoom="11.137453" inkscape:zoom="14.575861"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
borderopacity="1.0" borderopacity="1.0"

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

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.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
inkscape:export-xdpi="51.200001" inkscape:export-xdpi="51.200001"
inkscape:export-filename="evalnode." inkscape:export-filename="evalnode."
sodipodi:docname="evalnode.svg" sodipodi:docname="evalnode.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)" inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
id="svg8" id="svg8"
version="1.1" version="1.1"
viewBox="0 0 11.90625 11.90625" viewBox="0 0 11.90625 11.90625"
@ -37,8 +37,8 @@
inkscape:snap-global="false" inkscape:snap-global="false"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:window-y="-8" inkscape:window-y="-8"
inkscape:window-x="-8" inkscape:window-x="1912"
inkscape:window-height="1009" inkscape:window-height="1057"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:object-nodes="true" inkscape:object-nodes="true"
inkscape:bbox-nodes="true" inkscape:bbox-nodes="true"
@ -50,9 +50,9 @@
inkscape:document-rotation="0" inkscape:document-rotation="0"
inkscape:current-layer="g1030" inkscape:current-layer="g1030"
inkscape:document-units="mm" inkscape:document-units="mm"
inkscape:cy="28.82167" inkscape:cy="60.099364"
inkscape:cx="34.029324" inkscape:cx="33.960257"
inkscape:zoom="11.137453" inkscape:zoom="14.575861"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
borderopacity="1.0" borderopacity="1.0"

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -153,7 +153,10 @@ public class commandes {
public static StringBuilder message = new StringBuilder(); public static StringBuilder message = new StringBuilder();
//** base de données des évaluations //** base de données des évaluations
public static String PathBaseEvaluations = Paths.get("").toAbsolutePath().toString(); //Chemin vers la base de données /**
* Chemin vers le dossier de la base de données
*/
public static String PathBaseEvaluations = Paths.get("").toAbsolutePath().toString();
public static boolean PathBaseEvaluationDefaut = true; //Flag si ce n'est pas le chemin par défaut vers la base de données public static boolean PathBaseEvaluationDefaut = true; //Flag si ce n'est pas le chemin par défaut vers la base de données
public static String NameBaseEvaluations="base_evaluations_analyseWriter.xml"; //Nom par défaut de la base de données public static String NameBaseEvaluations="base_evaluations_analyseWriter.xml"; //Nom par défaut de la base de données
public static String NameEvaluationCharger = ""; public static String NameEvaluationCharger = "";

View File

@ -841,7 +841,7 @@ public class verificationFichierAnalyse_node_commandesSujet {
if(maj) { if(maj) {
commandes.sujet.getAttributs().put("hash", commandes.hash); commandes.sujet.getAttributs().put("hash", commandes.hash);
commandes.sujet.getAttributs().put("analysis_filename", commandes.nameSujet); if( commandes.nameSujet!=null)commandes.sujet.getAttributs().put("analysis_filename", commandes.nameSujet);
commandes.message.append("<hr><h1>Le hash du code de l'évaluation ou le nom du fichier d'analyse</h1><hr>"); commandes.message.append("<hr><h1>Le hash du code de l'évaluation ou le nom du fichier d'analyse</h1><hr>");
commandes.message.append("<p> a été mise à jour dans le fichier d'analyse.</p>"); commandes.message.append("<p> a été mise à jour dans le fichier d'analyse.</p>");

View File

@ -22,12 +22,13 @@ public class verificationNewVersion {
// String[] Version = commandes.version.split("\\.") // String[] Version = commandes.version.split("\\.")
// int versionIntegerApplication = Integer.valueOf( Version[0] + Version[1] + Version[2]); // int versionIntegerApplication = Integer.valueOf( Version[0] + Version[1] + Version[2]);
HttpURLConnection conn = null ;
try { try {
URL url = new URL("https://forge.chapril.org/pablo/analyseWriter/releases"); URL url = new URL("https://forge.chapril.org/pablo/analyseWriter/releases");
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET"); conn.setRequestMethod("GET");
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line; String line;
StringBuilder content = new StringBuilder(); StringBuilder content = new StringBuilder();
@ -35,7 +36,7 @@ public class verificationNewVersion {
content.append(line); content.append(line);
} }
reader.close(); reader.close();
conn.disconnect();
// Motif de la sous-chaîne recherchée Vx.x.x // Motif de la sous-chaîne recherchée Vx.x.x
String pattern = "V\\d+\\.\\d+\\.\\d+"; String pattern = "V\\d+\\.\\d+\\.\\d+";
@ -69,7 +70,7 @@ public class verificationNewVersion {
} }
} }
} catch (IOException e) { } catch (IOException e) {
if(conn!=null) conn.disconnect();
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@ -1,6 +1,7 @@
package evaluer; package evaluer;
import java.text.Normalizer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Dictionary; import java.util.Dictionary;
import java.util.Hashtable; import java.util.Hashtable;
@ -810,7 +811,7 @@ public class evaluation {
* @param B * @param B
* @return * @return
*/ */
private static String TraitementOUSupprimeChiffreEtsansCase(String A, String B) { private static String TraitementOUSupprimeChiffreEtsansCase(String A, String Sujet) {
if(A==null) A="none"; if(A==null) A="none";
if(A.isEmpty()) A="none"; if(A.isEmpty()) A="none";
@ -822,15 +823,16 @@ public class evaluation {
A= m.replaceAll(""); A= m.replaceAll("");
A=A.toLowerCase(); A=A.toLowerCase();
m = p.matcher(B); m = p.matcher(Sujet);
B = m.replaceAll(""); Sujet = m.replaceAll("");
B= B.toLowerCase(); Sujet= Sujet.toLowerCase();
A = NetTexte(A); A = NetTexte(A);
String TextB[] = B.split(""); String TextB[] = Sujet.split("");
for(int i=0;i<TextB.length;i++) { for(int i=0;i<TextB.length;i++) {
TextB[i] = NetTexte(TextB[i]); TextB[i] = NetTexte(TextB[i]);
if(A.equals(TextB[i].toLowerCase())) return "Correct : "; if(A.equals(TextB[i].toLowerCase())) return "Correct : ";
@ -918,9 +920,13 @@ public class evaluation {
A=A.replaceAll("[0-9]", ""); A=A.replaceAll("[0-9]", "");
A=A.replace(" ", ""); A=A.replace(" ", "");
A=A.toLowerCase(); A=A.toLowerCase();
// Normaliser la chaîne en forme décomposée pour séparer les caractères accentués
String normalized = Normalizer.normalize(A, Normalizer.Form.NFD);
// Supprime les caractères accentués diacritique
return normalized.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
} }
return A; return A;
} }

View File

@ -32,7 +32,7 @@ public class ChargeFichierXML extends JFileChooser {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* Chragement d'un fichier d'analyse.<br> * Chargement d'un fichier d'analyse.<br>
* Le premier node doit être le node fichier. * Le premier node doit être le node fichier.
*/ */
public ChargeFichierXML() { public ChargeFichierXML() {
@ -87,10 +87,13 @@ public class ChargeFichierXML 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
} }
commandes.PathFilenameAnalysis = commandes.path ;
String PathFilenameAnalysis = getCurrentDirectory().getPath(); String PathFilenameAnalysis = getCurrentDirectory().getPath();
String nameSujet = file.getName().toString(); String nameSujet = file.getName().toString();
BufferedReader br; BufferedReader br;
try { try {
br = new BufferedReader( br = new BufferedReader(

View File

@ -0,0 +1,43 @@
package fenetres;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
public class addAttributAndValue extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
addAttributAndValue frame = new addAttributAndValue();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public addAttributAndValue() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
}
}

View File

@ -42,6 +42,7 @@ public class attributs extends JFrame {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private JPanel contentPane; private JPanel contentPane;
private JPanel panelCentre = new JPanel();
node nod; node nod;
afficheText J; afficheText J;
int indexSelect=0; int indexSelect=0;
@ -50,7 +51,7 @@ public class attributs extends JFrame {
ArrayList<JTextField> Lesvaleurs = new ArrayList<JTextField>(); ArrayList<JTextField> Lesvaleurs = new ArrayList<JTextField>();
ArrayList<JCheckBox> Lesevaluer = new ArrayList<JCheckBox>(); ArrayList<JCheckBox> Lesevaluer = new ArrayList<JCheckBox>();
ArrayList<JTextField> Lespoints = new ArrayList<JTextField>(); ArrayList<JTextField> Lespoints = new ArrayList<JTextField>();
ArrayList<String> KeysAttribut = new ArrayList<String>();
/** /**
* Create the frame. * Create the frame.
*/ */
@ -97,11 +98,18 @@ public class attributs extends JFrame {
JButton btnAddAttribut = new JButton("Ajoute un attribut au node"); JButton btnAddAttribut = new JButton("Ajoute un attribut au node");
btnAddAttribut.addActionListener(new ActionListener() { btnAddAttribut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String nameAttribut="";
nameAttribut = JOptionPane.showInputDialog(null,"Quelle est la clé de l'attribut ?","");
if(nameAttribut!=null)if(!nameAttribut.isBlank()) {
nod.getAttributs().put(nameAttribut, "");
refresh();
}
} }
}); });
panelBas.add(btnAddAttribut); panelBas.add(btnAddAttribut);
panelBas.add(btnNewButton); panelBas.add(btnNewButton);
JButton btnValide = new JButton("Valider les modifications"); JButton btnValide = new JButton("Valider les modifications");
btnValide.setFont(new Font("Tahoma", Font.BOLD, 12)); btnValide.setFont(new Font("Tahoma", Font.BOLD, 12));
btnValide.setForeground(Color.RED); btnValide.setForeground(Color.RED);
@ -127,7 +135,6 @@ public class attributs extends JFrame {
JButton btnTextClean = new JButton("Text clean"); JButton btnTextClean = new JButton("Text clean");
btnTextClean.setToolTipText("<html>Texte nettoyé de tous les caractères spéciaux, chiffres et ignore la casse (équivalent à allContent=\"environ\").<br>Cette fonction ne peut pas être combinée avec les autres fonctions ci-dessous.<br>Ce n'est pas un opérateur OU contrairement à l'opérateur ↕.<br>La tolérance de texte (90% de similitude avec le texte de la consigne) paramètre dans les setting. (exemple : ¢‽2) </html>"); btnTextClean.setToolTipText("<html>Texte nettoyé de tous les caractères spéciaux, chiffres et ignore la casse (équivalent à allContent=\"environ\").<br>Cette fonction ne peut pas être combinée avec les autres fonctions ci-dessous.<br>Ce n'est pas un opérateur OU contrairement à l'opérateur ↕.<br>La tolérance de texte (90% de similitude avec le texte de la consigne) paramètre dans les setting. (exemple : ¢‽2) </html>");
btnTextClean.addActionListener(new ActionListener() { btnTextClean.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
int j = Lesvaleurs.get(indexSelect).getCaretPosition(); int j = Lesvaleurs.get(indexSelect).getCaretPosition();
System.out.println("position du cursor "+ j); System.out.println("position du cursor "+ j);
@ -217,7 +224,7 @@ public class attributs extends JFrame {
JScrollPane scrollPaneCentre = new JScrollPane(); JScrollPane scrollPaneCentre = new JScrollPane();
contentPane.add(scrollPaneCentre, BorderLayout.CENTER); contentPane.add(scrollPaneCentre, BorderLayout.CENTER);
JPanel panelCentre = new JPanel();
scrollPaneCentre.setViewportView(panelCentre); scrollPaneCentre.setViewportView(panelCentre);
panelCentre.setLayout(new MigLayout("gap rel 0", "[100px:n,grow][150px:n,grow 150][::80px][80px:n]", panelCentre.setLayout(new MigLayout("gap rel 0", "[100px:n,grow][150px:n,grow 150][::80px][80px:n]",
"[::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px]")); "[::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px]"));
@ -270,6 +277,8 @@ public class attributs extends JFrame {
Lesvaleurs.add(txtFielValue); Lesvaleurs.add(txtFielValue);
Lespoints.add(txtFielPoints); Lespoints.add(txtFielPoints);
Lesevaluer.add(checkEval); Lesevaluer.add(checkEval);
KeysAttribut.add(k);
} }
} }
@ -366,6 +375,69 @@ public class attributs extends JFrame {
} }
private void refresh() {
Enumeration<String> key = nod.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if(!listeAttributsAnalyseWriter.isAttributAnalyseWriter(k)) {
String value = nod.getAttributs().get(k);
String point = "0";
JCheckBox checkEval = new JCheckBox();
boolean evaluer = false;
if(value.contains("")||value.contains("")) {
evaluer=true;
if(value.contains("")) {
point = value.substring(value.lastIndexOf("")+1,value.length());
value = value.substring(0,value.lastIndexOf(""));
}
if(value.contains("")) {
point = value.substring(value.lastIndexOf("")+1,value.length());
value = value.substring(0,value.lastIndexOf(""));
}
}
JTextField txtFielPoints = new JTextField(point);
JTextField txtFielValue = new JTextField(value);
txtFielValue.addMouseListener(new MyMouseListener());
txtFielPoints.setColumns(3);
checkEval.setSelected(evaluer);
if(!KeysAttribut.contains(k)) {
Leslabels.add(new JLabel(k));
Lesvaleurs.add(txtFielValue);
Lespoints.add(txtFielPoints);
Lesevaluer.add(checkEval);
KeysAttribut.add(k);
}
}
}
//Placement dans le panel des informations
for(int i = 0 ; i<Leslabels.size();i++) {
Leslabels.get(i).setFont(new Font("Tahoma", Font.BOLD, 11));
Lesvaleurs.get(i).setColumns(10);
panelCentre.add(Leslabels.get(i), "cell 0 "+i+1);
panelCentre.add(Lesvaleurs.get(i), "cell 1 "+i+1 + ",grow");
panelCentre.add(Lesevaluer.get(i), "cell 2 "+i+1);
panelCentre.add(Lespoints.get(i), "cell 3 " + i+1 +",alignx left,growy");
}
//Enabled false les valeurs ne peuvent pas être modifiées.
//Enabled false les evaluer si pas evaluable.
for(int i = 0 ; i<Leslabels.size();i++) {
if(listeAttributWriterValeurPasModifiable.isNotModifiable(Leslabels.get(i).getText())) {Lesvaleurs.get(i).setEnabled(false);}
if(listeAttributWriterPasEvaluableAvecCodeEvaluateur.isNotEvaluable(Leslabels.get(i).getText())) {Lesevaluer.get(i).setEnabled(false);Lespoints.get(i).setEnabled(false);}
// Important
//exception avec text:section et son attribut text:name qui doit être évaluable
if(nod.getNomElt().equals("text:section") && Leslabels.get(i).getText().equals("text:name")) {Lesvaleurs.get(i).setEnabled(true);Lesevaluer.get(i).setEnabled(true);Lespoints.get(i).setEnabled(true);}
}
}

View File

@ -337,17 +337,26 @@ private void ListenerAction() {
if(lsm!=null) { if(lsm!=null) {
if (!lsm.isSelectionEmpty()) { if (!lsm.isSelectionEmpty()) {
node evaluation = chargeEvaluation.retourneEvaluationSelected(indexSelect); node evaluation = chargeEvaluation.retourneEvaluationSelected(indexSelect);
String nameFile = evaluation.getAttributs().get("analysis_filename"); String nameFile ="fichier analyse.xml";
if(evaluation.getAttributs().get("analysis_filename")!=null) {
nameFile = evaluation.getAttributs().get("analysis_filename");
}
JFileChooser fileChooser = new JFileChooser(); JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Enregistrer sous..."); fileChooser.setDialogTitle("Enregistrer sous...");
File file = null; File file = null;
String analysis_filename =""; String analysis_filename ="";
if(!evaluation.getAttributs().get("analysis_filename").isEmpty()) { if(evaluation.getAttributs().get("analysis_filename")!=null) {
file = new File(commandes.PathBaseEvaluations); if(!evaluation.getAttributs().get("analysis_filename").isEmpty()) {
analysis_filename = evaluation.getAttributs().get("analysis_filename"); file = new File(commandes.PathBaseEvaluations);
} analysis_filename = evaluation.getAttributs().get("analysis_filename");
}
}else {
file = new File(commandes.PathBaseEvaluations);
}
fileChooser.setCurrentDirectory(file); fileChooser.setCurrentDirectory(file);
fileChooser.setSelectedFile(new File(nameFile)); fileChooser.setSelectedFile(new File(nameFile));