class Node { float x, y; String label; float radius; Node(String label, float x, float y) { this.label = label; this.x = x; this.y = y; radius = 7; } boolean isIn(float xpos, float ypos) { return ((x-xpos)*(x-xpos)+(y-ypos)*(y-ypos)) < radius*radius; } void draw(boolean showLabel) { if(showLabel) { fill(0); textAlign(CENTER, CENTER); text(label, x, y); } fill(nodeColor); ellipse(x, y, radius, radius); } }