barre de recherche fonctionnelle

This commit is contained in:
Djalim Simaila 2022-06-07 15:55:52 +02:00
parent 4a0793217a
commit 65dfbf5f25
4 changed files with 29 additions and 12 deletions

View File

@ -28,7 +28,6 @@ public class Main extends Application {
}
public static void main(String[] args) throws InterruptedException {
Thread.sleep(5000);
launch(args);
}
}

View File

@ -20,6 +20,7 @@ import javafx.fxml.Initializable;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
@ -44,6 +45,9 @@ public class Controller implements Initializable {
@FXML
private Pane stackPaneFrance;
@FXML
private TextField barreDeRecherche;
@FXML
private AnchorPane discipline;
@ -53,6 +57,9 @@ public class Controller implements Initializable {
@FXML
private Button recherche;
@FXML
private Button rechercheTextuelle;
// Style des boutons
Background btNormalBackground = new Background(new BackgroundFill(Color.rgb(255,110,64), new CornerRadii(30), Insets.EMPTY));
Background btNormalHover = new Background(new BackgroundFill(Color.rgb(255,152,120), new CornerRadii(30), Insets.EMPTY));
@ -175,11 +182,10 @@ public class Controller implements Initializable {
placeButtonThematique();
placeButtonDiscipline();
EventHandler<ActionEvent> handler = event ->{
//TODO Recherche en fonctions des objets selectionnés
Donnees.setUsagesObtenus(daoUsage.findByCriterias(Donnees.getThematiqueSelectionee(),Donnees.getDisciplineSelectionee(),Donnees.getAcademieSelectionee()));
EventHandler<ActionEvent> handleRechercheTextuelle = event ->{
Donnees.setUsagesObtenus(daoUsage.findByNamePart(barreDeRecherche.getText()));
Stage resultats = new Stage();
try {
resultats.setScene(new Scene(FXMLLoader.load(getClass().getResource("/fr/univ_amu/iut/fResultat/FResultat.fxml"))));
@ -187,8 +193,21 @@ public class Controller implements Initializable {
} catch (IOException e) {
e.printStackTrace();
}
};
recherche.setOnAction(handler);
rechercheTextuelle.setOnAction(handleRechercheTextuelle);
EventHandler<ActionEvent> handleRechercheCrieters = event ->{
System.out.println("test");
Donnees.setUsagesObtenus(daoUsage.findByCriterias(Donnees.getThematiqueSelectionee(),Donnees.getDisciplineSelectionee(),Donnees.getAcademieSelectionee()));
Stage resultats = new Stage();
try {
resultats.setScene(new Scene(FXMLLoader.load(getClass().getResource("/fr/univ_amu/iut/fResultat/FResultat.fxml"))));
resultats.show();
} catch (IOException e) {
e.printStackTrace();
}
};
recherche.setOnAction(handleRechercheCrieters);
}
}

View File

@ -7,17 +7,17 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.StackPane?>
<AnchorPane id="root" prefHeight="798.0" prefWidth="1365.0" style="-fx-background-color: #f5f0e1#f5f0e1;" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univ_amu.iut.fp.Controller">
<AnchorPane id="root" prefHeight="860.0" prefWidth="1365.0" style="-fx-background-color: #f5f0e1#f5f0e1;" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univ_amu.iut.fp.Controller">
<children>
<StackPane id="stackPaneFrance" fx:id="stackPaneFrance" layoutX="43.0" layoutY="92.0" prefHeight="649.0" prefWidth="642.0" style="-fx-background-color: blue;" />
<AnchorPane layoutX="11.0" prefHeight="80.0" prefWidth="1019.0" style="-fx-background-color: #1e3d59#1e3d59;" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<children>
<TextField id="barreDeRecherche " layoutX="329.0" layoutY="27.0" prefHeight="27.0" prefWidth="372.0" promptText="Entrer nom projet :" style="-fx-background-color: #CDD0D4#CDD0D4; -fx-border-radius: 5em; -fx-background-radius: 5em;" text=" " AnchorPane.leftAnchor="329.0" AnchorPane.rightAnchor="329.0">
<TextField fx:id="barreDeRecherche" id="barreDeRecherche" layoutX="329.0" layoutY="27.0" prefHeight="27.0" prefWidth="372.0" promptText="Entrer nom projet :" style="-fx-background-color: #CDD0D4#CDD0D4; -fx-border-radius: 5em; -fx-background-radius: 5em;" text=" " AnchorPane.leftAnchor="329.0" AnchorPane.rightAnchor="329.0">
<cursor>
<Cursor fx:constant="TEXT" />
</cursor>
</TextField>
<Button layoutX="1066.0" layoutY="27.0" mnemonicParsing="false" text="RECHERCHER VIA LE NOM" />
<Button fx:id="rechercheTextuelle" layoutX="1066.0" layoutY="27.0" mnemonicParsing="false" text="RECHERCHER VIA LE NOM" />
</children>
</AnchorPane>
<StackPane layoutX="744.0" layoutY="100.0" prefHeight="181.0" prefWidth="622.0" style="-fx-background-color: none;" AnchorPane.rightAnchor="-1.0" AnchorPane.topAnchor="100.0">
@ -26,7 +26,6 @@
<content>
<AnchorPane id="discipline" fx:id="discipline" minHeight="0.0" minWidth="0.0" prefHeight="442.0" prefWidth="620.0" style="-fx-background-color: #f5f0e1#f5f0e1;">
<children>
</children>
</AnchorPane>
</content>

View File

@ -7,7 +7,7 @@
<properties>
<!-- database connection properties -->
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://localhost/devapp"/>
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://lagrottedeneotaku.hopto.org:6776/devapp"/>
<property name="jakarta.persistence.jdbc.user" value="devapp"/>
<property name="jakarta.persistence.jdbc.password" value="7kPoWBgoV5ahygxyXYGzaL"/>
<!-- Nous ne devrions pas commit le mot de passe dans le dépot, mais... je ne pense pas que le projet ne respecte la moindre règle de sécurité de toute facon (pas d'architecture trois tiers)-->