void page1() { fill(0); text("NON-BLOCKING", 310, 20); String t = "This applet is based on Example 3.8, page 100, in the text. In this process, all the workers are given the Incentive Program 1 or 2 randomly."; drawStrings(t, 700, 50, 25); t = "Disadvantage: The effect of the incentive program is confounded with the type of worker."; drawStrings(t, 700, 200, 25); t = "Note, full time workers are indicated in red, and part time workers are indicated in green."; drawStrings(t, 700, 350, 25); int a; String[] worker = { "James", "Linda", "Micheal", "Margaret", "William", "Lisa", "John", "Nancy", "Robert", "Helen", "Thomas", "Sarah", "Mark", "Jessica", "Steven", "Angela", "Brian", "Amanda", "Anthony", "Janet" }; int[] fp = { 1, 1, 2, 2, 2, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1 }; if (p1) { fill(0); line(350, 50, 350, 350); text("INCENTIVE PROGRAM 1", 150, 50); text("INCENTIVE PROGRAM 2", 450, 50); for (int i=0; i<20; i++) { a = (Integer)alist.get(i); if (fp[a]==1) { fill(255, 0, 0); } else { fill(0, 255, 0); } if (i<10) { text(worker[a], 200, 100+25*i); } else { text(worker[a], 500, 100+25*(i-10)); } } } else { for (int i=0; i<20; i++) { if (fp[i]==1) { fill(255, 0, 0); } else { fill(0, 255, 0); } text(worker[i], 100*(i%5+1), 100*(i%4+1)); } } leftarrow.setVisible(false); assign.setVisible(true); generate.setVisible(false); cb1.setVisible(false); cb2.setVisible(false); cb3.setVisible(false); cb4.setVisible(false); cb5.setVisible(false); cb6.setVisible(false); }