This is the web version of EJS interface
EJS version 4.3.7
  1. Title=Vernier calipers
  2. Author=Fu-Kwun Hwang original, remix by lookang
  3. Keywords=Vernier calipers measurement physics
  4. Level=secondary pre university
  5. Language=english
  6. Abstract=Original Source code by Fu-Kwun Hwang http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=567.msg2364#msg2364 Derived work by Loo Kang WEE under creative commons http://creativecommons.org/licenses/by/2.5/tw/deed.en http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=684.msg2452#msg2452
  7. CaptureTools=false
  8. DataTools=false
  9. LanguageTools=false
  10. AppletColSupport=false
  11. UseMacMenuBar=false
  12. UseInterpreter=true
  13. AuxiliaryFiles=./VernierCaliper/;
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    NameValueTypeDimension
    for(int i=0;i<n2t;i++){ // n2t is set to 11 because 01234567890 tm2t[i]=i+""; // tm2t[i]=i+""; if(i==n2t-1) tm2t[i]="0"; // i think is to draw 0 in place of 10 } zeroxm=zerox+error*unit*dxm; // for zero error scale to move when there is zero error
    if(mode.equals("50/49/50")){ dycst=1.; n2s=51; dx2=49*dxm/50; nmode=5; L=50*dxm+size; // l_unit="0.02mm"; unit=0.02; }else if(mode.equals("50/49/10")){ dycst=0.; n2s=51; dx2=49*dxm/50; nmode=5; L=50*dxm+size; // l_unit="0.1mm"; unit=0.1; }else if(mode.equals("40/39/20")){ dx2=39*dxm/40*2; n2s=21; dycst=1.; nmode=2; L=40*dxm+size; // l_unit="0.05mm"; unit=0.05; }else if(mode.equals("40/39/10")){ dx2=39*dxm/40*2; n2s=21; dycst=0.; nmode=2; L=40*dxm+size; // l_unit="0.1mm"; unit=0.1; }else if(mode.equals("20/19/20")){ dx2=19*dxm/20; n2s=21; dycst=1.; nmode=2; L=20*dxm+size; // l_unit="0.05mm"; unit=0.05; }else if(mode.equals("20/19/10")){ dx2=19*dxm/20; n2s=21; dycst=0.; nmode=2; L=20*dxm+size; // l_unit="0.1mm"; unit=0.1; } l_unit=unit+"mm"; x6[4]=x6[5]=x2+L; for(int i=0;i<nm;i++){ xm[i]=x2+zerox+i*dxm; if(i%10==0){ dym[i]=y1/2; xmt[i/10]=xm[i]; tmt[i/10]=i+""; }else if(i%5==0)dym[i]=y1/4+size/2; else dym[i]=y1/4; } for(int i=0;i<n2t;i++){ tm2t[i]=i+""; if(i==n2t-1)tm2t[i]="0"; } zeroxm=zerox+error*unit*dxm;
    for(int i=0;i<nm;i++){ xm[i]=x2+zerox+i*dxm; //Initizlize Tab: xm=x2+zerox+i*dxm; drawing the top scale if(i%10==0){ dym[i]=y1/2; xmt[i/10]=xm[i]; // numbers position tmt[i/10]=i+""; // texts for upper scale }else if(i%5==0)dym[i]=y1/4+size/2; else dym[i]=y1/4; }
    /* from hwang fk 1. dycst=0; no minor ticks. dycst=1; draw minus ticks. The length of the ticks are evated by dycst*minor_ticke_length. 2. 0.02mm case without minor ticks will be the same as 0.1mm case. That is why all the rest parameters are the same. 3. n2s is the number of ticks on the scale. */ if(mode.equals("0.02 mm version 1")){ dycst=1.; n2s=51; dx2=49*dxm/50; nmode=5; L=50*dxm+size; // added by wee for left right button // that may be a more elegant code for this // increment = 0.25718*2/5;// take 257.16 divide 50 mm divide 20*2/5 // increment = dxm/50 ; // l_unit="0.02mm"; unit=0.02; increment = dxm/(1/unit); }else if(mode.equals("0.1 mm version 1")){ dycst=0.; n2s=51; dx2=49*dxm/50; nmode=5; L=50*dxm+size; // added by wee for left right button // increment = 0.25718*2;// take 257.16 divide 50 mm divide 10 // increment = dxm/10 ; // increment = dxm/(n2s-1) ; // l_unit="0.1mm"; unit=0.1; increment = dxm/(1/unit); }else if(mode.equals("0.05 mm version 1")){ dx2=39*dxm/40*2; // control the spacing of the numbers on lower scale n2s=21; // number of intervals on the lower scale dycst=1.; // dycst=0; no minor ticks. dycst=1; draw minus ticks. nmode=2; // numbers position align with the ticks on lower scale L=40*dxm+size; // control the size of the lower scale in x direction // l_unit="0.05mm"; unit=0.05; // added by wee for left right button // increment = 0.25718;// take 257.16 divide 50 mm divide 20 // dxm is the x direction spacing on the interval of the lower scale //increment = dxm/20 ; // thanks for the tip prof hwang increment = dxm/(1/unit); }else if(mode.equals("0.1 mm version 2")){ dx2=39*dxm/40*2; n2s=21; dycst=0.; nmode=2; L=40*dxm+size; // added by wee for left right button // increment = 0.25718;// take 257.16 divide 50 mm divide 20 // increment = dxm/10; // l_unit="0.1mm"; unit=0.1; increment = dxm/(1/unit); }else if(mode.equals("0.05 mm version 2")){ dx2=19*dxm/20; n2s=21; dycst=1.; nmode=2; L=20*dxm+size; // added by wee for left right button // increment = 0.25718;// take 257.16 divide 50 mm divide 20 // increment = dxm/20 ; // l_unit="0.05mm"; unit=0.05; increment = dxm/(1/unit); } else if(mode.equals("0.1 mm version 3")) { dx2=19*dxm/20; n2s=21; dycst=0.; nmode=2; L=20*dxm+size; // added by wee for left right button // increment = 0.25718*2;// take 257.16 divide 50 mm divide 10 // increment = dxm/10 ; // l_unit="0.1mm"; unit=0.1; increment = dxm/(1/unit); } //lookang adding else if(mode.equals("0.1 mm version 4")) // added due to request by another version 0.1 mm Vernier constant where 10 divisions of vernier will coincide will 9 divisions of the main scale. { dx2=9*dxm/20; // smaller means smaller widrh of vernier scale n2s=21; dycst=0.; nmode=2; L=10*dxm+size; // control length of veriner // added by wee for left right button // increment = 0.25718*2;// take 257.16 divide 50 mm divide 10 // increment = dxm/10 ; // l_unit="0.1mm"; unit=0.1; increment = dxm/(1/unit); } l_unit=unit+"mm"; x6[4]=x6[5]=x2+L; //mode = "0.05 mm version 1 singapore schools"; // make applet understand start with this mode
    l_unit2=l_unit; // to initialize to appear at beginning of simulation start text1 =""+dvalue((int)(x/dxm),unit);
    //if ( ox>oxmin+w/2&&x<=ox+w/2-x2&&oy<oymax-h/2&&oy>oymin-h/2 ) { // insideinnerjaws=true; //} //else{ // insideinnerjaws=false; // // to check boundary of blue object with the parts of the vernier caliper if(ox<=oxmin+w/2&&oy>oymin-h/2) { // check left boundary true ox=oxmin+w/2; //if ( ox+w/2>=x&&ox-w/2<=x2 ) { // x=w; //} if(x2+x<=ox+w/2&&oy>oymin-h/2){ // check object and jaws to stop motion&& object y above object y minimum x=w; } //else if (oy>=oymin-h/2) { // wrong position of codes // oy=oymin-h/2; // } // need to force lowerscaletext and lines to stop moving after toching the object to the left side jaw } //} //if(ox<=xmin+w/2)x=w; if(x<0)x=0; // for the 2 jaws to meet at zero // old code b4 suggest by wolfgang else if((ox>x2+x-w/2)&&(oy>oymin-h/2)){ // right jaw hit object //else if((ox>x2+x-w/2)&&(oy>y3-h)){ // right jaw hit object // ox=x2+x-w/2; // check right boundary ox=x2+x-w/2; // to force the blue object into the open jaws } if(oy>oymax-h/2)oy=oymax-h/2; // check top boundary codes changes to suit lookang thinking // codes to check boundary with the right internal jaws // xdmin=ox+d+w/2; // define with xdmin means xdmin=ox+d+w/2; // define with xdmin means //if(x<xdmin)x=xdmin; // appears to only work for (x<xdmin)x=xdmin; //if(oy>(oymin+h/2) && x<xdmin)x=xdmin; // disabled does ntg now //if(x<x2)x=x2; // to block if internal jaws meet i think no need //else if(x>x+L)x=x+L; // to limit how much to move to the right i think no need //value=(x-x1)/ratio-0.05; // value is no needed //value = d; // that is the equivalent if(topone){ if(x>=b){ x=b; if ( (ox>x2+x-w/2)&&(oy>oymin-h/2)){ // check blue touch jaw touch green ox=x0+a+b-w/2; // force object x to be fixed just enough like blocked } }// block upper jaw on green object as jaw move px[2]=px[1]=x0+2*a+b; // extreme right corner outer px[3]=px[4]=x0+a+b; // extreme right corner inner }
    oxmax=oxmin+x; // to check boundary of blue object with the parts of the vernier caliper if(ox-w/2>oxmin-20&&ox+w/2<oxmax+20&&oy+h/2>oymin)outobject=false; else outobject = true; if(ox-w/2<=oxmin&&(oy+h/2-oymin)>0) { // check left boundary true ox=oxmin+w/2; if(x2+x<=ox+w/2&&oy>oymin-h/2){ // check object and jaws to stop motion&& object y above object y minimum x=w; } } if(x<0)x=0; // for the 2 jaws to meet at zero // old code b4 suggest by wolfgang else if((ox>x2+x-w/2)&&(oy>oymin-h/2)&&(oy<=oymax-h/2)){ // right jaw hit object and inside jaws ox=x2+x-w/2; // to force the blue object into the open jaws } if(oy>=oymax-h/2)oy=oymax-h/2; // check top boundary codes changes to suit lookang thinking // xdmin=ox+d+w/2; // define with xdmin means xdmin=ox+d+w/2; // define with xdmin means if(topone){ if(x>=b){ x=b; if ( (ox>x2+x-w/2)&&(oy>oymin-h/2)){ // check blue touch jaw touch green ox=x0+a+b-w/2; // force object x to be fixed just enough like blocked } }// block upper jaw on green object as jaw move px[2]=px[1]=x0+2*a+b; // extreme right corner outer px[3]=px[4]=x0+a+b; // extreme right corner inner } // for tail hitting the inside depth of the object tube if(tail){ if(x>=td-xmax){ x=td-xmax; } }
    //if(x<0)x=0; // for the 2 jaws to meet at zero oxmax=oxmin+x; if(w>x){ // if width of blue object larger than jaws gap if(oy>oymin-h/2)oy=oymin-h/2; // if blue object try to move in the jaws, block it with oy=oymin-h/2 outobject=true; // outside object is true }else{// object is smaller than the width if(outobject){ // if outisde object is true if(ox-w/2>oxmin && ox+w/2<oxmax && oy+h/2>oymin){// move inside outobject=false; // blue object is inside jaws }else{ if(ox-w/2<oxmin || ox+w/2>oxmax){ // if blue object is force outwards if(oy+h/2>oymin)oy=oymin-h/2; // if also inside jaws, then block with oy=oymin-h/2 } } }else{ if(oy+h/2<oymin)outobject=true;// move outside again else{ if(oy+h/2>oymax)oy=oymax-h/2; // top limit reach, block if(ox-w/2<oxmin)ox=oxmin+w/2; // left limit reach,block else if(ox+w/2>oxmax)ox=oxmax-w/2; //right limit reach, block } } } // to check boundary of blue object with the parts of the vernier caliper // if(ox-w/2>oxmin-20&&ox+w/2<oxmax+20&&oy+h/2>oymin)outobject=false; // else outobject = true; /* if(ox-w/2<=oxmin&&(oy+h/2-oymin)>0&&outobject==false) { // check left boundary true ox=oxmin+w/2; if(x2+x<=ox+w/2&&oy>oymin-h/2&&outobject==false){ // check object and jaws to stop motion&& object y above object y minimum x=w; } } */ // old code b4 suggest by wolfgang /* else if((ox>x2+x-w/2)&&(oy>oymin-h/2)&&(oy<=oymax-h/2)&&outobject==false){ // right jaw hit object and inside jaws ox=x2+x-w/2; // to force the blue object into the open jaws } if(oy>=oymax-h/2)oy=oymax-h/2; // check top boundary codes changes to suit lookang thinking */ // xdmin=ox+d+w/2; // define with xdmin means xdmin=ox+d+w/2; // define with xdmin means if(topone){ if(x>=b){ x=b; if ( (ox>x2+x-w/2)&&(oy>oymin-h/2)){ // check blue touch jaw touch green ox=x0+a+b-w/2; // force object x to be fixed just enough like blocked } }// block upper jaw on green object as jaw move px[2]=px[1]=x0+2*a+b; // extreme right corner outer px[3]=px[4]=x0+a+b; // extreme right corner inner }
    zero=0.; xm2t[0]=x2+x+zeroxm+0*0; // does not work to force lower scale numbers to stick to lower scale // for spacings for(int i=0;i<n2s;i++){ xm2[i]=x2+zeroxm+i*dx2+x; // spacings in lower scale if(i%nmode==0){ dy2[i]=-y1/4; // inbetween lines shorter xm2t[i/nmode]=xm2[i]; // numbers on lower scale x spacing } else dy2[i]=-y1/8*dycst; } l_x=dvalue(x/dxm,unit)+"mm";//+unit+":"; // l_x is the label for the final answer answer = ddvalue(x/dxm,unit); // answer is the double for check l_answer= dvalue(x/dxm,unit)+""; if(unit==0.1){ // out is the same as my vss, it is the top number vs=(int)(out/unit+0.5)-(int)out*10+error; if(vs>n2s-2)vs-=(n2s-1); else if(vs<0)vs+=(n2s-1); // adding this code to solve array out of bound error 803 // http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1183.0 solution discussed if(vs>-1 && vs<n2t)vsidarray=vs; else vsidarray=0;// or other valid values. // this line is causing array ou of bound error 803 //xp=xm2t[vs]; // this is the way to determine position of lower scale pointer xp=xm2t[vsidarray]; } // added by wee to fix bug 0.08 show as 0.05 instead of 0.1 /* else if(unit==0.05){ // out is the same as my vss, it is the top number vs=(int)(((int)(out*100)-100*(int)out)/(unit*100)+0.5)+error; if(vs>n2s-2)vs-=(n2s-1); else if(vs<0)vs+=(n2s-1); xp=xm2t[vs]; // this is the way to determine position of lower scale pointer } */ else{ vs=(int)(((int)(out*100)-100*(int)out)/(unit*100)+0.5)+error; // vs is the counter of number of scale right of 0 for the lower scale if(vs>n2s-2)vs-=(n2s-1); else if(vs<0)vs+=(n2s-1); xp=xm2[vs]; // this is the way to determine position of lower scale pointer } if(vs>51)vs=0; // vs greater 51 than reset to 0 becuase 50 tickers if(show){ l_unit2=l_unit; // l_x="d="+l_x; //codes add by wee for hint and answer to show clearly the idea of answer n error if ( error == 0 ) { l_x="d="+l_x; //text1 =""+dvalue((int)(x/dxm),unit); } else if ( vs*unit+(-error*unit) >= 0&&error>0){ // check case zeroeror=+, scale 2.5,3,3.5,4,4.5,.....9.5 l_x="d=" + dvalue((int)(x/dxm),unit)+ "+" +dvalue(vs*unit,unit)+ "-(" + dvalue(+error*unit,(unit))+ ") = " + l_x; //text1 magenta changing so ned to inside the if statement //text1 =""+dvalue((int)(x/dxm),unit); } else if ( vs*unit+(-error*unit) < 0&&error*unit>0 ){ // check case zeroerror = +, scale is 0,0.5,1,1.5,2 l_x="d=" + dvalue((int)(x/dxm+1),unit)+ "+" +dvalue(vs*unit,unit)+ "-(" + dvalue(error*unit,(unit))+ ") = " + l_x; //text1 =""+ dvalue((int)(x/dxm+1),unit); } else if ( vs*unit+(-error*unit) < 1&&error*unit<0 ){ // check case zeroerror = -, scale is 0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,7 l_x="d=" + dvalue((int)(x/dxm),unit)+ "+" +dvalue(vs*unit,unit)+ "-(" + dvalue(error*unit,(unit))+ ") = " + l_x; //text1 =""+ dvalue((int)(x/dxm),unit); } // to fix a bug when measurement is -1+0.75+(0.25) = 0.00mm // think there is still a display bug if click to fast but the current code is good enough else if ( x==0&&vs*unit+(-error*unit) >= 1&&error*unit<0 ){ // to fix a bug check case zeroerror = -, scale is 7.5,8,8.5,9,9.5 l_x="d=" + dvalue((int)(x/dxm-1),unit)+ "+" +dvalue(vs*unit,unit)+ "-(" + dvalue(error*unit,(unit))+ ") = " + l_x; //text1 =""+ dvalue((int)(x/dxm-1),unit); } // to fix a bug when measurement is -1+0.8 to 0.95+(0.25) = 0.05 to 0.20mm else if ( x<1.06&&vs*unit+(-error*unit) >= 1&&error*unit<0 ){ // to fix a bug check case zeroerror = -, scale is 7.5,8,8.5,9,9.5 l_x="d=" + dvalue((int)(x/dxm-2),unit)+ "+" +dvalue(vs*unit,unit)+ "+(" + dvalue(-error*unit,(unit))+ ") = " + l_x; //text1 =""+ dvalue((int)(x/dxm-2),unit); } else if ( vs*unit+(-error*unit) >= 1&&error*unit<0 ){ // check case zeroerror = -, scale is 7.5,8,8.5,9,9.5 l_x="d=" + dvalue((int)(x/dxm-1),unit)+ "+" +dvalue(vs*unit,unit)+ "-(" + dvalue(error*unit,(unit))+ ") = " + l_x; //text1 =""+ dvalue((int)(x/dxm-1),unit); } else { l_x="d="+l_x; } }else{ // l_unit2=l_unit; // made it to display all the time by wee l_x="d= ??? mm"; // added to make the answer show ??? all the time // if(x==0) l_x="d="+l_x; //wee found it to be unnecessary // else l_x="d= ??? mm"; // display ??? when unknown } // text2 is red is outside the if statement cos it is always true //text1 =""+dvalue((int)(x/dxm),unit); cannot be here cause error in dispaly //text2 = dvalue(vs*unit,unit);
    vss = (int)((x/dxm+error*unit+2.e-2)); // introduce to point to include zero error and debug need + 1.e-2 for cases where there may be error is calculation //vss = (int)(x/dxm); // old code without zero error // adding this code to solve another array out of bound error 803 // http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1183.0 solution discussed if(vss>-1 && vss<nm)vssidarray=vss; else vssidarray=0;// or other valid values. //xpt=xm[vss]; // x point xpt=xm[vssidarray]; text2 = dvalue(vs*unit,unit); //codes add by wee for hint and answer to show clearly the idea of answer n error if ( error == 0 ) { text1 =""+dvalue((int)(x/dxm+2.e-2),unit); } else if ( vs*unit+(-error*unit) >= 0&&error>0){ // check case zeroeror=+, scale 2.5,3,3.5,4,4.5,.....9.5 //text1 magenta changing so ned to inside the if statement text1 =""+dvalue((int)(x/dxm+2.e-2),unit); } else if ( vs*unit+(-error*unit) < 0&&error*unit>0 ){ // check case zeroerror = +, scale is 0,0.5,1,1.5,2 text1 =""+ dvalue((int)(x/dxm+1+2.e-2),unit); } else if ( vs*unit+(-error*unit) < 1&&error*unit<0 ){ // check case zeroerror = -, scale is 0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,7 text1 =""+ dvalue((int)(x/dxm+2.e-2),unit); } // to fix a bug when measurement is -1+0.75+(0.25) = 0.00mm // think there is still a display bug if click to fast but the current code is good enough else if ( x==0&&vs*unit+(-error*unit) >= 1&&error*unit<0 ){ // to fix a bug check case zeroerror = -, scale is 7.5,8,8.5,9,9.5 text1 =""+ dvalue((int)(x/dxm-1+2.e-2),unit); } // to fix a bug when measurement is -1+0.8 to 0.95+(0.25) = 0.05 to 0.20mm else if ( x<1.06&&vs*unit+(-error*unit) >= 1&&error*unit<0 ){ // to fix a bug check case zeroerror = -, scale is 7.5,8,8.5,9,9.5 text1 =""+ dvalue((int)(x/dxm-2+2.e-2),unit); } else if ( vs*unit+(-error*unit) >= 1&&error*unit<0 ){ // check case zeroerror = -, scale is 7.5,8,8.5,9,9.5 text1 =""+ dvalue((int)(x/dxm-1+2.e-2),unit); }
    // number as hints red color 0.05 mm for example if ( error == 0 ) { // case 1 zero error is zero text2 = dvalue(vs*unit,unit)+"mm";// vs*unit; text2 is the RedText } else { // case 2 zero error is non zero text2 = dvalue(vs*unit,unit)+ "+(" + dvalue(-error*unit,(unit)) + ") mm"; } // number as hints red color 0.05 mm for example //text2 = dvalue(vs*unit,unit)+"mm"; // vs*unit; // number is top hint megenta color 20 mm for example //text1 = dvalue((int)(x/dxm),unit)+"mm"; // number on the top scale //code by weelk to counter the problem of 12.00 + 0.85+0.15 = 13 when it should be 11 +0.85+0.15 = 12 //if ( error == 0 ) { //case 3 all // vs*unit+(-error*unit) = red number of the lower scale // text1 = dvalue((int)(x/dxm),unit)+"mm"; // number on the top scale //} if ( (vs*unit+(-error*unit))>= 1&&(vs*unit>0 )){ // case 4 Red number is greater equal to 1 for carry forward calculaton when zero error text1 = dvalue((int)(x/dxm-1),unit)+ "mm"; vss = (int)(x/dxm-1); // need to make the arrow guide move when the value is increase from 17.95 to 18.00 when error is there if ( vss<0) vss=0; // attempt to fix array exception error xpt=xm[vss]; } else if (( vs*unit+(-error*unit) <= 0 )&&(vs*unit>0)){// need (vs*unit>0) cause there is a bug when answer is 0mm with zero error text1 = dvalue((int)(x/dxm+1),unit)+ "mm"; vss = (int)(x/dxm+1); // // need to make the arrow guide move when the value is decrease from 18.00 to 17.95 when error is there if ( vss<0) vss=0; // attempt to fix array exception eror xpt=xm[vss]; } else { text1 = dvalue((int)(x/dxm),unit)+"mm"; }
    if (showAnswerFlag==false) { K1fcorrect = ""; } else { //Double.valueOf(l_enterK1f); //dDouble.valueOf(l_enterK1f); // enterK1f=Double.parseDouble(l_enterK1f); // enterK1f= valueOf(l_enterK1f); //if(l_answer.compareTo(l_enterK1f)==0){// exactly the same if(l_answer.compareTo(l_enterK1f)==0){ K1fcorrect = "Great! You have the right answer!"; K1fcorrectbackground = java.awt.Color.GREEN; } else {// different string but might be correct value // double a,b; // a=new Double(l_answer).doubleValue(); //or a= Double.parseDouble(ans); // or b=Double.parseDouble(uvalue); if(Math.abs(answer-enterK1f)<1.e-7){// same value but different digits or incorrect format K1fcorrect = " Check the number of digits "; K1fcorrectbackground = java.awt.Color.ORANGE; } else {// different value //double c; // c=new Double(l_enterK1f).doubleValue(); K1fcorrect = " Incorrect, Your input is out by "+ double2String((answer - enterK1f),100000) ; K1fcorrectbackground = java.awt.Color.RED; } } showAnswerFlag=false; // set back to false }
    // idea from http://www.daniweb.com/forums/thread13029.html# // not used if ( t % 2 == 0 ) { // Even background = new java.awt.Color(255,0,0); } else { background = new java.awt.Color(255,255,255); // Odd }
    //xmin = (xmin-0)*zoom; //xmax = (xmax-0)*zoom; //ymin = (ymin-0)*zoom; //ymax = (ymax-0)*zoom; if (showmagnify ==true) // to make magnify enable only after show ==true { xmagnify=mx; ymagnify=my; } if (xmagnify >xmax)xmagnify = xmax/2; // prevent magnifer from going beyond if (xmagnify <xmin)xmagnify = xmin/2; if (ymagnify >ymax)ymagnify = ymax/2; if (ymagnify <xmin)ymagnify = xmin/2;

    chinese

    Array