Methods Summary |
---|
void | doCalc(int i)
// calculate the ith section of the fractal
|
public void | paint(java.awt.Graphics g)
// Paint the completed sections of the fractal
|
public void | run()
for (int i = 0; i < nSections; i++) {
doCalc(i);
repaint();
synchronized(runLock) {
while (shouldRun == false)
try {
runLock.wait();
} catch (InterruptedException ie) {}
}
}
|
public void | start()
if (t == null) {
shouldRun = true;
t = new Thread(this);
t.setPriority(Thread.currentThread().getPriority() - 1);
t.start();
}
else {
synchronized(runLock) {
shouldRun = true;
runLock.notify();
}
}
|
public void | stop()
shouldRun = false;
|