PSlider slid1 , slid2; PButton btn1, btn2; PFont myFont; color bkColor = color(220,255,255); void setup() { size( 400, 500 ); slid1 = new PSlider (30, 445, 150, 15, "re (C) = ", -2.0, 2.0); slid2 = new PSlider (30, 480, 150, 15, "im (C) = ", -2.0, 2.0); slid1.x = 63.72; slid2.x =97.5; btn1 = new PButton( 220, 445, 60, 18, "Plot"); btn2 = new PButton( 300, 445, 60, 18, "Reset"); framerate(30); background(bkColor); myFont = loadFont("sansserif-14.vlw"); textFont(myFont); } void draw(){ btn1.display(); btn2.display(); slid1.display(); slid2.display(); } //event handler void mouseDragged() {if(slid1.overThumb()) slid1.changeValue(); if(slid2.overThumb()) slid2.changeValue(); // add dragging action in other area if any } void mouseReleased () { if(btn1.over()) btn1Action(); if(btn2.over()) btn2Action(); if(slid1.over()) slid1.changeValue(); if(slid2.over()) slid2.changeValue(); //add clicking action in any other area } void btn1Action() {noStroke(); fill(bkColor); rect(0, 0, 400, 428);stroke(0); runthis(); } void btn2Action() {loop(); noStroke(); fill(bkColor); rect(0, 0, 400, 428); fill(bkColor); rect(195, 480, 200, 19); stroke(0); } void runthis(){ float t1, t2; t1 = millis(); float x, y, cre, cim; int j = 0; int k =0; int period = 40; float modsqr; float x1, y1; color[] colA = {#0000FF, #2323DC, #4646B9, #696996, #8C8C73, #AFAF50, #D2D22D, #F5F50A, #FFFF00}; cre = slid1.slv; cim = slid2.slv; while( j <401){ for(int i=0; i<400; i++) { x = -1.5 + 3.0* i/400.0; y = 1.5 - 3.0* j/400.0; modsqr = x*x + y*y; stroke(#000000); while ((kx && mouseXy && mouseYxpos && mouseXypos && mouseYxpos && mouseXy && mouseYxpos+l-w && mouseXy && mouseYx + w && mouseXy && mouseYxpos+w && mouseXy && mouseYx && mouseXy && mouseYx && mouseXxpos+w) x -= delL; fill(200, 200,255); rect( xpos+w, y, x-xpos -w, w ); } void incByOneL(){ if (xxpos+w+delS/10) x -= delS; fill(200, 255, 200); rect( xpos, y, w, w ); } void incByOneS(){ if (x