home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 791 b | 47 lines |
- // NowBlinkThread.java
- // 26.03.96
- //
- // makes the lights on the NowPanel blink
-
- package cybcerone.main;
-
- /**
- * The thread that the NowPanel spawns to make its lights blink.
- */
- class NowBlinkThread extends Thread {
- private final int onTime = 350;
- private final int offTime = 1050;
-
- private NowPanel theNow;
-
- public NowBlinkThread (NowPanel theNow) {
- this.theNow = theNow;
- }
-
- public void run () {
- int i;
- NowEventPanel panels[] = theNow.getPanels ();
-
- while (true) {
-
- try {
- sleep (offTime);
- } catch (InterruptedException e) {
- }
-
- for (i = 0; i < theNow.getActivePanels(); i++) {
- panels[i].turnLightsOn ();
-
- try {
- sleep (onTime);
- } catch (InterruptedException e) {
- }
-
- panels[i].turnLightsOff ();
- }
-
- }
- }
- }
-
-