// An example of Force Directed Graphing using OO parent/child relationships // by Nathan Ramella (nar@hush.com) // // Original source used from GraphToy2 found at http://www.cricketschirping.com/weblog/?p=966 // by banksean public class Edge { Spring s; color c = color(0); Node a; Node b; public void setColor(color c) { this.c = c; } public Edge(Node a, Node b, Spring s) { this.a = a; this.b = b; this.s = s; } public void draw() { strokeCap(ROUND); strokeWeight(2); stroke(255,255,0); float sX = s.getOneEnd().position().x(); float sY = s.getOneEnd().position().y(); float dX = s.getTheOtherEnd().position().x(); float dY = s.getTheOtherEnd().position().y(); line(sX,sY, dX, dY); } }