MAJ fenêtre setting
This commit is contained in:
parent
5a98ba1fa1
commit
31a3ae1455
@ -796,11 +796,86 @@ public final class setting extends JFrame {
|
||||
if (instance == null) {
|
||||
instance = new setting();
|
||||
}
|
||||
instance.setVisible(true);
|
||||
if(instance.actualise()) {
|
||||
instance.setVisible(true);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
private boolean actualise() {
|
||||
Boolean Valide = true;
|
||||
node nodCSV = commandes.sujet.retourneFirstEnfantsByName("csv");
|
||||
if(nodCSV==null) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Problème avec le fichier d'analyse.<br>Le node csv n'est pas dans le fichier.</html>");
|
||||
Valide =false;
|
||||
}
|
||||
node nodImportMoodle = commandes.sujet.retourneFirstEnfantsByName("import_moodle");
|
||||
if(nodImportMoodle==null) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Problème avec le fichier d'analyse.<br>le node import_moodle n'est pas dans le fichier d'analyse.</html>");
|
||||
Valide =false;
|
||||
}
|
||||
node nodZIP = commandes.sujet.retourneFirstEnfantsByName("zip");
|
||||
if(nodZIP==null) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Problème avec le fichier d'analyse.<br>Le node zip n'est pas dans le fichier.</html>");
|
||||
Valide =false;
|
||||
}
|
||||
node nodTriche = commandes.sujet.retourneFirstEnfantsByName("plagiarism");
|
||||
if(nodTriche==null) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Problème avec le fichier d'analyse.<br>Le node plagiarism n'est pas dans le fichier.</html>");
|
||||
Valide =false;
|
||||
}
|
||||
node nodSimilitude = commandes.sujet.retourneFirstEnfantsByName("text:similarity");
|
||||
if(nodSimilitude==null) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Problème avec le fichier d'analyse.<br>Le node text:similarity n'est pas dans le fichier.</html>");
|
||||
Valide =false;
|
||||
}
|
||||
node nodColor = commandes.sujet.retourneFirstEnfantsByName("color");
|
||||
if(nodColor==null) {
|
||||
JOptionPane.showMessageDialog(null, "<html>Problème avec le fichier d'analyse.<br>Le node color n'est pas dans le fichier.</html>");
|
||||
Valide =false;
|
||||
}
|
||||
|
||||
if(!Valide) return Valide;
|
||||
|
||||
if(nodCSV.getAttributs().get("encoding")!=null) comboBoxEncodage.setSelectedItem(nodCSV.getAttributs().get("encoding"));
|
||||
if(nodCSV.getAttributs().get("separator")!=null) comboBoxSeparateur.setSelectedItem(nodCSV.getAttributs().get("separator"));
|
||||
|
||||
if(nodImportMoodle.getAttributs().get("name")!=null) textFieldNomEtudiant.setText(nodImportMoodle.getAttributs().get("name"));
|
||||
if(nodImportMoodle.getAttributs().get("firstname")!=null) textFieldPrenomEtudiant.setText(nodImportMoodle.getAttributs().get("firstname"));
|
||||
if(nodImportMoodle.getAttributs().get("email")!=null) textFieldEmail.setText(nodImportMoodle.getAttributs().get("email"));
|
||||
if(nodImportMoodle.getAttributs().get("id")!=null) textFieldIDEtudiant.setText(nodImportMoodle.getAttributs().get("id"));
|
||||
|
||||
if(nodZIP.getAttributs().get("size")!=null) {
|
||||
Integer size = 0;
|
||||
try {
|
||||
size = Integer.valueOf(nodZIP.getAttributs().get("size"));
|
||||
size = size/1000000;
|
||||
size = size + 2;
|
||||
}catch (Exception e) {
|
||||
JOptionPane.showInternalMessageDialog(null, "Il y a un problème avec la taille de l'archive dans le fichier d'analyse.");
|
||||
return false;
|
||||
}
|
||||
textFieldSize.setText(String.valueOf(size));
|
||||
}
|
||||
if(nodZIP.getAttributs().get("nameZip")!=null) textFieldNameZIP.setText(nodZIP.getAttributs().get("nameZip"));
|
||||
|
||||
if(nodTriche.getAttributs().get("number_match")!=null) textFieldMiniCorrespondance.setText(nodTriche.getAttributs().get("number_match"));
|
||||
if(nodTriche.getAttributs().get("mini_number_modification")!=null) textFieldNbrMiniModification.setText(nodTriche.getAttributs().get("mini_number_modification"));
|
||||
if(nodTriche.getAttributs().get("nombres_modifications_simultané_maxi")!=null) textFieldMaxiModificationSimul.setText(nodTriche.getAttributs().get("nombres_modifications_simultané_maxi"));
|
||||
|
||||
if(nodSimilitude.getAttributs().get("tolerance_text")!=null) textFieldTextSimilitude.setText(nodSimilitude.getAttributs().get("tolerance_text"));
|
||||
|
||||
if(nodColor.getAttributs().get("tolerance_rouge")!=null) textFieldRouge.setText(nodColor.getAttributs().get("tolerance_rouge"));
|
||||
if(nodColor.getAttributs().get("tolerance_vert")!=null) textFieldVert.setText(nodColor.getAttributs().get("tolerance_vert"));
|
||||
if(nodColor.getAttributs().get("tolerance_bleu")!=null) textFieldBleu.setText(nodColor.getAttributs().get("tolerance_bleu"));
|
||||
|
||||
return Valide;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* vérification des valeurs saisies dans la fenêtre setting.
|
||||
* @return
|
||||
|
Loading…
x
Reference in New Issue
Block a user