package Current.basic; import Current.*; import java.applet.Applet; import java.awt.event.*; import java.awt.*; import java.awt.geom.*; /*This is a basic class for a rectangular integer entry button*/ public class IntegerSquare { public double x,y,w,h; public int val,on; public int sign; public Font FONT; /*rectangle*/ public IntegerSquare(double x,double y,double w,double h,int val) { this.x=x; this.y=y; this.w=w; this.h=h; this.val=val; this.on=0; this.FONT=new Font("Helvetica",Font.PLAIN,12); this.sign=1; } public int inside(Point p) { int test=0; if((p.x>x)&&(p.xy)&&(p.y=0)&&(ch<10)){ temp=10*temp+ch; } val=temp; if(val>99999999) val=99999999; } public void modifySign(KeyEvent e) { int temp=val; char test=e.getKeyChar(); if (e.getKeyChar()==KeyEvent.VK_BACK_SPACE) { temp=temp/10; } if (e.getKeyChar()==KeyEvent.VK_DELETE) { temp=1; } int ch=(int)(e.getKeyChar()-'0'); if ((ch>=0)&&(ch<10)){ temp=10*temp+ch; } val=temp; if(val>99999999) val=99999999; if(test=='-') val=-val; } }