01: package demo.notification.whiteboard;
02:
03: /**
04:
05: * GhostPainter.java
06:
07: *
08:
09: *
10:
11: * Created: Wed Feb 9 18:45:20 2000
12:
13: *
14:
15: * @author Alphonse Bendt
16:
17: * @version
18:
19: */
20:
21: // Wenn der GhostPainter einmal gestartet ist,
22: // schla"ft er eine gewisse Zeit
23: // und malt dann unvermittelt im u"bergebenen AWTWin
24: // Linien ...
25:
26: public class GhostPainter extends Thread {
27:
28: int x, y;
29:
30: long sleep = 5000;
31:
32: IWorkgroupFrame w;
33:
34: boolean active_ = true;
35:
36: public GhostPainter(IWorkgroupFrame w, int x, int y) {
37:
38: this .x = x;
39:
40: this .y = y;
41:
42: this .w = w;
43:
44: }
45:
46: public void shutdown() {
47:
48: active_ = false;
49:
50: interrupt();
51:
52: }
53:
54: public void run() {
55:
56: while (active_) {
57:
58: try {
59:
60: sleep((long) (sleep * Math.random()));
61:
62: } catch (InterruptedException ie) {
63:
64: if (!active_) {
65:
66: return;
67:
68: }
69:
70: }
71:
72: int x0 = (int) (Math.random() * x);
73:
74: int x1 = (int) (Math.random() * x);
75:
76: int y1 = (int) (Math.random() * y);
77:
78: int y0 = (int) (Math.random() * y);
79:
80: }
81:
82: }
83:
84: } // GhostPainter
|