IJ.resetEscape() and IJ.escapePressed()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

IJ.resetEscape() and IJ.escapePressed()

Frederic V. Hessman
I'm trying to stick in a means of escaping the processing of a large  
ImageStack (a video) - something IJ.escapePressed() is supposed to  
provide.

This works great whenever I use it in simple test PlugIn's or  
PlugInFilter's, but doesn't in my more complex plugin (the  
MultiAperture_ plugin in my Astronomy package).

Here's the method I'm trying to change (leaving out all the stuff  
which I've tested to see doesn't make any difference; the int's  
firstSlice & lastSlice and the ImagePlus img are global variables):

         protected void processStack ()
                 {
                 IJ.resetEscape(); // START LOOKING FOR <ESC>
                 for (int i=firstSlice; i <= lastSlice; i++)
                         {
                         img.setSlice(i);
                         processImage();
                         if (IJ.escapePressed()) // <ESC> PRESSED?
                                 {
                                 IJ.beep(); // NEVER GET HERE, NO  
MATTER HOW OFTEN <ESC> IS PRESSED!!!!
                                 return;
                                 }
                         }
                 }

Any simple reason why this doesn't work when the other plugins worked  
with methods which look just the same? There are no other  
IJ.resetEscape() or IJ.escapePressed() anywhere else, though the  
<ESC>'s ARE caught even earlier within the plugin when the IJ calls  
ARE stuck in other methods, so it can't just be the whole thing  
entirely.

Rick

------------------------------------------------------------------------
------------------------
Dr. Frederic V. Hessman     [hidden email]
Institut für Astrophysik          Tel.  +49-551-39-5052
Friedrich-Hund-Platz 1         Fax +49-551-39-5043
37077 Goettingen                 Room F04-133
http://www.Astro.physik.Uni-Goettingen.de/~hessman
------------------------------------------------------------------------
-------------------------
MONET: a MOnitoring NEtwork of Telescopes
http://monet.Uni-Goettingen.de
------------------------------------------------------------------------
-------------------------