class Node { float x,y;//////////////////////////////////////////////////////////////////////////// the position of node float r;//////////////////////////////////////////////////////////////////////////////the size of node float w;////////////////////////////////////////////////////////////////////////////stroke weight of the lines on the node float a;////////////////////////////// ////////////////////////////////////////////////control the lenth of the line on the node boolean s=false;/////////////////////////////////////////////////////////////////////////if the node is selected boolean m=false; Node(float xx,float yy,float rr,float ww,float aa) { x=xx; y=yy; r=rr; w=ww; a=aa; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////display unextended node void drawMe() { if(dist(mouseX,mouseY,x,y)<=d) { fill(255,0,0); noStroke(); ellipse(x,y,2*r,2*r); stroke(0); strokeWeight(w); line(x,y-r+a,x,y+r-a); line(x-r+a,y,x+r-a,y); } if(dist(mouseX,mouseY,x,y)>d) { fill(255); noStroke(); ellipse(x,y,2*r,2*r); stroke(0); strokeWeight(w); line(x,y-r+a,x,y+r-a); line(x-r+a,y,x+r-a,y); } } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////display extended node void drawMyself(int value1,int value2,int value3) { fill(0); strokeWeight(3); stroke(value1,value2,value3); ellipse(x,y,2*r,2*r); fill(255); noStroke(); ellipse(x,y,4,4); } }