aboutsummaryrefslogtreecommitdiff
path: root/PunchingBag/src/PunchingBagGUI.java
diff options
context:
space:
mode:
authorAdam Martindale <awiamartindale@googlemail.com>2011-09-02 11:38:05 +0100
committerAdam Martindale <awiamartindale@googlemail.com>2011-09-02 11:38:05 +0100
commit68c2bc40f25810ce01bdebcd3bfe90b7a76b5413 (patch)
treebdb4422c58d2ff35a803ddb3bad73d21425ad9cf /PunchingBag/src/PunchingBagGUI.java
parentf5f7d3ca20f102e704f8d0705158ea58a3e4c305 (diff)
parenta5dceb099dcca2eb30b663c0f8f1767e8e68343b (diff)
downloadpunchingbag-68c2bc40f25810ce01bdebcd3bfe90b7a76b5413.tar
punchingbag-68c2bc40f25810ce01bdebcd3bfe90b7a76b5413.tar.gz
Merge branch 'master' of git://gitorious.org/punchingbag/punchingbag
Conflicts: PunchingBag/.classpath PunchingBag/bin/PunchingBag$Colour.class PunchingBag/bin/PunchingBag.class PunchingBag/bin/PunchingBagGUI$Ripple.class PunchingBag/bin/PunchingBagGUI.class PunchingBag/src/Arduino.java PunchingBag/src/PunchingBag.java PunchingBag/src/PunchingBagGUI.java
Diffstat (limited to 'PunchingBag/src/PunchingBagGUI.java')
-rw-r--r--PunchingBag/src/PunchingBagGUI.java40
1 files changed, 0 insertions, 40 deletions
diff --git a/PunchingBag/src/PunchingBagGUI.java b/PunchingBag/src/PunchingBagGUI.java
index 180beed..d7f4f9a 100644
--- a/PunchingBag/src/PunchingBagGUI.java
+++ b/PunchingBag/src/PunchingBagGUI.java
@@ -70,47 +70,7 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, Butto
}
public void runInteractively(Contact contact) {
- bagSimFrame.add(new Ripple(contact));
- }
-
- class Ripple extends JPanel {
- // TODO Make this not shit.
- final Contact contact;
- double currentWidth;
-
- Ripple(Contact contact) {
- super();
- this.contact = contact;
- }
-
- public void paintComponent(Graphics g) {
- // Max size of ripple is 60cm
- // Ripple will expand 60cm * strength/100
-
- SlaveArduino.Colour colour = SlaveArduino.Colour.Red;
- g.setColor(new Color(255, 0, 0, 255));
- boolean drawnSomething = false;
- for (double i = 0; i < 360; i++) {
- int x = contact.x
- + (int) Math.round(currentWidth * Math.cos(i));
- int y = contact.y
- + (int) Math.round(currentWidth * Math.sin(i));
-
- if (x >= 0 && x <= 8 && y >= 0 && y <= 19) {
- SlaveArduino.setLED(colour, x, y);
- drawnSomething =true;
- }
-
- if (useDebugScreen) {
- g.fillOval(40 * x, 40 * y, 6, 6);
-
- }
- }
- if (!drawnSomething) bagSimFrame.remove(this);
-
- currentWidth += 0.1 + (currentWidth/10) + (contact.strength/130) ;
- }
}