i = listeners.iterator();
while (i.hasNext()) {
ThreadListener listener = i.next();
listener.finished();
}
}
protected void clear() {
sendFinished();
listeners.clear();
listeners = null;
}
/**
* starten mit
*
*
* Thread p = new ImageThread(..);
* p.start();
*
*/
@Override
public void run() {
try {
ImageActor be = new ImageActor();
be.createImage(dir, relName, indicator, size, toFile);
be.setImgSrc(datei, ext, toFile);
clear();
} catch (IOException ex) {
Logger.getLogger(ImageThread.class.getName()).log(Level.SEVERE, null, ex);
clear();
}
}
public void addListener(ThreadListener listener) {
listeners.add(listener);
}
public void removeListener(ThreadListener listener) {
listeners.remove(listener);
}
public interface ThreadListener {
public void finished();
}
}