Hi, if I want to develop a plugin for ImageJ2, there are basically two kinds of plugin:
1. first kind plugin does not need GUI; 2. second kind plugin does need GUI. Suppose this plugin will perform a long time-consumed task, so I want to ask that: 1. will ImageJ2 run its plugin in a new thread? Because in Swing toolkit, all UI events should be processed in UI thread or the main thread, and there is only One UI thread, so it is a single thread model. Running a plugin in a new thread can guarantee the plugin will not block ImageJ2's GUI. 2. If this plugin need its own GUI, but this plugin is running in a thread which is not the UI thread (event dispatch thread), and this plugin's GUI should be created in UI thread for thread safe, how can this be done? In order to avoid blocking the ImageJ2' user interface, I plan to do like this: 1. execute the "long time-consumed task" in a separate worker thread; 2. In the task running process, I want to report the running progress to the ImageJ2 main frame, so that the main frame can display a progress information to let user know the current status; 3. When the task completed, it can notify the main frame, and the main frame can response to this event. How can I implement this asynchronous task model in ImageJ2? (I think maybe I need some helper classes like "SwingWorker" in JDK 6) Thanks! -- Yili Zhao
_______________________________________________ ImageJ-devel mailing list ImageJ-devel@imagej.net http://imagej.net/mailman/listinfo/imagej-devel