Skip to content

Commit

Permalink
🐛 Correction sur l'Historique
Browse files Browse the repository at this point in the history
  • Loading branch information
ctruillet committed Apr 29, 2020
1 parent bbb1d0e commit 94c588d
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 1 deletion.
Binary file modified seekfox.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions src/modele/Historique.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ private static Resultat toResultat (String recup) {
case "MOTCLEF_COMPLEXE":
type = TypeRequete.MOTCLEF_COMPLEXE;
break;
case "COULEURDOMINANTE":
type = TypeRequete.COULEURDOMINANTE;
break;
default :
type = TypeRequete.FIN;
break;
Expand Down
8 changes: 8 additions & 0 deletions src/modele/Resultat.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ public String getRequete() {
return requete;
}

public void setRequete(String requete){
this.requete=requete;
}

public TypeRequete getType() {
return type;
}

public void setType(TypeRequete type){
this.type=type;
}

public ArrayList<CelluleResultat> getResultats() {
return resultats;
}
Expand Down
9 changes: 9 additions & 0 deletions src/modele/TypeRecherche.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class TypeRecherche {
private static TypeRecherche INSTANCE = null;
private TypeRequete typeRequete;
private boolean isMultimoteur = false;
private String requete = "";


//Constructeur
Expand Down Expand Up @@ -42,4 +43,12 @@ public boolean isMultimoteur() {
public void setMultimoteur(boolean multimoteur) {
isMultimoteur = multimoteur;
}

public String getRequete() {
return requete;
}

public void setRequete(String requete) {
this.requete = requete;
}
}
4 changes: 3 additions & 1 deletion src/vue/HistoryScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ public void sauvegarderRecherche(Resultat recherche){
break;
case MOTCLEF:
case MOTCLEF_COMPLEXE:
default:
requete = recherche.getRequete();
break;
default:
requete = "null";
break;

}

Expand Down
2 changes: 2 additions & 0 deletions src/vue/ResultsScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public void mousePressed(){
public void mouseReleased(){
resultsViewer.release();
if(saveButton.release()) {
results.setRequete(TypeRecherche.getINSTANCE().getRequete());
results.setType(TypeRecherche.getINSTANCE().getTypeRequete());
Historique.addHistorique(results);
nextScreen = ScreenName.MAIN;
}
Expand Down
3 changes: 3 additions & 0 deletions src/vue/SearchConfigImgScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ public void runRecherche(){
if(file!=null){
if(file.getParent().endsWith("RGB")){
TypeRecherche.getINSTANCE().setTypeRequete(TypeRequete.IMAGE);
TypeRecherche.getINSTANCE().setRequete("./baseDeDocuments/Image/RGB/" + file.getName());
for (ControlRequete controlRequete : listControlRequete) {
controlRequete.runRecherche(TypeRequete.IMAGE, "./baseDeDocuments/Image/RGB/" + file.getName());
}

}else if(file.getParent().endsWith("NB")){
TypeRecherche.getINSTANCE().setTypeRequete(TypeRequete.IMAGE);
TypeRecherche.getINSTANCE().setRequete("./baseDeDocuments/Image/NB/" + file.getName());
for (ControlRequete controlRequete : listControlRequete) {
controlRequete.runRecherche(TypeRequete.IMAGE, "./baseDeDocuments/Image/NB/" + file.getName());
}
Expand All @@ -205,6 +207,7 @@ public void runRecherche(){
}
}else {
TypeRecherche.getINSTANCE().setTypeRequete(TypeRequete.COULEURDOMINANTE);
TypeRecherche.getINSTANCE().setRequete("" + Integer.toHexString(color.getRGB()).substring(2));
for (ControlRequete controlRequete : listControlRequete) {
controlRequete.runRecherche(TypeRequete.COULEURDOMINANTE, "" + Integer.toHexString(color.getRGB()).substring(2));
}
Expand Down
1 change: 1 addition & 0 deletions src/vue/SearchConfigSndScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public void runRecherche(){
try { //Lancer la recherche
if(file!=null){
TypeRecherche.getINSTANCE().setTypeRequete(TypeRequete.AUDIO);
TypeRecherche.getINSTANCE().setRequete("./baseDeDocuments/Audio/" + file.getName());
for (ControlRequete controlRequete : listControlRequete) {
controlRequete.runRecherche(TypeRequete.AUDIO, "./baseDeDocuments/Audio/" + file.getName());
}
Expand Down
2 changes: 2 additions & 0 deletions src/vue/SearchConfigTxtScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public void runRecherche(){
if(isRechercheTexte){
if(file!=null){
TypeRecherche.getINSTANCE().setTypeRequete(TypeRequete.TEXTE);
TypeRecherche.getINSTANCE().setRequete("./baseDeDocuments/Texte/" + file.getName());
for (ControlRequete controlRequete : listControlRequete) {
controlRequete.runRecherche(TypeRequete.TEXTE, "./baseDeDocuments/Texte/" + file.getName());
}
Expand All @@ -148,6 +149,7 @@ public void runRecherche(){
}else {
if(searchBox.getWrittenText()!=""){
TypeRecherche.getINSTANCE().setTypeRequete(TypeRequete.MOTCLEF);
TypeRecherche.getINSTANCE().setRequete(searchBox.getWrittenText());

for (ControlRequete controlRequete : listControlRequete) {
controlRequete.runRechercheComplexe(searchBox.getWrittenText());
Expand Down

0 comments on commit 94c588d

Please sign in to comment.