예제 #1
0
파일: Clock.java 프로젝트: baiyu123/FIFO
 public void run() {
   while (true) {
     if (isPaused == false) {
       try {
         Thread.sleep(500);
         if (!isHalfTime) {
           calculateTime();
           fieldPanel.updateClock(time);
         } else if (isHalfTime && counter == 0) {
           Thread.sleep(100);
           fieldPanel.reset();
           this.endHalfTime();
           fieldPanel.setHalfTime();
           // mClientPanels.switchToResults();
         } else {
           Thread.sleep(500);
           mClientPanels.switchToResults();
           break;
         }
       } catch (InterruptedException ie) {
         ie.printStackTrace();
       }
     } else {
       try {
         Thread.sleep(1);
       } catch (InterruptedException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
       }
     }
   }
 }
예제 #2
0
파일: Clock.java 프로젝트: baiyu123/FIFO
 public void startSecondHalf() {
   fieldPanel.reset();
   start = System.currentTimeMillis();
   time = "0:00";
 }