Merge pull request #26 from IUTInfoAix-R202-2022/detailResultats
pages de resultats detailées fonctionnelle
This commit is contained in:
		
						commit
						13f1023666
					
				| @ -9,10 +9,19 @@ import fr.univ_amu.iut.model.Usage; | ||||
| 
 | ||||
| public class Donnees { | ||||
|     private static Academie academieSelectionee = null; | ||||
| 
 | ||||
|     private static Thematique thematiqueSelectionee = null; | ||||
|     private static Discipline disciplineSelectionee = null; | ||||
|     private static Usage usageSelectione = null; | ||||
|     private static List<Usage> usagesObtenus; | ||||
| 
 | ||||
|     public static Usage getUsageSelectione() { | ||||
|         return usageSelectione; | ||||
|     } | ||||
|     public static void setUsageSelectione(Usage usageSelectione) { | ||||
|         Donnees.usageSelectione = usageSelectione; | ||||
|     } | ||||
| 
 | ||||
|     public static List<Usage> getUsagesObtenus() { | ||||
|         return usagesObtenus; | ||||
|     } | ||||
|  | ||||
							
								
								
									
										47
									
								
								src/main/java/fr/univ_amu/iut/detailResultats/detail.fxml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/main/java/fr/univ_amu/iut/detailResultats/detail.fxml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| 
 | ||||
| <?import javafx.scene.control.Label?> | ||||
| <?import javafx.scene.layout.AnchorPane?> | ||||
| <?import javafx.scene.text.Font?> | ||||
| <?import javafx.scene.text.Text?> | ||||
| 
 | ||||
| <AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="1200.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.detailResultats.Controller"> | ||||
|    <children> | ||||
|       <Text fill="#ff6e40" layoutX="93.0" layoutY="76.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Academie " wrappingWidth="175.0749652342431" AnchorPane.leftAnchor="93.0" AnchorPane.topAnchor="47.0"> | ||||
|          <font> | ||||
|             <Font size="30.0" /> | ||||
|          </font> | ||||
|       </Text> | ||||
|       <Label fx:id="academieLabel" layoutX="93.0" layoutY="94.0" prefHeight="82.0" prefWidth="295.0" style="-fx-background-color: blue;" text="Label" AnchorPane.leftAnchor="93.0" /> | ||||
|       <Text fill="#ff6e40" layoutX="93.0" layoutY="243.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Acteur(s)" wrappingWidth="137.4109649658203" AnchorPane.leftAnchor="93.0"> | ||||
|          <font> | ||||
|             <Font size="31.0" /> | ||||
|          </font> | ||||
|       </Text> | ||||
|       <Text fill="#ff6e40" layoutX="93.0" layoutY="409.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Discipline " wrappingWidth="147.13865661621094" AnchorPane.leftAnchor="93.0"> | ||||
|          <font> | ||||
|             <Font size="31.0" /> | ||||
|          </font> | ||||
|       </Text> | ||||
|       <Text fill="#ff6e40" layoutX="687.0" layoutY="77.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Region Academique" wrappingWidth="343.3069763183594" AnchorPane.rightAnchor="170.0" AnchorPane.topAnchor="47.0"> | ||||
|          <font> | ||||
|             <Font size="31.0" /> | ||||
|          </font> | ||||
|       </Text> | ||||
|       <Text fill="#ff6e40" layoutX="688.0" layoutY="242.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Ressource" wrappingWidth="194.35128784179688" AnchorPane.rightAnchor="317.6487121582031"> | ||||
|          <font> | ||||
|             <Font size="31.0" /> | ||||
|          </font> | ||||
|       </Text> | ||||
|       <Text fill="#ff6e40" layoutX="688.0" layoutY="407.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Thematique" wrappingWidth="198.83489990234375" AnchorPane.rightAnchor="317.79742431640625"> | ||||
|          <font> | ||||
|             <Font size="31.0" /> | ||||
|          </font> | ||||
|       </Text> | ||||
|       <Label fx:id="acteurLabel" layoutX="93.0" layoutY="260.0" prefHeight="82.0" prefWidth="295.0" style="-fx-background-color: blue;" text="Label" AnchorPane.leftAnchor="93.0" /> | ||||
|       <Label fx:id="disciplineLabel" layoutX="93.0" layoutY="426.0" prefHeight="82.0" prefWidth="295.0" style="-fx-background-color: blue;" text="Label" AnchorPane.leftAnchor="93.0" /> | ||||
|       <Label fx:id="regionAcademieLabel" layoutX="688.0" layoutY="93.0" prefHeight="82.0" prefWidth="295.0" style="-fx-background-color: blue;" text="Label" AnchorPane.rightAnchor="217.0" /> | ||||
|       <Label fx:id="ressourceLabel" layoutX="687.0" layoutY="257.0" prefHeight="82.0" prefWidth="295.0" style="-fx-background-color: blue;" text="Label" AnchorPane.rightAnchor="217.0" /> | ||||
|       <Label fx:id="thematiqueLabel" layoutX="688.0" layoutY="426.0" prefHeight="82.0" prefWidth="295.0" style="-fx-background-color: blue;" text="Label" AnchorPane.rightAnchor="217.0" /> | ||||
|    </children> | ||||
| </AnchorPane> | ||||
| @ -3,12 +3,20 @@ package fr.univ_amu.iut.fResultat; | ||||
| 
 | ||||
| import javafx.collections.FXCollections; | ||||
| import javafx.collections.ObservableList; | ||||
| import javafx.event.Event; | ||||
| import javafx.fxml.FXML; | ||||
| import javafx.fxml.FXMLLoader; | ||||
| import javafx.fxml.Initializable; | ||||
| import javafx.scene.control.Tab; | ||||
| import javafx.scene.control.TabPane; | ||||
| import javafx.scene.control.TableColumn; | ||||
| import javafx.scene.control.TableView; | ||||
| import javafx.scene.control.cell.PropertyValueFactory; | ||||
| import javafx.scene.input.MouseEvent; | ||||
| 
 | ||||
| import javafx.event.EventHandler; | ||||
| 
 | ||||
| import java.io.IOException; | ||||
| import java.net.URL; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| @ -33,6 +41,12 @@ public class Controller implements Initializable{ | ||||
|     @FXML | ||||
|     private TableColumn<TableEntry, String> description; | ||||
| 
 | ||||
|     @FXML | ||||
|     private TableColumn<TableEntry, String> fauxBoutons; | ||||
| 
 | ||||
|     @FXML | ||||
|     private TabPane onglets; | ||||
| 
 | ||||
|     @Override | ||||
|     public void initialize(URL url, ResourceBundle resourceBundle) { | ||||
|          | ||||
| @ -42,13 +56,29 @@ public class Controller implements Initializable{ | ||||
|             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")); | ||||
|          | ||||
|          | ||||
|         EventHandler<MouseEvent> selection = event ->{ | ||||
|             Donnees.setUsageSelectione(table.getSelectionModel().getSelectedItem().getUsage()); | ||||
|             Tab onglet; | ||||
|             try { | ||||
|                 onglet = new Tab(Donnees.getUsageSelectione().getNom(),FXMLLoader.load(getClass().getResource("/fr/univ_amu/iut/detailResultats/detail.fxml"))); | ||||
|                 onglets.getTabs().add(onglet); | ||||
|             } catch (IOException e) { | ||||
|                 e.printStackTrace(); | ||||
|             } | ||||
| 
 | ||||
|             | ||||
| 
 | ||||
|         }; | ||||
|         table.setOnMouseClicked(selection); | ||||
|         table.setItems(tableEntries); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,18 +1,29 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| 
 | ||||
| <?import javafx.scene.control.Tab?> | ||||
| <?import javafx.scene.control.TabPane?> | ||||
| <?import javafx.scene.control.TableColumn?> | ||||
| <?import javafx.scene.control.TableView?> | ||||
| <?import javafx.scene.layout.AnchorPane?> | ||||
| 
 | ||||
| <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"> | ||||
|         <columns> | ||||
|           <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> | ||||
| </AnchorPane> | ||||
| <TabPane fx:id="onglets" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univ_amu.iut.fResultat.Controller"> | ||||
|    <tabs> | ||||
|       <Tab text="Resultats"> | ||||
|          <content> | ||||
|             <AnchorPane prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #1e3d59#1e3d59;"> | ||||
|                <children> | ||||
|                   <TableView fx:id="table" layoutX="10.0" layoutY="10.0" prefHeight="380.0" prefWidth="680.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="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" /> | ||||
|                         <TableColumn fx:id="description1" prefWidth="124.0" /> | ||||
|                     </columns> | ||||
|                   </TableView> | ||||
|                </children> | ||||
|             </AnchorPane> | ||||
|          </content> | ||||
|       </Tab> | ||||
|    </tabs> | ||||
| </TabPane> | ||||
|  | ||||
| @ -6,6 +6,7 @@ import fr.univ_amu.iut.model.Usage; | ||||
| 
 | ||||
| public class TableEntry { | ||||
| 
 | ||||
|     private Usage usage; | ||||
|     private String nom; | ||||
|     private String discipline; | ||||
|     private String thematique; | ||||
| @ -13,6 +14,7 @@ public class TableEntry { | ||||
|     private String niveau; | ||||
| 
 | ||||
|     public TableEntry(Usage usage) { | ||||
|         this.usage = usage; | ||||
|         nom = usage.getNom(); | ||||
|         thematique = usage.getThematique().getNom(); | ||||
|         discipline = usage.getDiscipline().getNom(); | ||||
| @ -20,6 +22,10 @@ public class TableEntry { | ||||
|         niveau = usage.getNiveau().getNom(); | ||||
|     } | ||||
| 
 | ||||
|     public Usage getUsage(){ | ||||
|         return usage; | ||||
|     } | ||||
| 
 | ||||
|     public String getNom() { | ||||
|         return nom; | ||||
|     } | ||||
|  | ||||
| @ -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.TabPane; | ||||
| import javafx.scene.control.TextField; | ||||
| import javafx.scene.input.MouseEvent; | ||||
| import javafx.scene.layout.*; | ||||
| @ -193,6 +194,7 @@ public class Controller implements Initializable { | ||||
|         }; | ||||
|         rechercheTextuelle.setOnAction(handleRechercheTextuelle); | ||||
| 
 | ||||
|         TabPane tab; | ||||
| 
 | ||||
|         EventHandler<ActionEvent> handleRechercheCriterias = event ->{ | ||||
|             Donnees.setUsagesObtenus(daoUsage.findByCriterias(Donnees.getThematiqueSelectionee(),Donnees.getDisciplineSelectionee(),Donnees.getAcademieSelectionee())); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user