class Node { float x,y; Vector lines = new Vector(); Node(float x, float y){ this.x=x; this.y=y; } boolean mouseOver() { return sq(x-mouseX)+sq(y-mouseY)<100; } color fill() { if (mode == LINE && this.mouseOver()) { return #ff0000; } else if(this == tempLine.a || this == tempLine.b) { return #000000; } else if (lines.size() > 0) { return #ffffff; } else { return #000000; } } void draw() { ellipse(x,y,5,5); } float distance(Node other) { return sqrt(sq(other.x-this.x)+sq(other.y-this.y)); } }