aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-09-16 14:13:51 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-09-16 14:13:51 +0100
commit7858c366f2de5b03b211df0b3df4fd50f551e622 (patch)
tree48e49df1adb28e9872e43af5d16109dffb10d3a1
parentd0569a3346faf63f973b804c4ab55f52c58c0df7 (diff)
downloadpunchingbag-7858c366f2de5b03b211df0b3df4fd50f551e622.tar
punchingbag-7858c366f2de5b03b211df0b3df4fd50f551e622.tar.gz
Better timings
-rw-r--r--PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java8
-rw-r--r--PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java4
2 files changed, 6 insertions, 6 deletions
diff --git a/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java b/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java
index 0c33499..7a7010c 100644
--- a/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java
+++ b/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java
@@ -64,7 +64,7 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener,
Debug, Menu
};
- Mode currentMode = Mode.Debug;
+ Mode currentMode = Mode.Menu;
JFrame frame;
@@ -111,7 +111,7 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener,
}
frame = new JFrame("Punching Bag GUI");
- // frame.setUndecorated(true);
+ frame.setUndecorated(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// frame.setSize(600, 600);
@@ -146,8 +146,8 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener,
programOptionsPanel.add(new JButton("Debug"));
frame.add(bagDebugingPanel);
- //frame.add(new DisplayPanel(), BorderLayout.CENTER);
- //frame.add(programOptionsPanel, BorderLayout.SOUTH);
+ frame.add(new DisplayPanel(), BorderLayout.CENTER);
+ frame.add(programOptionsPanel, BorderLayout.SOUTH);
setMode(currentMode);
diff --git a/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java b/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
index 9c05254..1e791ee 100644
--- a/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
+++ b/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java
@@ -277,7 +277,7 @@ public class SimpleKeyboard implements ButtonListener, Runnable {
public void run() {
while (true) {
System.out.println("Checking last action time");
- if ((System.currentTimeMillis() - lastActionTime) > 60000) {
+ if ((System.currentTimeMillis() - lastActionTime) > 20000) {
System.out.println("Activating Noise");
bag.noise(new Rectangle(0, 0, 9, 20));
@@ -287,7 +287,7 @@ public class SimpleKeyboard implements ButtonListener, Runnable {
System.out.println("Waiting more");
}
try {
- Thread.sleep(20000);
+ Thread.sleep(10000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();