Correction du makefile + modification du readme + correction d'un type dans GMSaver.java

This commit is contained in:
Marco ORFAO 2024-05-04 18:05:16 +02:00
parent 5baac14c9b
commit ff895c17c5
3 changed files with 91 additions and 117 deletions

183
Makefile
View File

@ -1,147 +1,128 @@
### VARIABLES ###
DOCDIR := ./doc
SRCDIR := ./src
SRC := $(wildcard $(SRCDIR)/*.java)
OUTDIR := ./build
JC := javac
JCFLAGS := -encoding UTF-8 -implicit:none
JC = javac
JVM = java
JVMFLAGS =
JVM := java
JVMFLAGS :=
SRCDIR := ./src
OUTDIR := ./build
DOCDIR := ./doc
SRC := $(wildcard $(SRCDIR)/*.java)
OFILES := $(wildcard $(OUTDIR)/*.class)
### REGLES ESSENTIELLES ###
${OUTDIR}/GridMaker.class : ${SRCDIR}/GridMaker.java ${OUTDIR}/Window.class ${OUTDIR}/HomeView.class
${JC} ${JCFLAGS} ${SRCDIR}/GridMaker.java -d $(OUTDIR)
GridSolver.class : ${SRCDIR}/GridSolver.java Window.class HomeView.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GridSolver.java -d $(OUTDIR)
${OUTDIR}/GridSolver.class : ${SRCDIR}/GridSolver.java ${OUTDIR}/Window.class ${OUTDIR}/HomeView.class
${JC} ${JCFLAGS} ${SRCDIR}/GridSolver.java -d $(OUTDIR)
GMChecker.class : ${SRCDIR}/GMChecker.java GMGrid.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GMChecker.java -d $(OUTDIR)
${OUTDIR}/Window.class : ${SRCDIR}/Window.java
${JC} ${JCFLAGS} ${SRCDIR}/Window.java -d $(OUTDIR)
GMHowToCreateView.class : ${SRCDIR}/GMHowToCreateView.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateView.java -d $(OUTDIR)
${OUTDIR}/Title.class : ${SRCDIR}/Title.java
${JC} ${JCFLAGS} ${SRCDIR}/Title.java -d $(OUTDIR)
HomeView.class HomeButtonClickListener.class : ${SRCDIR}/HomeView.java ${SRCDIR}/HomeButtonClickListener.java MusicButton.class Window.class Title.class Button.class DialogManager.class GMUserInterfaceView.class GSMenu.class GSMenuController.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/HomeView.java ${SRCDIR}/HomeButtonClickListener.java -d $(OUTDIR)
${OUTDIR}/Button.class : ${SRCDIR}/Button.java
${JC} ${JCFLAGS} ${SRCDIR}/Button.java -d $(OUTDIR)
GSMenu.class : ${SRCDIR}/GSMenu.java Window.class Title.class Button.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSMenu.java -d $(OUTDIR)
${OUTDIR}/CongratulationsDialog.class : ${SRCDIR}/CongratulationsDialog.java
${JC} ${JCFLAGS} ${SRCDIR}/CongratulationsDialog.java -d $(OUTDIR)
GSMenuController.class : ${SRCDIR}/GSMenuController.java GSMenu.class Window.class GSGrid.class GSPlay.class GSPlayController.class GSSolver.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSMenuController.java -d $(OUTDIR)
${OUTDIR}/DialogManager.class : ${SRCDIR}/DialogManager.java
${JC} ${JCFLAGS} ${SRCDIR}/DialogManager.java -d $(OUTDIR)
GSGrid.class GSCase.class GSCaseMouseListener.class : ${SRCDIR}/GSGrid.java GSMenu.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSGrid.java ${SRCDIR}/GSCase.java ${SRCDIR}/GSCaseMouseListener.java -d $(OUTDIR)
${OUTDIR}/GMCase.class : ${SRCDIR}/GMCase.java ${OUTDIR}/GMGrid.class ${OUTDIR}/GMCaseKeyListener.class ${OUTDIR}/GMCaseMouseListener.class
${JC} ${JCFLAGS} ${SRCDIR}/GMCase.java -d $(OUTDIR)
GSSolver.class : ${SRCDIR}/GSSolver.java GSGrid.class Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSSolver.java -d $(OUTDIR)
${OUTDIR}/GMCaseKeyListener.class : ./GMCaseKeyListener.java ${OUTDIR}/GMCase.class ${OUTDIR}/GMGrid.class
${JC} ${JCFLAGS} ${SRCDIR}/GMCaseKeyListener.java -d $(OUTDIR)
MusicButton.class : ${SRCDIR}/MusicButton.java MusicPlayer.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/MusicButton.java -d $(OUTDIR)
${OUTDIR}/GMCaseMouseListener.class : ./GMCaseMouseListener.java ${OUTDIR}/GMCase.class
${JC} ${JCFLAGS} ${SRCDIR}/GMCaseMouseListener.java -d $(OUTDIR)
MusicPlayer.class : ${SRCDIR}/MusicPlayer.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/MusicPlayer.java -d $(OUTDIR)
${OUTDIR}/GMChecker.class : ${SRCDIR}/GMChecker.java ${OUTDIR}/GMGrid.class
${JC} ${JCFLAGS} ${SRCDIR}/GMChecker.java -d $(OUTDIR)
Rules.class : ${SRCDIR}/Rules.java RulesDialogManager.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Rules.java -d $(OUTDIR)
${OUTDIR}/GMGrid.class : ${SRCDIR}/GMGrid.java ${OUTDIR}/GMCase.class
${JC} ${JCFLAGS} ${SRCDIR}/GMGrid.java -d $(OUTDIR)
RulesDialogManager.class : ${SRCDIR}/RulesDialogManager.java DialogManager.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/RulesDialogManager.java -d $(OUTDIR)
${OUTDIR}/GMHowToCreateController.class : ${SRCDIR}/GMHowToCreateController.java ${OUTDIR}/GMHowToCreateDialogManager.class
${JC} ${JCFLAGS} ${SRCDIR}/GMHowToCreateController.java -d $(OUTDIR)
DialogManager.class : ${SRCDIR}/DialogManager.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/DialogManager.java -d $(OUTDIR)
${OUTDIR}/GMHowToCreateDialogManager.class : ${SRCDIR}/GMHowToCreateDialogManager.java ${OUTDIR}/GMHowToCreateView.class
${JC} ${JCFLAGS} ${SRCDIR}/GMHowToCreateDialogManager.java -d $(OUTDIR)
RulesSudoku.class : ${SRCDIR}/RulesSudoku.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/RulesSudoku.java -d $(OUTDIR)
${OUTDIR}/GMHowToCreateView.class : ${SRCDIR}/GMHowToCreateView.java
${JC} ${JCFLAGS} ${SRCDIR}/GMHowToCreateView.java -d $(OUTDIR)
Window.class : ${SRCDIR}/Window.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Window.java -d $(OUTDIR)
${OUTDIR}/GMImport.class : ${SRCDIR}/GMImport.java ${OUTDIR}/GMGrid.class
${JC} ${JCFLAGS} ${SRCDIR}/GMImport.java -d $(OUTDIR)
Title.class : ${SRCDIR}/Title.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Title.java -d $(OUTDIR)
${OUTDIR}/GMResetGrid.class : ${SRCDIR}/GMResetGrid.java ${OUTDIR}/GMGrid.class
${JC} ${JCFLAGS} ${SRCDIR}/GMResetGrid.java -d $(OUTDIR)
Button.class : ${SRCDIR}/Button.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/Button.java -d $(OUTDIR)
${OUTDIR}/${OUTDIR}/Rules.class : ${SRCDIR}/Rules.java
${JC} ${JCFLAGS} ${SRCDIR}/Rules.java -d $(OUTDIR)
GMUserInterfaceView.class : ${SRCDIR}/GMUserInterfaceView.java GMGrid.class GMResetGrid.class GMImport.class GMSaverActionListener.class GMHowToCreateController.class Rules.class GMUserInterfaceController.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMUserInterfaceView.java -d $(OUTDIR)
${OUTDIR}/GMSaver.class : ${SRCDIR}/GMSaver.java ${OUTDIR}/GMGrid.class ${OUTDIR}/GMChecker.class
${JC} ${JCFLAGS} ${SRCDIR}/GMSaver.java -d $(OUTDIR)
GMGrid.class : ${SRCDIR}/GMGrid.java GMCase.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMGrid.java -d $(OUTDIR)
${OUTDIR}/GMSaverActionListener.class : ${SRCDIR}/GMSaverActionListener.java ${OUTDIR}/Window.class ${OUTDIR}/GMGrid.class ${OUTDIR}/GMSaver.class
${JC} ${JCFLAGS} ${SRCDIR}/GMSaverActionListener.java -d $(OUTDIR)
GMCase.class GMCaseKeyListener.class GMCaseMouseListener.class : ${SRCDIR}/GMCase.java ${SRCDIR}/GMCaseKeyListener.java ${SRCDIR}/GMCaseMouseListener.java
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMCase.java ${SRCDIR}/GMCaseKeyListener.java ${SRCDIR}/GMCaseMouseListener.java -d $(OUTDIR)
${OUTDIR}/GMUserInterfaceController.class : ${SRCDIR}/GMUserInterfaceController.java ${OUTDIR}/Window.class
${JC} ${JCFLAGS} ${SRCDIR}/GMUserInterfaceController.java -d $(OUTDIR)
GMResetGrid.class : ${SRCDIR}/GMResetGrid.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMResetGrid.java -d $(OUTDIR)
${OUTDIR}/GMUserInterfaceView.class : ${SRCDIR}/GMUserInterfaceView.java ${OUTDIR}/GMGrid.class ${OUTDIR}/Window.class ${OUTDIR}/GMResetGrid.class ${OUTDIR}/GMImport.class ${OUTDIR}/GMSaverActionListener.class ${OUTDIR}/GMHowToCreateController.class ${OUTDIR}/Rules.class
${JC} ${JCFLAGS} ${SRCDIR}/GMUserInterfaceView.java -d $(OUTDIR)
GMImport.class : ${SRCDIR}/GMImport.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMImport.java -d $(OUTDIR)
${OUTDIR}/GSCase.class : ${SRCDIR}/GSCase.java ${OUTDIR}/GSGrid.class ${OUTDIR}/GSCaseMouseListener.class ${OUTDIR}/GSTest.class
${JC} ${JCFLAGS} ${SRCDIR}/GSCase.java -d $(OUTDIR)
GMSaverActionListener.class GMSaver.class : ${SRCDIR}/GMSaverActionListener.java ${SRCDIR}/GMSaver.java GMGrid.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMSaverActionListener.java ${SRCDIR}/GMSaver.java -d $(OUTDIR)
${OUTDIR}/GSCaseMouseListener.class : ${SRCDIR}/GSCaseMouseListener.java ${OUTDIR}/GSCase.class
${JC} ${JCFLAGS} ${SRCDIR}/GSCaseMouseListener.java -d $(OUTDIR)
GMHowToCreateController.class : ${SRCDIR}/GMHowToCreateController.java GMHowToCreateDialogManager.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateController.java -d $(OUTDIR)
${OUTDIR}/GSGrid.class : ${SRCDIR}/GSGrid.java ${OUTDIR}/GSCase.class ${OUTDIR}/GSTest.class
${JC} ${JCFLAGS} ${SRCDIR}/GSGrid.java -d $(OUTDIR)
GMHowToCreateDialogManager.class : ${SRCDIR}/GMHowToCreateDialogManager.java DialogManager.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMHowToCreateDialogManager.java -d $(OUTDIR)
${OUTDIR}/GSImport.class : ${SRCDIR}/GSImport.java ${OUTDIR}/Window.class
${JC} ${JCFLAGS} ${SRCDIR}/GSImport.java -d $(OUTDIR)
GMUserInterfaceController.class : ${SRCDIR}/GMUserInterfaceController.java Window.class
${JC} ${JFCLAGS} -cp $(SRCDIR) ${SRCDIR}/GMUserInterfaceController.java -d $(OUTDIR)
${OUTDIR}/GSMenu.class : ${SRCDIR}/GSMenu.java ${OUTDIR}/Title.class ${OUTDIR}/Button.class ${OUTDIR}/Window.class
${JC} ${JCFLAGS} ${SRCDIR}/GSMenu.java -d $(OUTDIR)
GridMaker.class : ${SRCDIR}/GridMaker.java Window.class HomeView.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GridMaker.java -d $(OUTDIR)
${OUTDIR}/GSMenuController.class : ${SRCDIR}/GSMenuController.java ${OUTDIR}/GSMenu.class ${OUTDIR}/Window.class ${OUTDIR}/GSGrid.class ${OUTDIR}/GSMenu.class ${OUTDIR}/GSImport.class ${OUTDIR}/GSPlay.class ${OUTDIR}/GSPlayController.class ${OUTDIR}/GSSolver.class
${JC} ${JCFLAGS} ${SRCDIR}/GSMenuController.java -d $(OUTDIR)
GSWin.class : ${SRCDIR}/GSWin.java DialogManager.class CongratulationsDialog.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSWin.java -d $(OUTDIR)
${OUTDIR}/GSPlay.class : ${SRCDIR}/GSPlay.java ${OUTDIR}/GSGrid.class ${OUTDIR}/Button.class ${OUTDIR}/Window.class ${OUTDIR}/GSPlayController.class
${JC} ${JCFLAGS} ${SRCDIR}/GSPlay.java -d $(OUTDIR)
CongratulationsDialog.class : ${SRCDIR}/CongratulationsDialog.java
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/CongratulationsDialog.java -d $(OUTDIR)
${OUTDIR}/GSPlayController.class : ${SRCDIR}/GSPlayController.java ${OUTDIR}/GSPlay.class ${OUTDIR}/GSWin.class
${JC} ${JCFLAGS} ${SRCDIR}/GSPlayController.java -d $(OUTDIR)
${OUTDIR}/GSSolver.class : ${SRCDIR}/GSSolver.java ${OUTDIR}/GSGrid.class ${OUTDIR}/Window.class
${JC} ${JCFLAGS} ${SRCDIR}/GSSolver.java -d $(OUTDIR)
${OUTDIR}/GSTest.class : ${SRCDIR}/GSTest.java ${OUTDIR}/GSGrid.class
${JC} ${JCFLAGS} ${SRCDIR}/GSTest.java -d $(OUTDIR)
${OUTDIR}/GSWin.class : ${SRCDIR}/GSWin.java
${JC} ${JCFLAGS} ${SRCDIR}/GSWin.java -d $(OUTDIR)
${OUTDIR}/HomeButtonClickListener.class : ${SRCDIR}/HomeButtonClickListener.java ${OUTDIR}/Window.class ${OUTDIR}/GSMenu.class ${OUTDIR}/GSMenuController.class ${OUTDIR}/GMUserInterfaceView.class ${OUTDIR}/DialogManager.class
${JC} ${JCFLAGS} ${SRCDIR}/HomeButtonClickListener.java -d $(OUTDIR)
${OUTDIR}/HomeView.class : ${SRCDIR}/HomeView.java ${OUTDIR}/MusicButton.class ${OUTDIR}/Window.class ${OUTDIR}/Title.class ${OUTDIR}/HomeButtonClickListener.class ${OUTDIR}/Button.class
${JC} ${JCFLAGS} ${SRCDIR}/HomeView.java -d $(OUTDIR)
${OUTDIR}/MusicPlayer.class : ${SRCDIR}/MusicPlayer.java
${JC} ${JCFLAGS} ${SRCDIR}/MusicPlayer.java -d $(OUTDIR)
${OUTDIR}/MusicButton.class : ${SRCDIR}/MusicButton.java ${OUTDIR}/MusicPlayer.class
${JC} ${JCFLAGS} ${SRCDIR}/MusicButton.java -d $(OUTDIR)
${OUTDIR}/RulesDialogManager.class : ${SRCDIR}/RulesDialogManager.java ${OUTDIR}/RulesSudoku.class
${JC} ${JCFLAGS} ${SRCDIR}/RulesDialogManager.java -d $(OUTDIR)
${OUTDIR}/RulesSudoku.class : ${SRCDIR}/RulesSudoku.java ${OUTDIR}/Title.class
${JC} ${JCFLAGS} ${SRCDIR}/RulesSudoku.java -d $(OUTDIR)
GSTest.class : ${SRCDIR}/GSTest.java GSGrid.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSTest.java -d $(OUTDIR)
GSImport.class : ${SRCDIR}/GSImport.java Window.class
${JC} ${JCFLAGS} -cp $(SRCDIR) ${SRCDIR}/GSImport.java -d $(OUTDIR)
### REGLES OPTIONNELLES ###
GridMaker : $(OFILES)
GridMaker : Window.class Title.class RulesSudoku.class RulesDialogManager.class Rules.class MusicPlayer.class MusicButton.class HomeView.class HomeButtonClickListener.class GridMaker.class GMUserInterfaceView.class GMUserInterfaceController.class GMSaverActionListener.class GMSaver.class GMResetGrid.class GMImport.class GMHowToCreateView.class GMHowToCreateDialogManager.class GMHowToCreateController.class GMGrid.class GMChecker.class GMCaseMouseListener.class GMCaseKeyListener.class GMCase.class DialogManager.class Button.class
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker
GridSolver : $(OFILES)
GridSolver : Window.class Title.class RulesSudoku.class RulesDialogManager.class Rules.class MusicPlayer.class MusicButton.class HomeView.class HomeButtonClickListener.class GSWin.class GSTest.class GSSolver.class GSPlayController.class GSPlay.class GSMenuController.class GSMenu.class GSImport.class GSGrid.class GSCaseMouseListener.class GSCase.class GridSolver.class DialogManager.class CongratulationsDialog.class Button.class
${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver
doc :
javadoc -d $(DOCDIR) $(SRC)
clean :
-rm -rf $(OUTDIR)
-rm -rf $(DOCDIR)
.PHONY : clean doc
doc :
javadoc -d $(DOCDIR) $(SRC)
default:
### BUTS FACTICES ###
.PHONY : run clean doc
### FIN ###

View File

@ -1,13 +1,12 @@
# Résolveur de Sudoku 🧩
# Sudoku 🧩
Ce projet vise à créer un programme en Java pour la résolution de grilles de [Sudoku](https://fr.wikipedia.org/wiki/Sudoku). Ce projet a été réalisée dans le cadre du [SAÉ2.01 "Développement d'une application"](https://www.iut-fbleau.fr/sitebp/pt21/21_2023/A75DYGZ82RZL3PGH.php) lors du deuxième semestre de BUT 1 à l'IUT de Fontainebleau.
## Table des matières
- [Introduction](#introduction)
- [Lancement du programme](#lancement-du-programme)
- [Compilation](#compilation)
- [Lancement du créateur de grille](#Lancement-du-créateur-de-grille)
- [Lancement du solveur de grille](#Lancement-du-solveur-de-grille)
- [Compilation et lancement du créateur de grille](#Compilation-et-lancement-du-createur-de-grille)
- [Compilation et lancement du solveur de grille](#Compilation-et-lancement-du-solveur-de-grille)
- [Suppression des fichiers](#suppression-des-fichiers)
- [Générer la documentation](#générer-la-documentation)
- [Crédits](#crédits)
@ -18,22 +17,16 @@ Le Sudoku est un jeu de logique consistant à remplir une grille de 9x9 cases di
## Lancement du programme
### Compilation
Utiliser la commande suivante pour compiler :
```bash
make
```
### Compilation et lancement du createur de grille
### Lancement du créateur de grille
Utiliser la commande suivante pour lancer le créateur de grille :
Utiliser la commande suivante pour compiler et lancer le créateur de grille :
```bash
make GridMaker
```
### Lancement du solveur de grille
### Compilation et lancement du solveur de grille
Utiliser la commande suivante pour lancer le solveur de grille :
Utiliser la commande suivante pour compiler et lancer le solveur de grille :
```bash
make GridSolveur
```

View File

@ -20,7 +20,7 @@ public class GMSaver {
/**
* La fenêtre parent
*/
private JFrame parentFrame;
private Window parentFrame;
/**
* La grille de jeu à sauvegarder
@ -37,7 +37,7 @@ public class GMSaver {
* @param parentFrame La fenêtre parent.
* @param grid La grille de jeu à sauvegarder.
*/
public GMSaver(JFrame parentFrame, GMGrid grid) {
public GMSaver(Window parentFrame, GMGrid grid) {
this.parentFrame = parentFrame;
this.grid = grid;
this.testGrille = new GMChecker(this.grid);