class NetworkObject{ boolean on = false; boolean visited = false; boolean on_next = false; boolean visited_next = false; NetworkObject(){ } void reset(){ on = false; visited = false; on_next = false; visited_next = false; } } class Point{ float x, y; Point(float x, float y){ this.x = x; this.y = y; } } class Node extends NetworkObject{ Point p; Node(Point p){ this.p = p; } Node(float x, float y){ this.p = new Point(x, y); } void draw(){ if(on){ fill(c_node_on); } else { fill(c_node_off); } ellipse(p.x, p.y, d, d); } } class Link extends NetworkObject{ Point p1, p1a, p2a, p2; Link(Point p1, Point p1a, Point p2a, Point p2){ this.p1 = p1; this.p1a = p1a; this.p2 = p2; this.p2a = p2a; } Link(Node n1, Node n2){ this.p1 = n1.p; this.p1a = n1.p; this.p2 = n2.p; this.p2a = n2.p; } void draw(){ if(on){ stroke(c_link_on); } else { stroke(c_link_off); } bezier(p1.x, p1.y, p1a.x, p1a.y, p2a.x, p2a.y, p2.x, p2.y); } }