aboutsummaryrefslogtreecommitdiff
path: root/PunchingBag/src/PunchingBagGUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'PunchingBag/src/PunchingBagGUI.java')
-rw-r--r--PunchingBag/src/PunchingBagGUI.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/PunchingBag/src/PunchingBagGUI.java b/PunchingBag/src/PunchingBagGUI.java
index f3997a8..1db9d68 100644
--- a/PunchingBag/src/PunchingBagGUI.java
+++ b/PunchingBag/src/PunchingBagGUI.java
@@ -56,15 +56,6 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener,
bag.addButtonListener(this);
bag.addLEDChangeListener(this);
-
- draw();
- }
-
- void draw() throws InterruptedException {
- bagSimFrame.paintComponents(bagSimFrame.getGraphics());
- // bagSimFrame.paintAll(bagSimFrame.getGraphics());
- Thread.sleep(50);
- draw();
}
public void runInteractively(Contact contact) {
@@ -133,10 +124,12 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener,
} else if (bag.getLED(x, y) == PunchingBag.Colour.Green) {
g.setColor(Color.green);
g.fillOval(40 * x, 40 * y, 6, 6);
- }
- if (bag.getLED(x, y) == PunchingBag.Colour.Yellow) {
+ } else if (bag.getLED(x, y) == PunchingBag.Colour.Yellow) {
g.setColor(Color.yellow);
g.fillOval(40 * x, 40 * y, 6, 6);
+ } else {
+ g.setColor(Color.white);
+ g.fillOval(40 * x, 40 * y, 6, 6);
}
}
}