diff --git a/shukan/ShukanParameters.java b/shukan/ShukanParameters.java index ebf29f07afec3ee6c1efe13ead18c439d098053a..5366b347c590adf45d74404715a53be2259cbbef 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));