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.java40
1 files changed, 0 insertions, 40 deletions
diff --git a/PunchingBag/src/PunchingBagGUI.java b/PunchingBag/src/PunchingBagGUI.java
index 1bd1415..c3014ac 100644
--- a/PunchingBag/src/PunchingBagGUI.java
+++ b/PunchingBag/src/PunchingBagGUI.java
@@ -70,49 +70,9 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, Butto
}
public void runInteractively(Contact contact) {
- bagSimFrame.add(new Ripple(contact));
- }
-
- class Ripple extends JPanel {
- 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) ;
- }
}
-
public void mouseClicked(MouseEvent arg0) {
// TODO Auto-generated method stub