import android.view.*;
import android.content.Context;
import android.graphics.*;
public class 窗体 extends View{
public 对象 环境=null;
系统线程 xc;
LinearLayout.LayoutParams params=null;
public 窗体(Context c,int x,int y,int w,int h){
super(c);
params = new LinearLayout.LayoutParams(w,h);
setLayoutParams(params);
setX(x);
setY(y);
环境=new 对象(x,y,w,h);
xc=new 系统线程(100){
public void 运行(){
invalidate();
}
};
}
public 窗体(Context c){
super(c);
环境=new 对象(0,0,设备.输出屏幕宽(c),设备.输出屏幕高(c));
params = new LinearLayout.LayoutParams(环境.宽,环境.高);
setLayoutParams(params);
xc=new 系统线程(100){
public void 运行(){
invalidate();
}
};
}
public void draw(Canvas c){
setX(环境.x);
setY(环境.y);
params.width=环境.宽;
params.height=环境.高;
环境.显示(c);
}
public boolean onTouchEvent(MotionEvent e){
环境.事件(e);
invalidate();
return true;
}
public void 设置显示(boolean b){
if(b)setVisibility(View.VISIBLE);
else setVisibility(View.GONE);
}
public void 物理按键(int key,KeyEvent event){
环境.物理按键(key,event);
}
}