Re: ImageListener: Adding imageFocused/Activated event would be nice
Posted by
Wolfgang Gross on
Jul 02, 2010; 9:22am
URL: http://imagej.273.s1.nabble.com/ImageListener-Adding-imageFocused-Activated-event-would-be-nice-tp3687738p3687739.html
Hi Michael
thanks for your reply. For comments see below
On Thu, 1 Jul 2010 21:08:54 +0200, Michael Schmid <
[hidden email]> wrote:
>Hi Wolfgang,
>
>maybe I don't understand the problem correctly, but what about this:
>When the plugin is opened, get the list of open windows from the
>WindowManager and register as a java.awt.event.WindowFocusListener
>for each of them.
Yes, not too much work
>Then use the ImageJ WindowListener interface to get WindowOpened/
>closed events; register as WindowFocusListener for images that will
>be opened, and deregister on windows that will be closed.
Could do this, but then I don't need the ImageListener. But the nice thing with ImageListener is that it uses the static field listeners in modul ImagePlus and hence works automatically on all images, be they open at plugin invcation or not.
Thats why I came up, rather naively, with the idea of proposing the ImageFocused event to be added.
I did it low-key, though (see subject line).
Wolfgang