int[][][] GRE_SUBS; void getGRE_SUBS(){ BufferedReader reader; String singleline; GRE_SUBS = new int[6][5][12]; reader = createReader("GREdetail.txt"); for(int i=0;i<6;i++){ for(int j=0;j<5;j++){ try { singleline = reader.readLine(); }catch (IOException e) { singleline = null; e.printStackTrace(); } if(singleline!=null){ String[] pieces = split(singleline, TAB); for(int k=0;k<12;k++){ GRE_SUBS[i][j][k] = int(pieces[k]); } } } } } void detailGRE(){ int maxSub = max(GRE_SUBS[pos_x][0]); float ratio = 200.f / maxSub; strokeWeight(8); //int[] index = {0,2,4,3,1}; for(int i = 0;i < 5; i++){ stroke(subColor[i]); for(int j = 0;j < 12;j++){ float revlength = 250.f - GRE_SUBS[pos_x][i][j] * (ratio - 0.2); float angle = PI/6 * (j - 3) + PI / 30 * i ; line(250*cos(angle),250*sin(angle),revlength*cos(angle),revlength*sin(angle)); float d = dist(mouseX,mouseY,trancenter_x,trancenter_y); if(d >= revlength - 2.f && d <= 252.f){ if(abs(sin(angle)*(mouseX-trancenter_x)-cos(angle)*(mouseY-trancenter_y)) <= 3 && samesign(250*cos(angle),mouseX-trancenter_x) && samesign(250*sin(angle),mouseY-trancenter_y)){ textFont(f2); fill(255); text(GRE_SUBS[pos_x][i][j] + "",mouseX- trancenter_x, mouseY - trancenter_y - 5); } } } } translate(-trancenter_x,-trancenter_y); textFont(f2); textAlign(RIGHT); noStroke(); int wx = 1110; for(int j = 4;j >= 0;j--){ fill(subColor[j]); text(subNameGRE[j],wx, 40); wx -= (textWidth(subNameGRE[j]) + 50); } }