zcarviewupdatethread.java
来自「ZDrive Driving Warning System」· Java 代码 · 共 58 行
JAVA
58 行
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package zdrive.engines;import zdrive.protocols.*;import zdrive.panels.*;/** * * @author Mohamed Aly */public class ZCarViewUpdateThread extends Thread{ private String direction=""; private ZAbstractEvent abs_event; private ZCarView car_view; private int event; public ZCarViewUpdateThread(int event,ZAbstractEvent abs_event,ZCarView car_view){ this.abs_event = abs_event; this.car_view = car_view; this.event = event; } @Override public void run(){ if(event== ZEventConstants.EMERGENCY_VEHICLE_EVENT || event==ZEventConstants.MOTORCYCLE_EVENT){ car_view.setVisible(true); while(!abs_event.isCompleted()){ this.direction = abs_event.getDirection(); car_view.setDirection(this.direction); try{ sleep(1000); }catch(Exception e) { e.printStackTrace(); } } } car_view.setVisible(false); System.out.println("DONE WITH CAR VIEW THREAD"); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?