From e09fa1dd7c7d521c9a468f693f6817e5f7725770 Mon Sep 17 00:00:00 2001 From: stiti Date: Fri, 3 May 2024 08:04:15 +0200 Subject: [PATCH] Modification du makefile + Modification du nom de la classe Rules --- Makefile | 294 ++++++++++++++----------------- src/GMUserInterfaceView.java | 2 +- src/{GMRules.java => Rules.java} | 8 +- 3 files changed, 136 insertions(+), 168 deletions(-) rename src/{GMRules.java => Rules.java} (81%) diff --git a/Makefile b/Makefile index 104797c..cb71f39 100644 --- a/Makefile +++ b/Makefile @@ -1,131 +1,141 @@ +### VARIABLES ### + DOCDIR := ./doc SRCDIR := ./src SRC := $(wildcard $(SRCDIR)/*.java) OUTDIR := ./build +JCFLAGS := -encoding UTF-8 -implicit:none +JC = javac +JVM = java +JVMFLAGS = + +### REGLES ESSENTIELLES ### + +${OUTDIR}/GridMaker.class : ${SRCDIR}/GridMaker.java ${OUTDIR}/Window.class ${OUTDIR}/HomeView.class + ${JC} ${JCFLAGS} ${SRCDIR}/GridMaker.java -d $(OUTDIR) + +${OUTDIR}/Window.class : ${SRCDIR}/Window.java + ${JC} ${JCFLAGS} ${SRCDIR}/Window.java -d $(OUTDIR) + +${OUTDIR}/Title.class : ${SRCDIR}/Title.java + ${JC} ${JCFLAGS} ${SRCDIR}/Title.java -d $(OUTDIR) + +${OUTDIR}/GridSolver.class : ${SRCDIR}/GridSolver.java ${OUTDIR}/Window.class ${OUTDIR}/HomeView.class + ${JC} ${JCFLAGS} ${SRCDIR}/GridSolver.java -d $(OUTDIR) + +${OUTDIR}/Button.class : ${SRCDIR}/Button.java + ${JC} ${JCFLAGS} ${SRCDIR}/Button.java -d $(OUTDIR) + +${OUTDIR}/CongratulationsDialog.class : ${SRCDIR}/CongratulationsDialog.java + ${JC} ${JCFLAGS} ${SRCDIR}/CongratulationsDialog.java -d $(OUTDIR) + +${OUTDIR}/DialogManager.class : ${SRCDIR}/DialogManager.java + ${JC} ${JCFLAGS} ${SRCDIR}/DialogManager.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) + +${OUTDIR}/GMCaseKeyListener.class : ./GMCaseKeyListener.java ${OUTDIR}/GMCase.class ${OUTDIR}/GMGrid.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMCaseKeyListener.java -d $(OUTDIR) + +${OUTDIR}/GMCaseMouseListener.class : ./GMCaseMouseListener.java ${OUTDIR}/GMCase.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMCaseMouseListener.java -d $(OUTDIR) + +${OUTDIR}/GMChecker.class : ${SRCDIR}/GMChecker.java ${OUTDIR}/GMGrid.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMChecker.java -d $(OUTDIR) + +${OUTDIR}/GMGrid.class : ${SRCDIR}/GMGrid.java ${OUTDIR}/GMCase.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMGrid.java -d $(OUTDIR) + +${OUTDIR}/GMHowToCreateController.class : ${SRCDIR}/GMHowToCreateController.java ${OUTDIR}/GMHowToCreateDialogManager.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMHowToCreateController.java -d $(OUTDIR) + +${OUTDIR}/GMHowToCreateDialogManager.class : ${SRCDIR}/GMHowToCreateDialogManager.java ${OUTDIR}/GMHowToCreateView.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMHowToCreateDialogManager.java -d $(OUTDIR) + +${OUTDIR}/GMHowToCreateView.class : ${SRCDIR}/GMHowToCreateView.java + ${JC} ${JCFLAGS} ${SRCDIR}/GMHowToCreateView.java -d $(OUTDIR) + +${OUTDIR}/GMImport.class : ${SRCDIR}/GMImport.java ${OUTDIR}/GMGrid.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMImport.java -d $(OUTDIR) + +${OUTDIR}/GMResetGrid.class : ${SRCDIR}/GMResetGrid.java ${OUTDIR}/GMGrid.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMResetGrid.java -d $(OUTDIR) + +${OUTDIR}/${OUTDIR}/Rules.class : ${SRCDIR}/Rules.java + ${JC} ${JCFLAGS} ${SRCDIR}/Rules.java -d $(OUTDIR) + +${OUTDIR}/GMSaver.class : ${SRCDIR}/GMSaver.java ${OUTDIR}/GMGrid.class ${OUTDIR}/GMChecker.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMSaver.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) + +${OUTDIR}/GMUserInterfaceController.class : ${SRCDIR}/GMUserInterfaceController.java ${OUTDIR}/Window.class + ${JC} ${JCFLAGS} ${SRCDIR}/GMUserInterfaceController.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) + +${OUTDIR}/GSCase.class : ${SRCDIR}/GSCase.java ${OUTDIR}/GSGrid.class ${OUTDIR}/GSCaseMouseListener.class ${OUTDIR}/GSTest.class + ${JC} ${JCFLAGS} ${SRCDIR}/GSCase.java -d $(OUTDIR) + +${OUTDIR}/GSCaseMouseListener.class : ${SRCDIR}/GSCaseMouseListener.java ${OUTDIR}/GSCase.class + ${JC} ${JCFLAGS} ${SRCDIR}/GSCaseMouseListener.java -d $(OUTDIR) + +${OUTDIR}/GSGrid.class : ${SRCDIR}/GSGrid.java ${OUTDIR}/GSCase.class ${OUTDIR}/GSTest.class + ${JC} ${JCFLAGS} ${SRCDIR}/GSGrid.java -d $(OUTDIR) + +${OUTDIR}/GSImport.class : ${SRCDIR}/GSImport.java ${OUTDIR}/Window.class + ${JC} ${JCFLAGS} ${SRCDIR}/GSImport.java -d $(OUTDIR) + +${OUTDIR}/GSMenu.class : ${SRCDIR}/GSMenu.java ${OUTDIR}/Title.class ${OUTDIR}/Window.class ${OUTDIR}/Button.class + ${JC} ${JCFLAGS} ${SRCDIR}/GSMenu.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) + +${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) + +${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 ${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) -GridMaker : - java GridMaker -GridSolver : - java GridSolver +### REGLES OPTIONNELLES ### +GridMaker : $(OFILES) + ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker -GridMaker.class : Window.class HomeView.class - javac GridMaker.java Window.java HomeView.java - -GridSolver.class : Window.class HomeView.class - javac GridSolver.java Window.java HomeView.java - -Button.class : - javac Button.java - -CongratulationsDialog.class : - javac CongratulationsDialog.java - -DialogManager.class : - javac DialogManager.java - -GMCase.class : GMGrid.class GMCaseKeyListener.class GMCaseMouseListener.class - javac GMCase.java GMGrid.java GMCaseKeyListener.java GMCaseMouseListener.java - -GMCaseKeyListener.class : GMCase.class GMGrid.class - javac GMCaseKeyListener.java GMCase.java GMGrid.java - -GMCaseMouseListener.class : GMCase.class - javac GMCaseMouseListener.java GMCase.java - -GMChecker.class : GMGrid.class - javac GMChecker.java GMGrid.java - -GMGrid.class : GMCase.class - javac GMGrid.java GMCase.java - -GMHowToCreateController.class : GMHowToCreateDialogManager.class - javac GMHowToCreateController.java GMHowToCreateDialogManager.java - -GMHowToCreateDialogManager.class : GMHowToCreateView.class - javac GMHowToCreateDialogManager.java GMHowToCreateView.java - -GMHowToCreateView.class : - javac GMHowToCreateView.java - -GMImport.class : GMGrid.class - javac GMImport.java GMGrid.java - -GMResetGrid.class : GMGrid.class - javac GMResetGrid.java GMGrid.java - -GMRules.class : - javac GMRules.java - -GMSaver.class : GMGrid.class GMChecker.class - javac GMSaver.java GMGrid.java GMChecker.java - -GMSaverActionListener.class : Window.class GMGrid.class GMSaver.class - javac GMSaverActionListener.java Window.java GMGrid.java GMSaver.java - -GMUserInterfaceController.class : Window.class - javac GMUserInterfaceController.java Window.java - -GMUserInterfaceView.class : GMGrid.class Window.class GMResetGrid.class GMImport.class GMSaverActionListener.class GMHowToCreateController.class GMRules.class - javac GMGrid.java Window.java GMResetGrid.java GMImport.java GMSaverActionListener.java GMHowToCreateController.java GMRules.java - -GSCase.class : GSGrid.class GSCaseMouseListener.class GSTest.class - javac GSCase.java GSGrid.java GSCaseMouseListener.java GSTest.java - -GSCaseMouseListener.class : GSCase.class - javac GSCaseMouseListener.java GSCase.java - -GSGrid.class : GSCase.class GSTest.class - javac GSGrid.java GSCase.java GSTest.java - -GSImport.class : Window.class - javac GSImport.java Window.java - -GSMenu.class : Window.class Title.class Button.class - javac GSMenu.java Window.java Button.java - -GSMenuController.class : GSMenu.class Window.class GSGrid.class GSMenu.class GSImport.class GSPlay.class GSPlayController.class GSSolver.class - javac GSMenu.class Window.java GSGrid.java GSMenu.java GSImport.java GSPlay.java GSPlayController.java GSSolver.java - -GSPlay.class : GSGrid.class Button.class Window.class GSPlayController.class - javac GSPlay.java GSGrid.java Button.java Window.java GSPlayController.java - -GSPlayController.class : GSPlay.class GSWin.class - javac GSPlayController.java GSPlay.java GSWin.java - -GSSolver.class : GSGrid.class Window.class - javac GSSolver.java GSGrid.java Window.java - -GSTest.class : GSGrid.class - javac GSTest.java GSGrid.java - -GSWin.class : - javac GSWin.java - -HomeButtonClickListener.class : Window.class GSMenu.class GSMenuController.class GMUserInterfaceView.class DialogManager.class - javac HomeButtonClickListener.java Window.java GSMenu.java GSMenuController.java GMUserInterfaceView.java DialogManager.java - -HomeView.class : MusicButton.class Window.class Title.class HomeButtonClickListener.class Button.class - javac HomeView.java MusicButton.java Window.java Title.java HomeButtonClickListener.java Button.java - -MusicButton.class : MusicPlayer.class - javac MusicButton.java MusicPlayer.java - -MusicPlayer.class : - javac MusicPlayer.java - -RulesDialogManager.class : RulesSudoku.class - javac RulesDialogManager.java RulesSudoku.java - -RulesSudoku.class : Title.class - javac RulesSudoku.java Title.java - -Title.class : - javac Title.java - -Window.class : - javac Window.java +GridSolver : $(OFILES) + ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver doc : javadoc -d $(DOCDIR) $(SRC) @@ -134,46 +144,4 @@ clean : -rm -rf $(OUTDIR) -rm -rf $(DOCDIR) -.PHONY : run clean doc - - -#JC := javac -#JCFLAGS := -encoding UTF-8 -implicit:none -#JVM := java -#JVMFLAGS := - -#SRCDIR := ./src -#OUTDIR := ./build -#DOCDIR := ./doc -#SRC := $(wildcard $(SRCDIR)/*.java) -#OFILES := $(SRC:$(SRCDIR)/%.java=$(OUTDIR)/%.class) - -### REGLES ESSENTIELLES ### - -#$(OUTDIR)/%.class : $(SRCDIR)/%.java -# @mkdir -p $(@D) -# ${JC} ${JCFLAGS} -cp $(SRCDIR) -d $(OUTDIR) $< - - -### REGLES OPTIONNELLES ### - -#GridMaker : $(OFILES) -# ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridMaker $(RUN_ARGS) - -#GridSolver : $(OFILES) -# ${JVM} ${JVMFLAGS} -cp $(OUTDIR) GridSolver $(RUN_ARGS) - -#clean : -# -rm -rf $(OUTDIR) -# -rm -rf $(DOCDIR) - -#doc : -# javadoc -d $(DOCDIR) $(SRC) - -#default: - -### BUTS FACTICES ### - -#.PHONY : run clean doc - -### FIN ### \ No newline at end of file +.PHONY : clean doc diff --git a/src/GMUserInterfaceView.java b/src/GMUserInterfaceView.java index eaf80c3..f96ec6c 100755 --- a/src/GMUserInterfaceView.java +++ b/src/GMUserInterfaceView.java @@ -51,7 +51,7 @@ public class GMUserInterfaceView { JMenuItem chargerItem = createMenuItem("Charger", new GMImport(window, grid)); JMenuItem sauvegarderItem = createMenuItem("Sauvegarder", new GMSaverActionListener(window, grid)); JMenuItem aideGrilleItem = createMenuItem("Comment créer une grille", new GMHowToCreateController()); - JMenuItem reglesSudokuItem = createMenuItem("Règles du Sudoku", new GMRules()); + JMenuItem reglesSudokuItem = createMenuItem("Règles du Sudoku", new Rules()); // Ajout du menu "Jouer" diff --git a/src/GMRules.java b/src/Rules.java similarity index 81% rename from src/GMRules.java rename to src/Rules.java index 033ddee..0df540c 100755 --- a/src/GMRules.java +++ b/src/Rules.java @@ -1,23 +1,23 @@ import java.awt.event.*; /** - * GMRules gère les actions liées aux règles du jeu. + * Rules gère les actions liées aux règles du jeu. * Cette classe implémente ActionListener pour réagir aux clics sur un bouton. * @version 1.0 * @author Moncef STITI * @author Marco ORFAO */ -public class GMRules implements ActionListener { +public class Rules implements ActionListener { /** * Gestionnaire de la boîte de dialogue des règles */ private RulesDialogManager rulesDialog; /** - * Constructeur de GMRules. + * Constructeur de Rules. * Initialise le gestionnaire de boîte de dialogue des règles. */ - public GMRules(){ + public Rules(){ this.rulesDialog = new RulesDialogManager(); }