From 4d75a8bc8149cf8892465300e679e31f3c612c93 Mon Sep 17 00:00:00 2001 From: Thoumi Ngonga Brice Date: Tue, 7 Feb 2023 21:58:04 +0100 Subject: [PATCH 1/3] Refratoring background color --- src/main/java/BattleShip/AIGridGUI.java | 2 +- target/classes/BattleShip/AIGridGUI.class | Bin 10192 -> 10203 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/BattleShip/AIGridGUI.java b/src/main/java/BattleShip/AIGridGUI.java index c012d19..6f5522f 100644 --- a/src/main/java/BattleShip/AIGridGUI.java +++ b/src/main/java/BattleShip/AIGridGUI.java @@ -343,7 +343,7 @@ public class AIGridGUI extends JPanel { if(s == null) { //If no ship in that cell, mark as a miss. text = "Other player missed. Your turn."; - b.setBackground(Color.BLUE); + b.setBackground(Color.lightGray); } else { //Check if guess killed a ship. killed = s.counter(); diff --git a/target/classes/BattleShip/AIGridGUI.class b/target/classes/BattleShip/AIGridGUI.class index 0daa0ac17b3cf55e9f076a35f945f57470089c4b..a8a030ffb1c8da233f5ee849fe7fbe3c3ee18a24 100644 GIT binary patch delta 33 ocmccMf7^e97b7csN@7v=W^cwH9Go0!nMK7V9+@SZUAekt0o8E}`Tzg` delta 22 dcmccZf5Cr)7b7F{W`D*X988R9n*+GIWdUGp2WkKS From 3a4b85e9b39ee0f29f669ac99e77379dd7c5f87b Mon Sep 17 00:00:00 2001 From: Thoumi Ngonga Brice Date: Tue, 7 Feb 2023 22:04:48 +0100 Subject: [PATCH 2/3] Refratoring background color --- src/main/java/BattleShip/AIGridGUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/BattleShip/AIGridGUI.java b/src/main/java/BattleShip/AIGridGUI.java index 6f5522f..feb217f 100644 --- a/src/main/java/BattleShip/AIGridGUI.java +++ b/src/main/java/BattleShip/AIGridGUI.java @@ -527,7 +527,7 @@ public class AIGridGUI extends JPanel { //If mouse released, place ship and color ship cells. if(action == 2) { bsb.setCellContents(shipToPlace); - bsb.setBackground(Color.gray); + bsb.setBackground(Color.blue); bsb.setBorder(raisedbevel); } else { //If mouse exited, unhighlight cells. From 1194d1212b9d91ee33bdfe7ed38f7a95a59c251d Mon Sep 17 00:00:00 2001 From: Thoumi Ngonga Brice Date: Tue, 7 Feb 2023 22:24:12 +0100 Subject: [PATCH 3/3] Refratoring set Border to loweredbevel --- src/main/java/BattleShip/AIGridGUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/BattleShip/AIGridGUI.java b/src/main/java/BattleShip/AIGridGUI.java index feb217f..ce216fa 100644 --- a/src/main/java/BattleShip/AIGridGUI.java +++ b/src/main/java/BattleShip/AIGridGUI.java @@ -522,13 +522,13 @@ public class AIGridGUI extends JPanel { BSButton bsb = buttons.get(cell.getGridLocation() + (i * columns)); //If mouse entered, highlight cells via lowered bevel. if(action == 1) { - bsb.setBorder(raisedbevel); + bsb.setBorder(loweredBevel); } else { //If mouse released, place ship and color ship cells. if(action == 2) { bsb.setCellContents(shipToPlace); bsb.setBackground(Color.blue); - bsb.setBorder(raisedbevel); + bsb.setBorder(loweredBevel); } else { //If mouse exited, unhighlight cells. bsb.setBorder(compound);