From 7858c366f2de5b03b211df0b3df4fd50f551e622 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 16 Sep 2011 14:13:51 +0100 Subject: Better timings --- PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java | 8 ++++---- .../src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java | 4 ++-- 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(); -- cgit v1.2.3