diff --git a/projetAgile/src/fr/iutfbleau/projetAgile/Utils/Utils.java b/projetAgile/src/fr/iutfbleau/projetAgile/Utils/Utils.java index 53b9e5b..4d659bf 100644 --- a/projetAgile/src/fr/iutfbleau/projetAgile/Utils/Utils.java +++ b/projetAgile/src/fr/iutfbleau/projetAgile/Utils/Utils.java @@ -5,6 +5,7 @@ import java.awt.Color; public class Utils { public final static Color PLAYER_ONE_COLOR = Color.RED; public final static Color PLAYER_TWO_COLOR = Color.YELLOW; + public final static Color EMPTY_COLOR = new Color(42,42,42); public final static int PLAYER_ONE = 0; public final static int PLAYER_TWO = 1; public static int PAWN_MARGIN = 10; diff --git a/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java b/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java index 94230c4..e967db6 100644 --- a/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java +++ b/projetAgile/src/fr/iutfbleau/projetAgile/View/Grille.java @@ -29,6 +29,7 @@ public class Grille extends JPanel { /* * On peut remplacer GridBagLayout par un GridLayout */ + this.setBackground(new Color(31,31,31)); GridBagLayout gbl = new GridBagLayout(); this.setLayout(gbl); GridBagConstraints gbc = new GridBagConstraints(); @@ -61,10 +62,4 @@ public class Grille extends JPanel { this.setPreferredSize(new Dimension(preferredWidth, preferredHeight)); } - @Override - protected void paintComponent(Graphics g) { - Graphics g2 = g.create(); - g2.setColor(Color.BLUE); - g2.fillRoundRect(0, 0, this.getWidth(), this.getHeight(), 3 * Utils.PAWN_MARGIN, 3 * Utils.PAWN_MARGIN); - } } \ No newline at end of file diff --git a/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java b/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java index 21d8a52..24ec7ab 100644 --- a/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java +++ b/projetAgile/src/fr/iutfbleau/projetAgile/View/Pion.java @@ -22,16 +22,12 @@ public class Pion extends JComponent{ this.setMinimumSize(new Dimension(80,80)); this.setMaximumSize(new Dimension(150,150)); this.setPreferredSize(new Dimension(120,120)); - this.setBackground(Color.WHITE); + this.setBackground(Utils.EMPTY_COLOR); } @Override protected void paintComponent(Graphics g) { Graphics g2 = g.create(); - //g2.setColor(Color.BLUE); - //g2.fillRect(0, 0, this.getWidth(), this.getHeight()); - g2.setColor(Color.GRAY); - g2.fillOval((int) (Utils.PAWN_MARGIN * 1.2),(int) (Utils.PAWN_MARGIN * 1.1) , this.getWidth() - 2 * Utils.PAWN_MARGIN, this.getHeight() - 2 * Utils.PAWN_MARGIN + 2); g2.setColor(this.getBackground()); g2.fillOval(Utils.PAWN_MARGIN, Utils.PAWN_MARGIN, this.getWidth() - 2 * Utils.PAWN_MARGIN, this.getHeight() - 2 * Utils.PAWN_MARGIN); }