class Graph { ArrayList edges; ArrayList nodes; PImage img; // buffer for drawing static graph Graph() { edges = new ArrayList(); nodes = new ArrayList(); createRectGraph(); paintGraph(); // stunt: capture the edges as an image img = get(); } void paint() { image(img,0,0); //background(img); } void paintGraph() { background(200); for(int i = 0; i