//Copyright 2005 Sean McCullough //banksean at yahoo public class ForcedNode extends Node { Vector3D f = new Vector3D(0,0,0); float mass = 1; public ForcedNode(Vector3D v) { super(v); h = 20; w = 20; } public float getMass() { return mass; } public void setMass(float m) { mass = m; h = m*20; w = m*20; } public void setForce(Vector3D v) { f = v; } public Vector3D getForce() { return f; } public void applyForce(Vector3D v) { f = f.add(v); } public void draw() { //super.draw(); if (g.getSelectedNode() == this) { stroke(32,64,255,128); strokeWeight(10); fill(255,255,255,128); } else if (g.getHoverNode() == this) { noStroke(); fill(255,255,255,128); } else { noStroke(); fill(255,255,255,64); } ellipse(getX(), getY(), h, w); } }