Last change
on this file since 11818 was 11818, checked in by (none), 18 years ago |
This commit was manufactured by cvs2svn to create tag
'gsdl-2_70-distribution-branch-merged'.
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
915 bytes
|
Line | |
---|
1 | package org.nzdl.gsdl.GsdlCollageApplet;
|
---|
2 |
|
---|
3 | import java.applet.*;
|
---|
4 | import java.awt.*;
|
---|
5 | import java.awt.image.*;
|
---|
6 | import java.awt.geom.*;
|
---|
7 | import java.util.*;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * @author Katrina Edgar */
|
---|
11 | public class Display extends Thread {
|
---|
12 |
|
---|
13 | GsdlCollageApplet app_ = null;
|
---|
14 |
|
---|
15 | public Display(GsdlCollageApplet app) {
|
---|
16 | super("Display");
|
---|
17 | app_ = app;
|
---|
18 |
|
---|
19 | }
|
---|
20 |
|
---|
21 |
|
---|
22 | /** Runs display thread by repeatedly calling the next frame,
|
---|
23 | * waiting for a specified delay period between calls */
|
---|
24 | public void run() {
|
---|
25 | try {
|
---|
26 |
|
---|
27 | System.err.println("Started display thread.");
|
---|
28 |
|
---|
29 | Thread curr_thread = Thread.currentThread();
|
---|
30 |
|
---|
31 | while (curr_thread == this) {
|
---|
32 | app_.repaint();
|
---|
33 | // can't make it zero or it hogs the whole processor
|
---|
34 | Thread.sleep(100);
|
---|
35 | curr_thread = Thread.currentThread();
|
---|
36 | }
|
---|
37 |
|
---|
38 | System.err.println("Stopped display thread.");
|
---|
39 |
|
---|
40 | } catch (Exception e) {
|
---|
41 | e.printStackTrace();
|
---|
42 | }
|
---|
43 | }
|
---|
44 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.