void page3() { fill(0); text("NON-BLOCKING", 310, 20); line(50, 350, 650, 350); String t = "To the left is the histogram of the non-blocking process. The results for the Incentive Program 1 are shown in red. Those for the Incentive Program 2 are shown in green."; drawStrings(t, 700, 50, 25); int[] his1 = new int[54]; int[] his2 = new int[54]; int a; for (int i=0; i<200; i++) { a = int((data[i]-75.2)/0.4); a = constrain(a, 0, 53); his1[a]++; } for (int i=200; i<400; i++) { a = int((data[i]-75.2)/0.4); a = constrain(a, 0, 53); his2[a]++; } if (cb1.isSelected()) { fill(255, 0, 0); for (int i=0; i<54; i++) { rect(65+11*i, 350-10*his1[i], 9, 10*his1[i]); } } if (cb2.isSelected()) { fill(0, 255, 0); for (int i=0; i<54; i++) { rect(65+11*i, 350-10*his2[i], 9, 10*his2[i]); } } assign.setVisible(false); generate.setVisible(true); cb1.setVisible(true); cb2.setVisible(true); cb3.setVisible(false); cb4.setVisible(false); cb5.setVisible(false); cb6.setVisible(false); }