void page2() { fill(0); text("BLOCKING", 330, 20); line(100, 250, 600, 250); text("FULL TIME", 50, 150); text("PART TIME", 50, 345); String t = "To avoid the confounding problem, the workers are first divided into 2 blocks: full time and part time. Then, within each block, they are given the Incentive Program 1 and 2 randomly."; drawStrings(t, 700, 50, 25); t = "Advantage: minimize variation due to known nuisance factors, in this case the worker type."; drawStrings(t, 700, 250, 25); int a; String[] worker1 = { "James", "Linda", "John", "Nancy", "Robert", "Sarah", "Steven", "Angela", "Brian", "Janet" }; String[] worker2 = { "Micheal", "Margaret", "William", "Lisa", "Helen", "Thomas", "Mark", "Jessica", "Amanda", "Anthony" }; if (p2) { fill(0); line(350, 50, 350, 420); text("INCENTIVE PROGRAM 1", 150, 50); text("INCENTIVE PROGRAM 2", 450, 50); for (int i=0; i<10; i++) { a = (Integer)alist1.get(i); fill(255, 0, 0); if (i<5) { text(worker1[a], 200, 100+25*i); } else { text(worker1[a], 500, 100+25*(i-5)); } a = (Integer)alist2.get(i); fill(0, 255, 0); if (i<5) { text(worker2[a], 200, 300+25*i); } else { text(worker2[a], 500, 300+25*(i-5)); } } } else { fill(255, 0, 0); for (int i=0; i<10; i++) { text(worker1[i], 100*(i%5+2), 100*(i%2+1)); } fill(0, 255, 0); for (int i=0; i<10; i++) { text(worker2[i], 100*(i%5+2), 100*(i%2+3)); } } leftarrow.setVisible(true); assign.setVisible(true); generate.setVisible(false); cb1.setVisible(false); cb2.setVisible(false); }