class Button { String n; boolean over; int x,y,w,h; Button(int px, int py, String nam, int ww, int hh) { over = false; x=px; y=py; n=nam; w=ww; h=hh; } void check() { int d = 2; over = (mouseX>=x-d&&mouseX<=x+w+d&&mouseY>=y-d&&mouseY<=y+h+d) ? true : false; } void draw() { noStroke(); pushMatrix(); translate(x,y); if(over) fill(bc1); else fill(bc0); rect(0,0,w,h); textFont(lucida, 11); fill(white); text(n,3,11); popMatrix(); } } class Menu { boolean visible; int treeno = -1; int x,y,w,h,d; String[] btnames = {"SHOW","GROW","RULES","GEN","PARENT"}; int buttons = 5; Button btns[]; boolean over; Menu() { d=5; x=0; y=0; w=60; h=d+buttons*(14+d); btns = new Button[buttons]; for(int i=0; i=x-d&&mouseX<=x+w+d&&mouseY>=y-d&&mouseY<=y+h+d) ? true : false; pushMatrix(); translate(x,y); noStroke(); if(over) fill(mc1); else fill(mc0); rect(0,0,w,h); popMatrix(); for(int i=0; i "+forrest[treeno].substitute[j]+"\n"); } } println("\n"); for(int j=0; j<5; j++) { println(j+": \t"+forrest[treeno].genotype[j]+"\n"); } println(); print(" draw = "+forrest[treeno].f_draw+" not = "+forrest[treeno].f_not); print(" rotations = "+forrest[treeno].f_rot+" push = "+forrest[treeno].f_push); print(" lines = "+forrest[treeno].f_line+" arcs = "+forrest[treeno].f_arc); print(" jumps = "+forrest[treeno].f_jump+" max rotation = "+forrest[treeno].f_rotmax); print(" bottom = "+forrest[treeno].maxbottom+" top = "+forrest[treeno].maxtop); print(" left = "+forrest[treeno].maxleft+" right = "+forrest[treeno].maxright); println(); println(forrest[treeno].ownmax); } else if(btns[1].over) { showone = treeno; forrest[treeno].start_growing(); } else if(btns[0].over) { showone = treeno; } else if(btns[3].over) { showone = treeno; displ_gen = true; /* println("tree "+treeno); for(int j=0; j=x-d && mouseX<=x+w+d && mouseY>=y-d && mouseY<=y+h+d) ? true : false; if(over && !drag && mousePressed) { drag = true; } if(drag) { currint = int(minvalue + ((mouseX-x)/float(w)) * steps); if(currint > maxvalue) currint = maxvalue; else if(currintmaxvalue) currvalue = maxvalue; currint = int(( (currvalue-minvalue)/(maxvalue-minvalue) ) * w); } void draw() { pushMatrix(); translate(x,y); noStroke(); if(over) fill(tc0); else fill(tc0); rect(0,0,w,h); if(over) fill(bc1); else fill(bc0); rect(0,0,currint,h); noFill(); stroke(255,50); rect(0,0,w,h); fill(255); popMatrix(); } void check() { int d = 2; over = (mouseX>=x-d && mouseX<=x+w+d && mouseY>=y-d && mouseY<=y+h+d) ? true : false; if(over && !drag && mousePressed) { drag = true; } if(drag) { currint = mouseX-x; if(currint > w) currint = w; else if(currint<0) currint = 0; currvalue = minvalue + currint * multi; if(!mousePressed) { drag = false; } } } }