aboutsummaryrefslogtreecommitdiff
path: root/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-09-14 17:16:41 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-09-14 17:16:41 +0100
commite9891427e16e9335dfd1467240855c86fac0799c (patch)
treeabd831daf250d49bd3cfab7decb26916ac15a255 /PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
parentd3aa36dfa804686ebc60eeb32c59f53d681d5e0c (diff)
downloadpunchingbag-e9891427e16e9335dfd1467240855c86fac0799c.tar
punchingbag-e9891427e16e9335dfd1467240855c86fac0799c.tar.gz
Moved to the standard java color object.
Started adding proper javadocs.
Diffstat (limited to 'PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java')
-rw-r--r--PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java b/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
index 188b262..7ba2200 100644
--- a/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
+++ b/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
@@ -1,5 +1,6 @@
package uk.ac.open.punchingbag.examples;
+import java.awt.Color;
import java.io.File;
import java.io.IOException;
@@ -36,23 +37,24 @@ public class SimpleKeyboard implements ButtonListener {
}
public void buttonPressed(int x, int y) {
+ System.out.println("Button Pressed: " + x + " " + y);
if (y < 3) {
- bag.fillRect(0, 0, 9, 4, PunchingBag.Colour.Red, 500);
+ bag.fillRect(0, 0, 9, 4, Color.red, 500);
playKey(5);
} else if (y < 6) {
- bag.fillRect(0, 3, 9, 4, PunchingBag.Colour.Red, 500);
+ bag.fillRect(0, 3, 9, 4, Color.red, 500);
playKey(4);
} else if (y < 9) {
- bag.fillRect(0, 6, 9, 4, PunchingBag.Colour.Red, 500);
+ bag.fillRect(0, 6, 9, 4, Color.red, 500);
playKey(3);
} else if (y < 12) {
- bag.fillRect(0, 9, 9, 4, PunchingBag.Colour.Red, 500);
+ bag.fillRect(0, 9, 9, 4, Color.red, 500);
playKey(2);
} else if (y < 15) {
- bag.fillRect(0, 12, 9, 4, PunchingBag.Colour.Red, 500);
+ bag.fillRect(0, 12, 9, 4, Color.red, 500);
playKey(1);
} else {
- bag.fillRect(0, 15, 9, 4, PunchingBag.Colour.Red, 500);
+ bag.fillRect(0, 15, 9, 4, Color.red, 500);
playKey(0);
}
}