From 8d482356d3d7c1a435243c05f91d469576735f70 Mon Sep 17 00:00:00 2001 From: stiti Date: Tue, 23 Apr 2024 20:58:14 +0200 Subject: [PATCH] =?UTF-8?q?PeerWorking=20:=20S=C3=A9paration=20de=20GridMa?= =?UTF-8?q?ker=20et=20GridSolver=20temporaire=20avant=20r=C3=A9organisatio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- src/.DS_Store | Bin 8196 -> 6148 bytes src/{ => GridMaker}/Button.java | 0 src/{ => GridMaker}/DialogManager.java | 0 .../GridMakeUserInterfaceController.java | 3 +-- .../GridMakeUserInterfaceView.java | 2 +- src/{ => GridMaker}/GridMakerCase.java | 0 src/{ => GridMaker}/GridMakerChecker.java | 0 src/{ => GridMaker}/GridMakerGrid.java | 0 .../GridMakerHowToCreateController.java | 0 .../GridMakerHowToCreateDialogManager.java | 0 .../GridMakerHowToCreateView.java | 0 src/{ => GridMaker}/GridMakerImport.java | 0 src/{ => GridMaker}/GridMakerResetGrid.java | 0 src/{ => GridMaker}/GridMakerRules.java | 0 src/{ => GridMaker}/GridMakerSaver.java | 0 .../HomeButtonClickListener.java | 7 ++----- src/{ => GridMaker}/HomeView.java | 4 ++-- src/{ => GridMaker}/Main.java | 0 src/{ => GridMaker}/MusicButton.java | 0 src/{ => GridMaker}/MusicPlayer.java | 0 src/{ => GridMaker}/RulesDialogManager.java | 0 src/{ => GridMaker}/RulesSudoku.java | 0 src/{ => GridMaker}/Title.java | 0 src/{ => GridMaker}/Window.java | 11 ----------- 25 files changed, 7 insertions(+), 22 deletions(-) rename src/{ => GridMaker}/Button.java (100%) rename src/{ => GridMaker}/DialogManager.java (100%) rename src/{ => GridMaker}/GridMakeUserInterfaceController.java (78%) rename src/{ => GridMaker}/GridMakeUserInterfaceView.java (93%) rename src/{ => GridMaker}/GridMakerCase.java (100%) rename src/{ => GridMaker}/GridMakerChecker.java (100%) rename src/{ => GridMaker}/GridMakerGrid.java (100%) rename src/{ => GridMaker}/GridMakerHowToCreateController.java (100%) rename src/{ => GridMaker}/GridMakerHowToCreateDialogManager.java (100%) rename src/{ => GridMaker}/GridMakerHowToCreateView.java (100%) rename src/{ => GridMaker}/GridMakerImport.java (100%) rename src/{ => GridMaker}/GridMakerResetGrid.java (100%) rename src/{ => GridMaker}/GridMakerRules.java (100%) rename src/{ => GridMaker}/GridMakerSaver.java (100%) rename src/{ => GridMaker}/HomeButtonClickListener.java (80%) rename src/{ => GridMaker}/HomeView.java (96%) rename src/{ => GridMaker}/Main.java (100%) rename src/{ => GridMaker}/MusicButton.java (100%) rename src/{ => GridMaker}/MusicPlayer.java (100%) rename src/{ => GridMaker}/RulesDialogManager.java (100%) rename src/{ => GridMaker}/RulesSudoku.java (100%) rename src/{ => GridMaker}/Title.java (100%) rename src/{ => GridMaker}/Window.java (82%) diff --git a/Makefile b/Makefile index 54280af..9d20c79 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ JCFLAGS := -encoding UTF-8 -implicit:none JVM := java JVMFLAGS := -SRCDIR := ./src +SRCDIR := ./src/GridMaker OUTDIR := ./out DOCDIR := ./doc SRC := $(wildcard $(SRCDIR)/*.java) diff --git a/src/.DS_Store b/src/.DS_Store index c1be4fdc053e95c1ef8f287a97751a0bbf7d7ad7..0d19af3a42908e61885443e46b731c9655cbecfd 100644 GIT binary patch delta 104 zcmZp1XfcprU|?W$DortDU=RQ@Ie-{Mvv5r;6q~50$jH4hU^g=(_hcS{+RdyYbYx15PdE^6e3VnKH39CDUr>oT_mthOz3LPh>e|>SS)ERfnJM85#whGW0$Kl^i=;qbsI#PvUlr!!XlCEu6SR2SB#I{ZNYpNS%h;!1 z%^lCL4cVMG(b}}DNBLajQ^R}ejC8Ny%~c=!S`7ABt~>)btOZ+=|343Z|G)BfMgt-P zk%2G+X0_RF);VtiYb4iBSU<2zk#)J1s=`LoaY{|cDHs1RWIy3j(Mg@mt>g&HKmQQm TzrX$85AppU-~Sqs*Q5Ch6MgNn diff --git a/src/Button.java b/src/GridMaker/Button.java similarity index 100% rename from src/Button.java rename to src/GridMaker/Button.java diff --git a/src/DialogManager.java b/src/GridMaker/DialogManager.java similarity index 100% rename from src/DialogManager.java rename to src/GridMaker/DialogManager.java diff --git a/src/GridMakeUserInterfaceController.java b/src/GridMaker/GridMakeUserInterfaceController.java similarity index 78% rename from src/GridMakeUserInterfaceController.java rename to src/GridMaker/GridMakeUserInterfaceController.java index 09a1a44..d7a9997 100644 --- a/src/GridMakeUserInterfaceController.java +++ b/src/GridMaker/GridMakeUserInterfaceController.java @@ -10,7 +10,6 @@ public class GridMakeUserInterfaceController implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - Window.removeAllComponents(window); - HomeView homeView = new HomeView(window); + System.exit(0); } } diff --git a/src/GridMakeUserInterfaceView.java b/src/GridMaker/GridMakeUserInterfaceView.java similarity index 93% rename from src/GridMakeUserInterfaceView.java rename to src/GridMaker/GridMakeUserInterfaceView.java index 10f0b92..dc3862c 100755 --- a/src/GridMakeUserInterfaceView.java +++ b/src/GridMaker/GridMakeUserInterfaceView.java @@ -36,7 +36,7 @@ public class GridMakeUserInterfaceView { // Ajout du menu "Jouer" JMenu menuJouer = createMenu("Quitter"); // Création de l'élément de menu "Retour" - JMenuItem retourMenu = createMenuItem("Menu principal",new GridMakeUserInterfaceController(window)); + JMenuItem retourMenu = createMenuItem("Quitter",new GridMakeUserInterfaceController(window)); // Ajout de l'élément "Retour" au menu "Jouer" menuJouer.add(retourMenu); // Ajout du menu "Jouer" à la barre de menu diff --git a/src/GridMakerCase.java b/src/GridMaker/GridMakerCase.java similarity index 100% rename from src/GridMakerCase.java rename to src/GridMaker/GridMakerCase.java diff --git a/src/GridMakerChecker.java b/src/GridMaker/GridMakerChecker.java similarity index 100% rename from src/GridMakerChecker.java rename to src/GridMaker/GridMakerChecker.java diff --git a/src/GridMakerGrid.java b/src/GridMaker/GridMakerGrid.java similarity index 100% rename from src/GridMakerGrid.java rename to src/GridMaker/GridMakerGrid.java diff --git a/src/GridMakerHowToCreateController.java b/src/GridMaker/GridMakerHowToCreateController.java similarity index 100% rename from src/GridMakerHowToCreateController.java rename to src/GridMaker/GridMakerHowToCreateController.java diff --git a/src/GridMakerHowToCreateDialogManager.java b/src/GridMaker/GridMakerHowToCreateDialogManager.java similarity index 100% rename from src/GridMakerHowToCreateDialogManager.java rename to src/GridMaker/GridMakerHowToCreateDialogManager.java diff --git a/src/GridMakerHowToCreateView.java b/src/GridMaker/GridMakerHowToCreateView.java similarity index 100% rename from src/GridMakerHowToCreateView.java rename to src/GridMaker/GridMakerHowToCreateView.java diff --git a/src/GridMakerImport.java b/src/GridMaker/GridMakerImport.java similarity index 100% rename from src/GridMakerImport.java rename to src/GridMaker/GridMakerImport.java diff --git a/src/GridMakerResetGrid.java b/src/GridMaker/GridMakerResetGrid.java similarity index 100% rename from src/GridMakerResetGrid.java rename to src/GridMaker/GridMakerResetGrid.java diff --git a/src/GridMakerRules.java b/src/GridMaker/GridMakerRules.java similarity index 100% rename from src/GridMakerRules.java rename to src/GridMaker/GridMakerRules.java diff --git a/src/GridMakerSaver.java b/src/GridMaker/GridMakerSaver.java similarity index 100% rename from src/GridMakerSaver.java rename to src/GridMaker/GridMakerSaver.java diff --git a/src/HomeButtonClickListener.java b/src/GridMaker/HomeButtonClickListener.java similarity index 80% rename from src/HomeButtonClickListener.java rename to src/GridMaker/HomeButtonClickListener.java index fa64ceb..9d729ad 100644 --- a/src/HomeButtonClickListener.java +++ b/src/GridMaker/HomeButtonClickListener.java @@ -29,12 +29,9 @@ class HomeButtonClickListener implements ActionListener { public void actionPerformed(ActionEvent e) { String buttonText = ((Button) e.getSource()).getText(); switch (buttonText) { - case "Jouer": - System.out.println("Bouton jouer cliquer"); // lancer jeu - break; case "Générer une grille": - Window.removeAllComponents(this.window); // Supprimer tout ce qu'il y a sur la fenêtre - new GridMakeUserInterfaceView(this.window); // Lancer le créateur de grille + Window.removeAllComponents(this.window); + GridMakeUserInterfaceView vueCreationGrille = new GridMakeUserInterfaceView(this.window); // Lancer le créateur de grille break; case "Règles": rulesDialogManager.showDialog(); // Afficher les règles diff --git a/src/HomeView.java b/src/GridMaker/HomeView.java similarity index 96% rename from src/HomeView.java rename to src/GridMaker/HomeView.java index 494d169..e932d52 100644 --- a/src/HomeView.java +++ b/src/GridMaker/HomeView.java @@ -22,11 +22,11 @@ public class HomeView extends JPanel { private final Font TITLE_FONT = new Font("Copperplate", Font.BOLD, 75); private final Font SUBTITLE_FONT = new Font("Copperplate", Font.PLAIN, 24); private final Font BUTTON_FONT = new Font("Copperplate", Font.BOLD, 24); - private final String[] BUTTON_TEXTS = {"Jouer", "Générer une grille", "Règles", "Quitter"}; + private final String[] BUTTON_TEXTS = {"Générer une grille", "Règles", "Quitter"}; // Tableau de titres pour le titre principal et le sous-titre private final Title[] labels = { - new Title("Sudoku Solver", TITLE_FONT, TITLE_TEXT_COLOR), + new Title("Sudoku Grid Creator", TITLE_FONT, TITLE_TEXT_COLOR), new Title("Par Moncef & Marco", SUBTITLE_FONT, TITLE_TEXT_COLOR) }; diff --git a/src/Main.java b/src/GridMaker/Main.java similarity index 100% rename from src/Main.java rename to src/GridMaker/Main.java diff --git a/src/MusicButton.java b/src/GridMaker/MusicButton.java similarity index 100% rename from src/MusicButton.java rename to src/GridMaker/MusicButton.java diff --git a/src/MusicPlayer.java b/src/GridMaker/MusicPlayer.java similarity index 100% rename from src/MusicPlayer.java rename to src/GridMaker/MusicPlayer.java diff --git a/src/RulesDialogManager.java b/src/GridMaker/RulesDialogManager.java similarity index 100% rename from src/RulesDialogManager.java rename to src/GridMaker/RulesDialogManager.java diff --git a/src/RulesSudoku.java b/src/GridMaker/RulesSudoku.java similarity index 100% rename from src/RulesSudoku.java rename to src/GridMaker/RulesSudoku.java diff --git a/src/Title.java b/src/GridMaker/Title.java similarity index 100% rename from src/Title.java rename to src/GridMaker/Title.java diff --git a/src/Window.java b/src/GridMaker/Window.java similarity index 82% rename from src/Window.java rename to src/GridMaker/Window.java index 2f543cc..0cdf564 100644 --- a/src/Window.java +++ b/src/GridMaker/Window.java @@ -58,17 +58,6 @@ public class Window extends JFrame { this.setTitle(this.PAGE_TITLE + " - " + Window.PROGRAM_TITLE); } - /** - * Change le contenu de la fenêtre pour afficher un nouveau panneau. - * @param menuPanel Le nouveau panneau à afficher. - */ - public void changeMenu(JPanel menuPanel) { - getContentPane().removeAll(); // Supprime tous les composants actuels de la fenêtre - getContentPane().add(menuPanel); // Ajoute le nouveau panneau - revalidate(); // Revalide la disposition des composants - repaint(); // Redessine la fenêtre - } - /** * Supprime tous les composants de la fenêtre. * Utilisé pour effacer le contenu de la fenêtre.