commit
b04aac6a08
55
src/main/java/fr/univ_amu/iut/Donnees.java
Normal file
55
src/main/java/fr/univ_amu/iut/Donnees.java
Normal file
@ -0,0 +1,55 @@
|
||||
package fr.univ_amu.iut;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import fr.univ_amu.iut.model.Academie;
|
||||
import fr.univ_amu.iut.model.Discipline;
|
||||
import fr.univ_amu.iut.model.Thematique;
|
||||
import fr.univ_amu.iut.model.Usage;
|
||||
|
||||
public class Donnees {
|
||||
private static Academie academieSelectionee = null;
|
||||
private static Thematique thematiqueSelectionee = null;
|
||||
private static Discipline disciplineSelectionee = Discipline.Toutes;
|
||||
private static List<Usage> usagesObtenus;
|
||||
|
||||
public static List<Usage> getUsagesObtenus() {
|
||||
return usagesObtenus;
|
||||
}
|
||||
public static void setUsagesObtenus(List<Usage> usagesObtenus) {
|
||||
Donnees.usagesObtenus = usagesObtenus;
|
||||
}
|
||||
public static Academie getAcademieSelectionee() {
|
||||
return academieSelectionee;
|
||||
}
|
||||
public static void setAcademieSelectionee(Academie academieSelectionee) {
|
||||
if (academieSelectionee.equals(Donnees.academieSelectionee)){
|
||||
academieSelectionee = null;
|
||||
}
|
||||
System.out.println("Academie Selectionée : %s".formatted((academieSelectionee == null)?"Aucune academie":academieSelectionee.getNom()));
|
||||
Donnees.academieSelectionee = academieSelectionee;
|
||||
}
|
||||
public static Thematique getThematiqueSelectionee() {
|
||||
return thematiqueSelectionee;
|
||||
}
|
||||
public static void setThematiqueSelectionee(Thematique thematiqueSelectionee) {
|
||||
if(thematiqueSelectionee == Donnees.thematiqueSelectionee){
|
||||
thematiqueSelectionee = null;
|
||||
}
|
||||
System.out.println("Thematique selectionée : %s".formatted((thematiqueSelectionee == null)? "Aucune Thematique" : thematiqueSelectionee.getNom()));
|
||||
Donnees.thematiqueSelectionee = thematiqueSelectionee;
|
||||
}
|
||||
public static Discipline getDisciplineSelectionee() {
|
||||
return disciplineSelectionee;
|
||||
}
|
||||
public static void setDisciplineSelectionee(Discipline disciplineSelectionee) {
|
||||
if(disciplineSelectionee == Donnees.disciplineSelectionee){
|
||||
disciplineSelectionee = Discipline.Toutes;
|
||||
}
|
||||
System.out.println("Discipline Selectionee : %s".formatted(disciplineSelectionee.getNom()));
|
||||
Donnees.disciplineSelectionee = disciplineSelectionee;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package fr.univ_amu.iut;
|
||||
|
||||
import fr.univ_amu.iut.dao.factory.DAOFactoryProducer;
|
||||
import fr.univ_amu.iut.dao.factory.DAOType;
|
||||
import fr.univ_amu.iut.model.RegionAcademique;
|
||||
import fr.univ_amu.iut.view.map.AcademiePath;
|
||||
import fr.univ_amu.iut.view.map.France;
|
||||
import fr.univ_amu.iut.view.map.FranceBuilder;
|
||||
import javafx.application.Application;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.Background;
|
||||
import javafx.scene.layout.BackgroundFill;
|
||||
import javafx.scene.layout.CornerRadii;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class FranceMain extends Application {
|
||||
France france;
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
france = FranceBuilder.create()
|
||||
// .backgroundColor(Color.web("#4aa9d7"))
|
||||
// .fillColor(Color.web("#dcb36c"))
|
||||
// .strokeColor(Color.web("#987028"))
|
||||
// .hoverColor(Color.web("#fec47e"))
|
||||
// .pressedColor(Color.web("#6cee85"))
|
||||
// .selectedColor(Color.MAGENTA)
|
||||
// .mousePressHandler(evt -> {
|
||||
// AcademiePath academiePath = (AcademiePath) evt.getSource();
|
||||
// System.out.println("On vient de cliquer sur l'"+academiePath.getAcademie().getNom());
|
||||
// })
|
||||
.selectionEnabled(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) {
|
||||
StackPane pane = new StackPane(france);
|
||||
pane.setBackground(new Background(new BackgroundFill(france.getBackgroundColor(), CornerRadii.EMPTY, Insets.EMPTY)));
|
||||
Scene scene = new Scene(pane);
|
||||
stage.setTitle("Carte des académie");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
DAOFactoryProducer.getFactory(DAOType.JPA).createDAOUsage();
|
||||
// launch(args);
|
||||
}
|
||||
}
|
34
src/main/java/fr/univ_amu/iut/Main.java
Normal file
34
src/main/java/fr/univ_amu/iut/Main.java
Normal file
@ -0,0 +1,34 @@
|
||||
package fr.univ_amu.iut;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import fr.univ_amu.iut.screenController.ScreenController;
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class Main extends Application {
|
||||
private Scene scene = new Scene(new Pane());
|
||||
private ScreenController gestionnaireDePages = new ScreenController(scene);
|
||||
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException{
|
||||
ScreenController.addScreen("Acceuil",FXMLLoader.load(getClass().getResource("/fr/univ_amu/iut/fp/fp.fxml")));
|
||||
|
||||
//TODO Ajouter les pages d'admin pour l'ajout des usages
|
||||
//ScreenController.addScreen("admin1",pane);
|
||||
//ScreenController.addScreen("admin2",pane);
|
||||
|
||||
ScreenController.activate("Acceuil");
|
||||
stage.setTitle("Carte des académie");
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
Thread.sleep(5000);
|
||||
launch(args);
|
||||
}
|
||||
}
|
@ -10,43 +10,45 @@ import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
import fr.univ_amu.iut.Donnees;
|
||||
import fr.univ_amu.iut.model.Usage;
|
||||
|
||||
public class Controller implements Initializable{
|
||||
|
||||
@FXML
|
||||
private TableColumn<Utilisateur, String> Disciplines;
|
||||
private TableView<TableEntry> table;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Utilisateur, String> Niveaux;
|
||||
private TableColumn<TableEntry, String> discipline;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Utilisateur, String> Noms;
|
||||
private TableColumn<TableEntry, String> niveau;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Utilisateur, Integer> Numéro;
|
||||
private TableColumn<TableEntry, String> nom;
|
||||
|
||||
@FXML
|
||||
private TableView<Utilisateur> Table;
|
||||
|
||||
@FXML
|
||||
private TableColumn<Utilisateur, String> Types;
|
||||
|
||||
ObservableList<Utilisateur> list = FXCollections.observableArrayList(
|
||||
new Utilisateur(1,"Patrik","Maht","Blog","Terminal"),
|
||||
new Utilisateur(2,"Mark","Chimie","Site","Seconde")
|
||||
);
|
||||
private TableColumn<TableEntry, String> description;
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||
Noms.setCellValueFactory(new PropertyValueFactory<Utilisateur, String>("Noms"));
|
||||
Numéro.setCellValueFactory(new PropertyValueFactory<Utilisateur, Integer>("Numéro"));
|
||||
Disciplines.setCellValueFactory(new PropertyValueFactory<Utilisateur, String>("Disciplines"));
|
||||
Types.setCellValueFactory(new PropertyValueFactory<Utilisateur, String>("Types"));
|
||||
Niveaux.setCellValueFactory(new PropertyValueFactory<Utilisateur, String>("Niveaux"));
|
||||
|
||||
Table.setItems(list);
|
||||
|
||||
|
||||
|
||||
List<TableEntry> entries = new ArrayList<>();
|
||||
for (Usage usage: Donnees.getUsagesObtenus()){
|
||||
entries.add(new TableEntry(usage));
|
||||
}
|
||||
ObservableList<TableEntry> tableEntries = FXCollections.observableArrayList(entries);
|
||||
table.setItems(tableEntries);
|
||||
|
||||
nom.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("nom"));
|
||||
discipline.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("discipline"));
|
||||
description.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("description"));
|
||||
niveau.setCellValueFactory(new PropertyValueFactory<TableEntry, String>("niveau"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,13 +6,12 @@
|
||||
|
||||
<AnchorPane prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #1e3d59#1e3d59;" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univ_amu.iut.fResultat.Controller">
|
||||
<children>
|
||||
<TableView fx:id="Table" layoutX="10.0" layoutY="10.0" prefHeight="380.0" prefWidth="580.0" style="-fx-background-radius: 20; -fx-border-color: #1e3d59#1e3d59; -fx-background-color: #f5f0e1#f5f0e1;" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="10.0">
|
||||
<TableView fx:id="table" layoutX="10.0" layoutY="10.0" prefHeight="380.0" prefWidth="580.0" style="-fx-background-radius: 20; -fx-border-color: #1e3d59#1e3d59; -fx-background-color: #f5f0e1#f5f0e1;" AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="10.0">
|
||||
<columns>
|
||||
<TableColumn fx:id="Numéro" prefWidth="75.0" text="Numéro" />
|
||||
<TableColumn fx:id="Noms" prefWidth="121.0" text="Noms" />
|
||||
<TableColumn fx:id="Disciplines" prefWidth="128.0" text="Disciplines" />
|
||||
<TableColumn fx:id="Types" prefWidth="124.0" text="Types" />
|
||||
<TableColumn fx:id="Niveaux" minWidth="8.0" prefWidth="130.0" text="Niveaux" />
|
||||
<TableColumn fx:id="nom" prefWidth="121.0" text="Nom" />
|
||||
<TableColumn fx:id="discipline" prefWidth="128.0" text="Disciplines" />
|
||||
<TableColumn fx:id="niveau" minWidth="8.0" prefWidth="130.0" text="Niveaux" />
|
||||
<TableColumn fx:id="description" prefWidth="124.0" text="Description" />
|
||||
</columns>
|
||||
</TableView>
|
||||
</children>
|
||||
|
@ -1,24 +0,0 @@
|
||||
package fr.univ_amu.iut.fResultat;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
|
||||
|
||||
public class Main extends Application {
|
||||
|
||||
public static void main(String[] args) {launch(args);}
|
||||
@Override
|
||||
public void start(Stage stage) throws Exception {
|
||||
try {
|
||||
AnchorPane root = FXMLLoader.load(getClass().getResource("/fr/univ_amu/iut/fResultat/FResultat.fxml"));
|
||||
stage.setScene(new Scene(root));
|
||||
stage.show();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
54
src/main/java/fr/univ_amu/iut/fResultat/TableEntry.java
Normal file
54
src/main/java/fr/univ_amu/iut/fResultat/TableEntry.java
Normal file
@ -0,0 +1,54 @@
|
||||
package fr.univ_amu.iut.fResultat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import fr.univ_amu.iut.model.Usage;
|
||||
|
||||
public class TableEntry {
|
||||
|
||||
private String nom;
|
||||
private String discipline;
|
||||
private String description;
|
||||
private String niveau;
|
||||
|
||||
public TableEntry(Usage usage) {
|
||||
nom = usage.getNom();
|
||||
discipline = usage.getDiscipline().getNom();
|
||||
description = usage.getDescription();
|
||||
niveau = usage.getNiveau().getNom();
|
||||
}
|
||||
|
||||
public String getNom() {
|
||||
return nom;
|
||||
}
|
||||
|
||||
public void setNom(String nom) {
|
||||
this.nom = nom;
|
||||
}
|
||||
|
||||
public String getDiscipline() {
|
||||
return discipline;
|
||||
}
|
||||
|
||||
public void setDiscipline(String discipline) {
|
||||
this.discipline = discipline;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getNiveau() {
|
||||
return niveau;
|
||||
}
|
||||
|
||||
public void setNiveau(String niveau) {
|
||||
this.niveau = niveau;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package fr.univ_amu.iut.fResultat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Utilisateur {
|
||||
|
||||
private int Numéro ;
|
||||
private String Noms;
|
||||
private String Disciplines;
|
||||
private String Types;
|
||||
private String Niveaux;
|
||||
|
||||
public Utilisateur(int numero, String noms, String disciplines, String types, String niveaux) {
|
||||
Numéro = numero;
|
||||
Noms = noms;
|
||||
Disciplines = disciplines;
|
||||
Types = types;
|
||||
Niveaux = niveaux;
|
||||
}
|
||||
|
||||
public int getNuméro() {
|
||||
return Numéro;
|
||||
}
|
||||
|
||||
public String getNoms() {
|
||||
return Noms;
|
||||
}
|
||||
|
||||
public String getDisciplines() {
|
||||
return Disciplines;
|
||||
}
|
||||
|
||||
public String getTypes() {
|
||||
return Types;
|
||||
}
|
||||
|
||||
public String getNiveaux() {
|
||||
return Niveaux;
|
||||
}
|
||||
}
|
@ -1,86 +1,142 @@
|
||||
package fr.univ_amu.iut.fp;
|
||||
|
||||
import fr.univ_amu.iut.Donnees;
|
||||
import fr.univ_amu.iut.dao.DAODiscipline;
|
||||
import fr.univ_amu.iut.dao.DAORessource;
|
||||
import fr.univ_amu.iut.dao.DAOThematique;
|
||||
import fr.univ_amu.iut.dao.DAOUsage;
|
||||
import fr.univ_amu.iut.dao.factory.DAOFactory;
|
||||
import fr.univ_amu.iut.dao.factory.DAOFactoryProducer;
|
||||
import fr.univ_amu.iut.dao.factory.DAOType;
|
||||
import fr.univ_amu.iut.model.Ressource;
|
||||
import fr.univ_amu.iut.model.Discipline;
|
||||
import fr.univ_amu.iut.model.Thematique;
|
||||
import fr.univ_amu.iut.screenController.ScreenController;
|
||||
import fr.univ_amu.iut.view.map.AcademiePath;
|
||||
import fr.univ_amu.iut.view.map.France;
|
||||
import fr.univ_amu.iut.view.map.FranceBuilder;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.event.ActionEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class Controller implements Initializable {
|
||||
France france;
|
||||
|
||||
|
||||
EventHandler<MouseEvent> onEnterHandler;
|
||||
EventHandler<MouseEvent> onExitHandler;
|
||||
DAOFactory daoFactory;
|
||||
DAORessource daoRessource;
|
||||
DAODiscipline daoDiscipline;
|
||||
DAOThematique daoThematique;
|
||||
DAOUsage daoUsage;
|
||||
|
||||
@FXML
|
||||
private Pane stackPaneFrance;
|
||||
|
||||
@FXML
|
||||
private AnchorPane ressource;
|
||||
private AnchorPane discipline;
|
||||
|
||||
@FXML
|
||||
private AnchorPane thematique;
|
||||
|
||||
@FXML
|
||||
private Button recherche;
|
||||
|
||||
// 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));
|
||||
Background btNormalSelected = new Background(new BackgroundFill(Color.rgb(255,60,0), new CornerRadii(30), Insets.EMPTY));
|
||||
|
||||
private void initFrance() {
|
||||
france = FranceBuilder.create()
|
||||
.backgroundColor(Color.web("#f5f0e1"))
|
||||
.fillColor(Color.web("#1e3d59"))
|
||||
// .strokeColor(Color.web("#987028"))
|
||||
// .hoverColor(Color.web("#fec47e"))
|
||||
// .pressedColor(Color.web("#6cee85"))
|
||||
// .selectedColor(Color.MAGENTA)
|
||||
// .mousePressHandler(evt -> {
|
||||
// AcademiePath academiePath = (AcademiePath) evt.getSource();
|
||||
// System.out.println("On vient de cliquer sur l'"+academiePath.getAcademie().getNom());
|
||||
// })
|
||||
.mousePressHandler(evt -> {
|
||||
AcademiePath academiePath = (AcademiePath) evt.getSource();
|
||||
Donnees.setAcademieSelectionee(academiePath.getAcademie());
|
||||
})
|
||||
.selectionEnabled(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
private Button initButton(Object obj,int x,int y){
|
||||
String nom = "";
|
||||
|
||||
EventHandler<ActionEvent> actionHandler;
|
||||
EventHandler<MouseEvent> onPressHandler;
|
||||
|
||||
onEnterHandler = evt -> {
|
||||
Button bt = (Button) evt.getSource();
|
||||
bt.setBackground(btNormalHover);
|
||||
};
|
||||
|
||||
onExitHandler= evt -> {
|
||||
Button bt = (Button) evt.getSource();
|
||||
bt.setBackground(btNormalBackground);
|
||||
};
|
||||
|
||||
/*<Button layoutX="38.0" layoutY="30.0" mnemonicParsing="false" prefHeight="115.0" prefWidth="235.0" style="-fx-background-radius: 30; -fx-background-color: #ff6e40;" text="Button" />
|
||||
<Button layoutX="332.0" layoutY="30.0" mnemonicParsing="false" prefHeight="115.0" prefWidth="235.0" style="-fx-background-radius: 30; -fx-background-color: #ff6e40#ff6e40;" text="Button" />*/
|
||||
onPressHandler = event -> {
|
||||
Button bt = (Button) event.getSource();
|
||||
if(bt.getBackground().equals(btNormalSelected)){
|
||||
bt.setBackground(btNormalHover);
|
||||
bt.setOnMouseEntered(onEnterHandler);
|
||||
bt.setOnMouseExited(onExitHandler);
|
||||
}
|
||||
else{
|
||||
bt.setBackground(btNormalSelected);
|
||||
bt.setOnMouseEntered(null);
|
||||
bt.setOnMouseExited(null);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private Button initButton(String ressource,int x,int y){
|
||||
Button bt = new Button(ressource);
|
||||
if ( obj instanceof Discipline ){
|
||||
Discipline disciplineActuelle = (Discipline) obj;
|
||||
nom = disciplineActuelle.getNom();
|
||||
actionHandler = event -> {Donnees.setDisciplineSelectionee(disciplineActuelle);};
|
||||
}
|
||||
else{
|
||||
Thematique thematiqueActuelle = (Thematique) obj;
|
||||
nom = thematiqueActuelle.getNom();
|
||||
actionHandler = event -> {Donnees.setThematiqueSelectionee(thematiqueActuelle);};
|
||||
}
|
||||
|
||||
Button bt = new Button(nom);
|
||||
bt.setMnemonicParsing(false);
|
||||
bt.setMinSize(235,115);
|
||||
bt.layoutXProperty().setValue(x);
|
||||
bt.layoutYProperty().setValue(y);
|
||||
bt.setId(ressource);
|
||||
bt.setId(nom);
|
||||
bt.prefHeight(115);
|
||||
bt.prefWidth(235);
|
||||
bt.setText(ressource);
|
||||
bt.setBackground(new Background(new BackgroundFill(Color.rgb(255,110,64), new CornerRadii(30), Insets.EMPTY)));
|
||||
bt.setText(nom);
|
||||
bt.setBackground(btNormalBackground);
|
||||
bt.setOnAction(actionHandler);
|
||||
bt.setOnMouseClicked(onPressHandler);
|
||||
bt.setOnMouseEntered(onEnterHandler);
|
||||
bt.setOnMouseExited(onExitHandler);
|
||||
return bt;
|
||||
}
|
||||
|
||||
private Void placeButtonRessource(){
|
||||
List<Ressource> ressources = daoRessource.findAll();
|
||||
ressource.setMinHeight(ressources.size()*65);
|
||||
for (int i = 0;i<ressources.size();++i){
|
||||
private Void placeButtonDiscipline(){
|
||||
List<Discipline> disciplines = daoDiscipline.findAll();
|
||||
discipline.setMinHeight(disciplines.size()*65);
|
||||
for (int i = 0;i<disciplines.size();++i){
|
||||
if (i%2 == 0){
|
||||
ressource.getChildren().add(initButton(ressources.get(i).getNomRessource(),38,i/2*130));
|
||||
discipline.getChildren().add(initButton(disciplines.get(i),38,i/2*130));
|
||||
}
|
||||
else {
|
||||
ressource.getChildren().add(initButton(ressources.get(i).getNomRessource(),332,i/2*130));
|
||||
discipline.getChildren().add(initButton(disciplines.get(i),332,i/2*130));
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,13 +148,12 @@ public class Controller implements Initializable {
|
||||
thematique.setMinHeight(thematiques.size()*65);
|
||||
for (int i = 0;i<thematiques.size();++i){
|
||||
if (i%2 == 0){
|
||||
thematique.getChildren().add(initButton(thematiques.get(i).getNom(),38,i/2*130));
|
||||
thematique.getChildren().add(initButton(thematiques.get(i),38,i/2*130));
|
||||
}
|
||||
else {
|
||||
thematique.getChildren().add(initButton(thematiques.get(i).getNom(),332,i/2*130));
|
||||
thematique.getChildren().add(initButton(thematiques.get(i),332,i/2*130));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -109,19 +164,31 @@ public class Controller implements Initializable {
|
||||
|
||||
// init
|
||||
daoFactory = DAOFactoryProducer.getFactory(DAOType.TEST);
|
||||
daoRessource = daoFactory.createDAORessource();
|
||||
daoDiscipline = daoFactory.createDAODiscipline();
|
||||
daoThematique = daoFactory.createDAOThematique();
|
||||
daoUsage = daoFactory.createDAOUsage();
|
||||
|
||||
// a chaque fois
|
||||
List<Ressource> l = daoRessource.findAll();
|
||||
|
||||
List<Discipline> d = daoDiscipline.findAll();
|
||||
List<Thematique> t = daoThematique.findAll();
|
||||
|
||||
System.out.println(l);
|
||||
|
||||
|
||||
placeButtonThematique();
|
||||
placeButtonRessource();
|
||||
// matiere.getChildren().add(initButton(t.get(0).getNom(),38,30));
|
||||
// matiere.getChildren().add(initButton("test",38,160));
|
||||
placeButtonDiscipline();
|
||||
EventHandler<ActionEvent> handler = event ->{
|
||||
//TODO Recherche en fonctions des objets selectionnés
|
||||
|
||||
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(handler);
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
package fr.univ_amu.iut.fp;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
|
||||
|
||||
public class Main extends Application {
|
||||
|
||||
public static void main(String[] args) {launch(args);}
|
||||
@Override
|
||||
public void start(Stage stage) throws Exception {
|
||||
try {
|
||||
AnchorPane root = FXMLLoader.load(getClass().getResource("/fr/univ_amu/iut/fp/fp.fxml"));
|
||||
stage.setScene(new Scene(root));
|
||||
stage.show();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import javafx.scene.Cursor?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?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/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univ_amu.iut.fp.Controller">
|
||||
<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">
|
||||
<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" style="-fx-background-color: #CDD0D4#CDD0D4; -fx-border-radius: 5em; -fx-background-radius: 5em;" text="Entrer nom projet : " AnchorPane.leftAnchor="329.0" AnchorPane.rightAnchor="329.0">
|
||||
<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">
|
||||
<cursor>
|
||||
<Cursor fx:constant="CROSSHAIR" />
|
||||
<Cursor fx:constant="TEXT" />
|
||||
</cursor>
|
||||
</TextField>
|
||||
<Button 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">
|
||||
<children>
|
||||
<ScrollPane hbarPolicy="NEVER" prefHeight="471.0" prefWidth="347.0" style="-fx-background-color: #f5f0e1;">
|
||||
<content>
|
||||
<AnchorPane id="ressource" fx:id="ressource" minHeight="0.0" minWidth="0.0" prefHeight="442.0" prefWidth="620.0" style="-fx-background-color: #f5f0e1#f5f0e1;">
|
||||
<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>
|
||||
@ -41,6 +45,6 @@
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</StackPane>
|
||||
<Button layoutX="875.0" layoutY="606.0" mnemonicParsing="false" prefHeight="120.0" prefWidth="337.0" style="-fx-background-radius: 50; -fx-background-color: #ffc13b#ffc13b;" text="RECHERCHER" AnchorPane.bottomAnchor="72.0" AnchorPane.rightAnchor="153.0" />
|
||||
<Button id="recherche" fx:id="recherche" layoutX="875.0" layoutY="606.0" mnemonicParsing="false" prefHeight="120.0" prefWidth="337.0" style="-fx-background-radius: 50; -fx-background-color: #ffc13b#ffc13b;" text="RECHERCHER VIA LES FILTRES" AnchorPane.bottomAnchor="72.0" AnchorPane.rightAnchor="153.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
@ -0,0 +1,23 @@
|
||||
package fr.univ_amu.iut.screenController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javafx.scene.*;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
public class ScreenController {
|
||||
private static HashMap<String, Pane> screenMap = new HashMap<>();
|
||||
private static Scene main;
|
||||
|
||||
public ScreenController(Scene main) {
|
||||
ScreenController.main = main;
|
||||
}
|
||||
|
||||
public static void addScreen(String name, Pane pane){
|
||||
screenMap.put(name, pane);
|
||||
}
|
||||
|
||||
public static void activate(String name){
|
||||
main.setRoot( screenMap.get(name) );
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@ public class DAODisciplineTest implements DAODiscipline {
|
||||
|
||||
@Override
|
||||
public List<Discipline> findAll() {
|
||||
return null;
|
||||
return Discipline.toutes();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,7 @@ public class DAOFactoryTest implements DAOFactory {
|
||||
|
||||
@Override
|
||||
public DAODiscipline createDAODiscipline() {
|
||||
return null;
|
||||
return new DAODisciplineTest();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -37,6 +37,6 @@ public class DAOFactoryTest implements DAOFactory {
|
||||
|
||||
@Override
|
||||
public DAOUsage createDAOUsage() {
|
||||
return null;
|
||||
return new DAOUsageTest();
|
||||
}
|
||||
}
|
||||
|
66
src/main/java/fr/univ_amu/iut/test/DAOUsageTest.java
Normal file
66
src/main/java/fr/univ_amu/iut/test/DAOUsageTest.java
Normal file
@ -0,0 +1,66 @@
|
||||
package fr.univ_amu.iut.test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import fr.univ_amu.iut.dao.DAOUsage;
|
||||
import fr.univ_amu.iut.model.Academie;
|
||||
import fr.univ_amu.iut.model.Discipline;
|
||||
import fr.univ_amu.iut.model.Niveau;
|
||||
import fr.univ_amu.iut.model.Thematique;
|
||||
import fr.univ_amu.iut.model.Usage;
|
||||
|
||||
public class DAOUsageTest implements DAOUsage{
|
||||
|
||||
@Override
|
||||
public boolean delete(Usage obj) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Usage> findAll() {
|
||||
List<Usage> usages = new ArrayList<>();
|
||||
for( int i = 0; i < 69 ; i++){
|
||||
Usage tmp = new Usage();
|
||||
tmp.setNom(String.valueOf(i));
|
||||
tmp.setDiscipline(Discipline.Technologie);
|
||||
tmp.setNiveau(Niveau.Tous);
|
||||
tmp.setDescription("je suis un commentaire tres long mais surtout tres utile, je sert a tester l'interface graphique et la mettre au bout de ses limtes");
|
||||
usages.add(tmp);
|
||||
}
|
||||
return usages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Usage getById(int id) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insert(Usage obj) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(Usage obj) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Usage> findByCriterias(Thematique thematique, Discipline discipline, Academie academie) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Usage> findByName(String substring) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user