diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..56b25cc --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,24 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 13 + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1ff19c5..0000000 --- a/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -# Default ignored files -/shelf/ -/workspace.xml -.classpath -.project -.settings/ - -*.cache - -bin/**/* -target/**/* -build/**/* -gen/**/* -out/**/* \ No newline at end of file diff --git a/ProjetGenieLogicielLoto.iml b/.idea/ProjetGenieLogicielLoto.iml similarity index 60% rename from ProjetGenieLogicielLoto.iml rename to .idea/ProjetGenieLogicielLoto.iml index be894ed..a2135cc 100644 --- a/ProjetGenieLogicielLoto.iml +++ b/.idea/ProjetGenieLogicielLoto.iml @@ -1,11 +1,13 @@ - + + + @@ -18,9 +20,13 @@ - - - - + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b9417ab --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..1ce1677 --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..50e0d87 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_base_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_base_15.xml new file mode 100644 index 0000000..eaea861 --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_base_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_base_win_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_base_win_15.xml new file mode 100644 index 0000000..d0cb7ba --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_base_win_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_controls_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_controls_15.xml new file mode 100644 index 0000000..eb1bbe0 --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_controls_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_controls_win_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_controls_win_15.xml new file mode 100644 index 0000000..8572b37 --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_controls_win_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_fxml_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_fxml_15.xml new file mode 100644 index 0000000..b847060 --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_fxml_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_15.xml new file mode 100644 index 0000000..bf4c6b7 --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_fxml_win_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_graphics_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_graphics_15.xml new file mode 100644 index 0000000..18ce4e3 --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_graphics_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_15.xml b/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_15.xml new file mode 100644 index 0000000..6fce644 --- /dev/null +++ b/.idea/libraries/Maven__org_openjfx_javafx_graphics_win_15.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..bbd67ea --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ff8c83d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..34a756a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1612200481836 + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index ae82209..1a92417 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ProjetGenieLogicielLoto +# ProjetGenieLogicielLoto ![Build with Maven](https://github.com/NyxiumYuuki/ProjetGenieLogicielLoto/workflows/Java%20CI%20with%20Maven/badge.svg) ## Introduction *Ce projet permet de valider les connaissances en matière de Génie Logiciel dans le cadre du programme au sein de Polytech Marseille en Informatique. Ce projet consiste à créer un logiciel qui a pour objectif de réduire les pertes financières lorsque l'on joue à des jeux de hasard, en l'occurence au Loto de la [Française Des Jeux](https://fdj.fr) en respectant le bon déroulement d'un projet.* diff --git a/apiguardian-api-1.1.0.jar b/apiguardian-api-1.1.0.jar new file mode 100644 index 0000000..e6fcead Binary files /dev/null and b/apiguardian-api-1.1.0.jar differ diff --git a/junit-jupiter-5.5.2.jar b/junit-jupiter-5.5.2.jar new file mode 100644 index 0000000..4fbff13 Binary files /dev/null and b/junit-jupiter-5.5.2.jar differ diff --git a/junit-jupiter-api-5.5.2.jar b/junit-jupiter-api-5.5.2.jar new file mode 100644 index 0000000..a025d98 Binary files /dev/null and b/junit-jupiter-api-5.5.2.jar differ diff --git a/junit-jupiter-engine-5.5.2.jar b/junit-jupiter-engine-5.5.2.jar new file mode 100644 index 0000000..f09e23c Binary files /dev/null and b/junit-jupiter-engine-5.5.2.jar differ diff --git a/junit-jupiter-params-5.5.2.jar b/junit-jupiter-params-5.5.2.jar new file mode 100644 index 0000000..00dabf1 Binary files /dev/null and b/junit-jupiter-params-5.5.2.jar differ diff --git a/junit-platform-commons-1.5.2.jar b/junit-platform-commons-1.5.2.jar new file mode 100644 index 0000000..3a09812 Binary files /dev/null and b/junit-platform-commons-1.5.2.jar differ diff --git a/junit-platform-engine-1.5.2.jar b/junit-platform-engine-1.5.2.jar new file mode 100644 index 0000000..de86ab7 Binary files /dev/null and b/junit-platform-engine-1.5.2.jar differ diff --git a/opentest4j-1.2.0.jar b/opentest4j-1.2.0.jar new file mode 100644 index 0000000..d500636 Binary files /dev/null and b/opentest4j-1.2.0.jar differ diff --git a/pom.xml b/pom.xml index 3abf41e..396b357 100644 --- a/pom.xml +++ b/pom.xml @@ -67,6 +67,12 @@ slf4j-simple 1.7.25 + + org.junit.jupiter + junit-jupiter-api + 5.7.0 + compile + diff --git a/src/main/java/fr/myny/data/DataCsv.java b/src/main/java/fr/myny/data/DataCsv.java index a0b8073..3bb19ef 100644 --- a/src/main/java/fr/myny/data/DataCsv.java +++ b/src/main/java/fr/myny/data/DataCsv.java @@ -1,19 +1,93 @@ package fr.myny.data; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +/** + * Classe d'extraction de fichier Zip + */ public class DataCsv { + protected String destination; /** - * Le constructeur de DataCsv + * Constructeur par defaut + * @throws IOException */ - public DataCsv(){ + public DataCsv() throws IOException { + this.destination = "src/main/resources/Download"; + ImportData imp = new ImportData("https://www.fdj.fr/jeux-de-tirage/loto/statistiques", this.destination); } + /** + * Constructeur avec parametre + * @param s repertoire de destination + * @throws IOException + */ + public DataCsv(String s) throws IOException { + this.destination = s; + ImportData imp = new ImportData("https://www.fdj.fr/jeux-de-tirage/loto/statistiques", this.destination); + + for (String name : imp.tabNameZip) { + name = this.destination.concat(name); + getCsv(name); + } + } + /** * La methode de recuperation dun fichier csv + * @param fileZip : nom suivit du chemin du fichier zip */ - public void getCsv(){ + private void getCsv(String fileZip) throws IOException{ + File desDir = new File(destination); + byte[] buffer = new byte[1024]; + ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip)); + ZipEntry zipEntry = zis.getNextEntry(); + while (zipEntry != null){ + File newFile = newFile(desDir, zipEntry); + if (zipEntry.isDirectory()){ + if (!newFile.isDirectory() && !newFile.mkdirs()){ + throw new IOException("Failed to create directory " + newFile); + } + } else{ + File parent = newFile.getParentFile(); + if (!parent.isDirectory() && !parent.mkdirs()) { + throw new IOException("Failed to create directory " + parent); + } + FileOutputStream fos = new FileOutputStream(newFile); + int len; + while ((len = zis.read(buffer)) > 0){ + fos.write(buffer, 0, len); + } + fos.close(); + } + zipEntry = zis.getNextEntry(); + } + zis.closeEntry(); + zis.close(); } + + /** + * Methode verifiant si l extraction a bien ete faite + * @param destinationDir : chemin de destination + * @param zipEntry : zip cible + */ + public File newFile(File destinationDir, ZipEntry zipEntry) throws IOException{ + File destFile = new File(destinationDir, zipEntry.getName()); + + String destDirPath = destinationDir.getCanonicalPath(); + String destFilePath = destFile.getCanonicalPath(); + + if (!destFilePath.startsWith(destDirPath + File.separator)){ + throw new IOException("Entry is outside of the target dir: " + zipEntry.getName()); + } + + return destFile; + } } diff --git a/src/main/java/fr/myny/data/ImportData.java b/src/main/java/fr/myny/data/ImportData.java index b4e2481..803c1b0 100644 --- a/src/main/java/fr/myny/data/ImportData.java +++ b/src/main/java/fr/myny/data/ImportData.java @@ -1,25 +1,103 @@ package fr.myny.data; +import java.io.*; +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; + public class ImportData { - String url; + + protected String url; + protected String repDes; + public ArrayList tabNameZip; /** - * Le constructeur de ImportData + * Constructeur par defaut */ - public ImportData(){ - + ImportData(){ + this.url = "https://www.fdj.fr/jeux-de-tirage/loto/statistiques"; + this.repDes = "src/main/resources/Download/"; + tabNameZip = new ArrayList<>(); + DownloadCsvZip(); } + /** - * Le constructeur de ImportData - * @param url string contenant l URL dou recuperer les fichiers csv + * Constructeur avec parametres + * @param url contient l'URL dou recuperer les fichiers csv + * @param des respertoire de destination */ - public ImportData(String url){ + public ImportData(String url, String des){ this.url=url; + this.repDes = des; + tabNameZip = new ArrayList<>(); + DownloadCsvZip(); } /** - * La methode de recuperation de l URL + * Méthode permettant de tester si l'URL est valide + * @return true si l'URL est valide si non false */ - public void getUrl(){ + private boolean UrlExist() { + try { + URL site = new URL(url); + try { + site.openStream(); + return true; + } catch (IOException e) { + return false; + } + } catch (MalformedURLException e) { + return false; + } } + + /** + * Méthode permettant de télécharger un fichier à partir d'un URL + */ + public void DownloadCsvZip() { + if (UrlExist()) { + BufferedReader in = null; + + try { + URL site = new URL(url); + in = new BufferedReader(new InputStreamReader(site.openStream())); + + String test = "loto_"; + String nameZip; + String urlZipLink; + while ((urlZipLink = in.readLine()) != null) { + if (urlZipLink.length() > 128) { + if (test.equals(urlZipLink.substring(50, 55))) { + nameZip = urlZipLink.substring(50,65); + tabNameZip.add(nameZip); + urlZipLink = urlZipLink.substring(13,65); + try (BufferedInputStream bis = new BufferedInputStream(new URL(urlZipLink).openStream()); + FileOutputStream fos = new FileOutputStream(repDes + nameZip)) { + byte data[] = new byte[1024]; + int byteContent; + while ((byteContent = bis.read(data, 0, 1024)) != -1) { + fos.write(data, 0, byteContent); + } + } catch (IOException e) { + e.printStackTrace(System.out); + } + } + } + } + in.close(); + } catch (IOException e) { + System.out.println("Error URL can't open : " + e); + } + finally { + try { + in.close(); + } catch (IOException e) { + System.out.println("Error close buffer : " + e); + } + } + } + else + System.out.println("Web sit don't exist"); + } + } diff --git a/src/main/java/fr/myny/grid/BuildGrid.java b/src/main/java/fr/myny/grid/BuildGrid.java deleted file mode 100644 index e868228..0000000 --- a/src/main/java/fr/myny/grid/BuildGrid.java +++ /dev/null @@ -1,24 +0,0 @@ -package fr.myny.grid; - -public class BuildGrid { - /** - * Le constructeur de BuildGrid - */ - public BuildGrid(){ - - } - - /** - * La methode de recuperation de la grille - */ - public void getGrid(){ - - } - - /** - * La methode de demande du systeme reducteur - */ - public void ReductorSys(){ - - } -} diff --git a/src/main/java/fr/myny/gui/ButtonController.java b/src/main/java/fr/myny/gui/ButtonController.java new file mode 100644 index 0000000..d56b6cb --- /dev/null +++ b/src/main/java/fr/myny/gui/ButtonController.java @@ -0,0 +1,74 @@ +package fr.myny.gui; + +import javafx.fxml.FXML; + +import java.io.IOException; + +/** + * Classe permettant l'execution des fonctionnalités de l'application via les autres packages data, database, grid et stats. + */ +public class ButtonController { + + /** + * Execution de la méthode de téléchargement de toutes les données automatiquement et met à jour la base de données + * @throws IOException + */ + @FXML + private void controllerAutoTirage() throws IOException { + + } + + /** + * Execution de la méthode de téléchargement des dernières données automatiquement et met à jour la base de données + * @throws IOException + */ + @FXML + private void controllerAutoDernierTirage() throws IOException { + + } + + /** + * Demande à l'utilisateur de sélectionner un fichier CSV via l'explorateur des fichiers et met à jour la base de données + * @throws IOException + */ + @FXML + private void controllerGetCSVFile() throws IOException { + + } + + /** + * Appelle la méthode d'affichage des statistiques des fréquences d'apparitions d'un nombre + * @throws IOException + */ + @FXML + private void checkBoxNumeros() throws IOException { + + } + + /** + * Appelle la méthode d'affichage des statistiques des fréquences d'apparitions de combinaison de 2 chiffres + * @throws IOException + */ + @FXML + private void checkBox2Numeros() throws IOException { + + } + + /** + * Appelle la méthode d'affichage des statistiques des fréquences d'apparitions de combinaison de 3 chiffres + * @throws IOException + */ + @FXML + private void checkBox3Numeros() throws IOException { + + } + + /** + * Appelle la méthode d'affichage des statistiques des fréquences d'apparitions d'un nombre bonus + * @throws IOException + */ + @FXML + private void checkBoxNumerosBonus() throws IOException { + + } +} diff --git a/src/main/java/fr/myny/gui/DocumentController.java b/src/main/java/fr/myny/gui/DocumentController.java new file mode 100644 index 0000000..0099a32 --- /dev/null +++ b/src/main/java/fr/myny/gui/DocumentController.java @@ -0,0 +1,80 @@ +package fr.myny.gui; + +import javafx.collections.ObservableList; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.ChoiceBox; + +import java.net.URL; +import java.util.ResourceBundle; + +/** + * Classe permettant d'initialiser et d'écouter le changement des ChoiceBox + */ +public class DocumentController implements Initializable { + + /** + * ChoiceBox créé grâce à FXML + */ + private ChoiceBox integerChoiceBox; + + /** + * + * ChoiceBox créé grâce à FXML + */ + private ChoiceBox stringChoiceBox; + + /** + * Liste d'entier observable grâce à FX + */ + private ObservableList observableIntegerList; + + /** + * Liste de chaîne de caractère observable grâce à FX + */ + private ObservableList observableStringList; + + /** + * Initialisation de la première ChoiceBox du nombre de numéros voulu + * @param url Paramètre non utilisé mais obligatoire en argument + * @param resourceBundle Paramètre non utilisé mais obligatoire en argument + */ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + + } + + /** + * Action lors d'un évenement concernant la garantie du système + * @param event Action de l'évenement + */ + @FXML + private void numberGuarantee(ActionEvent event){ + + } + + /** + * Action lors d'un évenement concernant le nombre de numéros à jouer + * @param event Action de l'évenement + */ + @FXML + private void numberPlay(ActionEvent event){ + + } + + /** + * Chargement de toutes les options garantie du systeme + */ + private void loadDataGuarantee(){ + + } + + /** + * Chargement de toutes les options liés au nombre de numéro voulu + */ + private void loadDataNumbers(){ + + } + +} diff --git a/src/main/java/fr/myny/gui/GridController.java b/src/main/java/fr/myny/gui/GridController.java new file mode 100644 index 0000000..c4b747a --- /dev/null +++ b/src/main/java/fr/myny/gui/GridController.java @@ -0,0 +1,498 @@ +package fr.myny.gui; + +import javafx.fxml.FXML; +import javafx.fxml.Initializable; + +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.ResourceBundle; + +/** + * Classe permettant d'initaliser la grille de choix des nombres et d'écouter si l'un d'entre eux est sélectionné + */ +public class GridController implements Initializable { + + /** + * Liste des nombres bonus sélectionnés + */ + ArrayList bonusNumbersChecked; + + /** + * Liste des nombres sélectionnés + */ + ArrayList numbersChecked; + + /** + * @param url + * @param resourceBundle + */ + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + + } + + /** + * Contrôleur du numéro bonus 1 + */ + @FXML + private void numberBonusController1() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 2 + */ + @FXML + private void numberBonusController2() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 3 + */ + @FXML + private void numberBonusController3() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 4 + */ + @FXML + private void numberBonusController4() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 5 + */ + @FXML + private void numberBonusController5() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 6 + */ + @FXML + private void numberBonusController6() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 7 + */ + @FXML + private void numberBonusController7() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 8 + */ + @FXML + private void numberBonusController8() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 9 + */ + @FXML + private void numberBonusController9() throws IOException{ + + } + + /** + * Contrôleur du numéro bonus 10 + */ + @FXML + private void numberBonusController10() throws IOException { + + } + + /** + * Contrôleur du numéro 1 + */ + @FXML + private void numberController1() throws IOException { + + } + + /** + * Contrôleur du numéro 2 + */ + @FXML + private void numberController2() throws IOException { + + } + + /** + * Contrôleur du numéro 3 + */ + @FXML + private void numberController3() throws IOException { + + } + + /** + * Contrôleur du numéro 4 + */ + @FXML + private void numberController4() throws IOException { + + } + + /** + * Contrôleur du numéro 5 + */ + @FXML + private void numberController5() throws IOException { + + } + + /** + * Contrôleur du numéro 6 + */ + @FXML + private void numberController6() throws IOException { + + } + + /** + * Contrôleur du numéro 7 + */ + @FXML + private void numberController8() throws IOException { + + } + + /** + * Contrôleur du numéro 9 + */ + @FXML + private void numberController9() throws IOException { + + } + + /** + * Contrôleur du numéro 10 + */ + @FXML + private void numberController10() throws IOException { + + } + + /** + * Contrôleur du numéro 11 + */ + @FXML + private void numberController11() throws IOException { + + } + + /** + * Contrôleur du numéro 12 + */ + @FXML + private void numberController12() throws IOException { + + } + + /** + * Contrôleur du numéro 13 + */ + @FXML + private void numberController13() throws IOException { + + } + + /** + * Contrôleur du numéro 14 + */ + @FXML + private void numberController14() throws IOException { + + } + + /** + * Contrôleur du numéro 15 + */ + @FXML + private void numberController15() throws IOException { + + } + + /** + * Contrôleur du numéro 16 + */ + @FXML + private void numberController16() throws IOException { + + } + + /** + * Contrôleur du numéro 17 + */ + @FXML + private void numberController17() throws IOException { + + } + + /** + * Contrôleur du numéro 18 + */ + @FXML + private void numberController18() throws IOException { + + } + + /** + * Contrôleur du numéro 19 + */ + @FXML + private void numberController19() throws IOException { + + } + + /** + * Contrôleur du numéro 20 + */ + @FXML + private void numberController20() throws IOException { + + } + + /** + * Contrôleur du numéro 21 + */ + @FXML + private void numberController21() throws IOException { + + } + + /** + * Contrôleur du numéro 22 + */ + @FXML + private void numberController22() throws IOException { + + } + + /** + * Contrôleur du numéro 23 + */ + @FXML + private void numberController23() throws IOException { + + } + + /** + * Contrôleur du numéro 24 + */ + @FXML + private void numberController24() throws IOException { + + } + + /** + * Contrôleur du numéro 25 + */ + @FXML + private void numberController25() throws IOException { + + } + + /** + * Contrôleur du numéro 26 + */ + @FXML + private void numberController26() throws IOException { + + } + + /** + * Contrôleur du numéro 27 + */ + @FXML + private void numberController27() throws IOException { + + } + + /** + * Contrôleur du numéro 28 + */ + @FXML + private void numberController28() throws IOException { + + } + + /** + * Contrôleur du numéro 29 + */ + @FXML + private void numberController29() throws IOException { + + } + + /** + * Contrôleur du numéro 30 + */ + @FXML + private void numberController30() throws IOException { + + } + + /** + * Contrôleur du numéro 31 + */ + @FXML + private void numberController31() throws IOException { + + } + + /** + * Contrôleur du numéro 32 + */ + @FXML + private void numberController32() throws IOException { + + } + + /** + * Contrôleur du numéro 33 + */ + @FXML + private void numberController33() throws IOException { + + } + + /** + * Contrôleur du numéro 34 + */ + @FXML + private void numberController34() throws IOException { + + } + + /** + * Contrôleur du numéro 35 + */ + @FXML + private void numberController35() throws IOException { + + } + + /** + * Contrôleur du numéro 36 + */ + @FXML + private void numberController36() throws IOException { + + } + + /** + * Contrôleur du numéro 37 + */ + @FXML + private void numberController37() throws IOException { + + } + + /** + * Contrôleur du numéro 38 + */ + @FXML + private void numberController38() throws IOException { + + } + + /** + * Contrôleur du numéro 39 + */ + @FXML + private void numberController39() throws IOException { + + } + + /** + * Contrôleur du numéro 40 + */ + @FXML + private void numberController40() throws IOException { + + } + + /** + * Contrôleur du numéro 41 + */ + @FXML + private void numberController41() throws IOException { + + } + + /** + * Contrôleur du numéro 42 + */ + @FXML + private void numberController42() throws IOException { + + } + + /** + * Contrôleur du numéro 43 + */ + @FXML + private void numberController43() throws IOException { + + } + + /** + * Contrôleur du numéro 44 + */ + @FXML + private void numberController44() throws IOException { + + } + + /** + * Contrôleur du numéro 45 + */ + @FXML + private void numberController45() throws IOException { + + } + + /** + * Contrôleur du numéro 46 + */ + @FXML + private void numberController46() throws IOException { + + } + + /** + * Contrôleur du numéro 47 + */ + @FXML + private void numberController47() throws IOException { + + } + + /** + * Contrôleur du numéro 48 + */ + @FXML + private void numberController48() throws IOException { + + } + + /** + * Contrôleur du numéro 49 + */ + @FXML + private void numberController49() throws IOException { + + } +} diff --git a/src/main/java/fr/myny/gui/Gui.java b/src/main/java/fr/myny/gui/Gui.java new file mode 100644 index 0000000..633d32b --- /dev/null +++ b/src/main/java/fr/myny/gui/Gui.java @@ -0,0 +1,33 @@ +package fr.myny.gui; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; +import java.io.IOException; + +public class Gui extends Application { + + private static Scene scene; + + @Override + public void start(Stage stage) throws IOException { + scene = new Scene(loadFXML("primary")); + stage.setScene(scene); + stage.show(); + } + + static void setRoot(String fxml) throws IOException { + scene.setRoot(loadFXML(fxml)); + } + + private static Parent loadFXML(String fxml) throws IOException { + FXMLLoader fxmlLoader = new FXMLLoader(Gui.class.getResource(fxml + ".fxml")); + return fxmlLoader.load(); + } + + public static void main(String[] args) { + launch(); + } +} diff --git a/src/main/java/fr/myny/gui/Ihm.java b/src/main/java/fr/myny/gui/Ihm.java deleted file mode 100644 index 023c2f7..0000000 --- a/src/main/java/fr/myny/gui/Ihm.java +++ /dev/null @@ -1,56 +0,0 @@ -package fr.myny.gui; - - -public class Ihm { - - - - /** - * Le constructeur de Ihm - */ - public Ihm(){ - - } - - /** - * La methode de demande de mise a jour de la base de donnees - */ - public void update(){ - - } - - /** - * La methode de demande de recuperation d'URL ??? - */ - public void getUrl(){ - - } - - /** - * La methode de demande de telechargement de donnees - */ - public void downloadData(){ - - } - - /** - * La methode de demande daffichage de donness - */ - public void printStatistics(){ - - } - - /** - * La methode de demande de generation dun fichier pdf avec des grilles proposees - */ - public void printGrid(){ - - } - - /** - * La methode de demande daffichage de la table - */ - public void generateTable(){ - - } -} diff --git a/src/main/java/fr/myny/gui/PrimaryController.java b/src/main/java/fr/myny/gui/PrimaryController.java new file mode 100644 index 0000000..b3e3df4 --- /dev/null +++ b/src/main/java/fr/myny/gui/PrimaryController.java @@ -0,0 +1,13 @@ +package fr.myny.gui; + +import javafx.fxml.FXML; + +import java.io.IOException; + +public class PrimaryController { + + @FXML + private void switchToSecondary() throws IOException { + Gui.setRoot("secondary"); + } +} diff --git a/src/main/java/fr/myny/gui/SecondaryController.java b/src/main/java/fr/myny/gui/SecondaryController.java new file mode 100644 index 0000000..ed9f6bd --- /dev/null +++ b/src/main/java/fr/myny/gui/SecondaryController.java @@ -0,0 +1,13 @@ +package fr.myny.gui; + +import javafx.fxml.FXML; + +import java.io.IOException; + +public class SecondaryController { + + @FXML + private void switchToPrimary() throws IOException { + Gui.setRoot("primary"); + } +} \ No newline at end of file diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java new file mode 100644 index 0000000..8065c10 --- /dev/null +++ b/src/main/java/module-info.java @@ -0,0 +1,7 @@ +module fr.myny.gui { + requires javafx.controls; + requires javafx.fxml; + + opens fr.myny.gui to javafx.fxml; + exports fr.myny.gui; +} \ No newline at end of file diff --git a/src/main/java/test.java b/src/main/java/test.java deleted file mode 100644 index f3b8e17..0000000 --- a/src/main/java/test.java +++ /dev/null @@ -1,25 +0,0 @@ -//import com.opencsv.CSVReader; -//import com.opencsv.exceptions.CsvException; -import fr.myny.stats.Statistics; - -import java.sql.*; -//import com.opencsv.CSVReader; - -public class test{ - public static void main(String[] args) throws SQLException { - System.out.println("Il n'y a rien a voir !"); - System.out.println("nico fait un test"); - System.out.println("Il Je test les branchs"); - - - Statistics c=new Statistics(); - //c.setTaille(); - //c.afficherChiffre1(); - //c.afficherNumBonus(); - c.afficherCombinaisons2(4); - //c.afficherNumBonus(1); - //c.afficherCombinaisons3(32,16); - //c.afficherNumBonusCombi2(5,10); - //c.afficherNumBonusCombi3(28,14,37); - } -} \ No newline at end of file diff --git a/src/main/resources/fr/myny/gui/popup.fxml b/src/main/resources/fr/myny/gui/popup.fxml new file mode 100644 index 0000000..df35472 --- /dev/null +++ b/src/main/resources/fr/myny/gui/popup.fxml @@ -0,0 +1,13 @@ + + + + + + + +