From 25a0b11d89f70665a533c58f19ccf07cfabe0905 Mon Sep 17 00:00:00 2001
From: CHEVALIER Noemy <noemy.chevalier7@etu.univ-lorraine.fr>
Date: Mon, 29 May 2023 17:27:15 +0000
Subject: [PATCH] =?UTF-8?q?Ajout=20des=20diff=C3=A9rents=20th=C3=A8mes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 shukan/ShukanParameters.java | 64 +++++++++++++++++++++++++++---------
 1 file changed, 48 insertions(+), 16 deletions(-)

diff --git a/shukan/ShukanParameters.java b/shukan/ShukanParameters.java
index ebf29f0..5366b34 100644
--- a/shukan/ShukanParameters.java
+++ b/shukan/ShukanParameters.java
@@ -13,6 +13,9 @@ class ShukanParameters extends JFrame {
     private JButton changerdetheme, theme1, theme2, theme3, retour, changertouches, changercouleurs;
     /** view of the app */
     private ShukanView canvas;
+    /** Color background, text, hollydays*/
+    private Color BACK_COLOR, BACK_COLOR2, TEXT_COLOR, HOLLY_COLOR, INACTIVE_COLOR;               
+
     /** built a parameter window */
     public ShukanParameters(String titre, ShukanView canvas) {
         super(titre);
@@ -43,28 +46,57 @@ class ShukanParameters extends JFrame {
 
                 theme1 = new JButton("Thème sombre");
                 theme1.setPreferredSize(new Dimension(150, 25));
-            theme1.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    canvas.setBackgroundColor(Color.BLACK);
-                }
-            });
+                theme1.addActionListener(new ActionListener() {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                        for(int i = 0; i <= 6; i++){
+                            BACK_COLOR = new Color(51,51,51);
+                            BACK_COLOR2 = new Color(102,102,102);
+                            TEXT_COLOR = Color.WHITE;
+                            HOLLY_COLOR = new Color(153, 0, 0);
+                            INACTIVE_COLOR = new Color (204,204,204);
+                            canvas.setBackgroundColor(BACK_COLOR, BACK_COLOR2);
+                            canvas.setForeground(TEXT_COLOR, HOLLY_COLOR, INACTIVE_COLOR);
+
+                        } 
+                        canvas.repaint(); 
+                    }
+                });
 
                 theme2 = new JButton("Thème clair");
                 theme2.setPreferredSize(new Dimension(150, 25));
-            /*theme2.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEVent e) {
-                    getContentPane().setBackground(Color.WHITE);
-                }
-            });*/
+                theme2.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        for(int i = 0; i <= nbModules; i++){
+                            BACK_COLOR = new Color(102,102,102);
+                            BACK_COLOR2 = new Color(153,153,153);
+                            TEXT_COLOR = Color.BLACK;
+                            HOLLY_COLOR = new Color(255,102,102);
+                            INACTIVE_COLOR = new Color(51,51,51);
+                            canvas.setBackgroundColor(BACK_COLOR, BACK_COLOR2);
+                            canvas.setForeground(TEXT_COLOR, HOLLY_COLOR, INACTIVE_COLOR);
+                        } 
+                        canvas.repaint(); 
+                    }
+                });
 
                 theme3 = new JButton("Thème modéré");
                 theme3.setPreferredSize(new Dimension(150, 25));
-            /*theme3.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEVent e) {
-                    getContentPane().setBackground(Color.GRIS);
-                }
-            });*/
+                theme3.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        for(int i = 0; i <= nbModules; i++){
+                            BACK_COLOR = new Color(226,226,226);
+                            BACK_COLOR2 = Color.LIGHT_GRAY;
+                            TEXT_COLOR = Color.BLACK;
+                            HOLLY_COLOR = new Color (1.f, 0.8f, 0.7f);
+                            INACTIVE_COLOR = new Color (0.5f, 0.5f, 0.5f);
+                            canvas.setBackgroundColor(BACK_COLOR, BACK_COLOR2);
+                            canvas.setForeground(TEXT_COLOR, HOLLY_COLOR, INACTIVE_COLOR);
+
+                        } 
+                        canvas.repaint(); 
+                    }
+                });
 
                 retour = new JButton("Retour");
                 retour.setPreferredSize(new Dimension(150, 25));
-- 
GitLab