imagej / imagej2

Open scientific N-dimensional image processing :microscope: :sparkler:
https://imagej.net/
BSD 2-Clause "Simplified" License
1.2k stars 337 forks source link

Problem with EventHandler annotation in ImageJ legacy UI #258

Open spiderpig36 opened 4 years ago

spiderpig36 commented 4 years ago

Hi

I am trying to write a plugin for ImageJ2. I used the tutorial repository as a guide. I manged to get EventHandlers working in my test, when I was running the application from my IDE. However when I tested my Plugin in Fiji (added the resulting jar to the plugin directory) the events were not called. I found out, that the events only work in the new UI and not in the legacy UI that is the default in the current Fiji release. Is there any way to make the nice EventHandler annotation work in the old legacy UI?

This is the url to my repo where my working code for the new UI can be found. https://github.com/spiderpig36/imagej-tutorial/tree/7b6b9ba74d9d856d1894517e70722c06f78237fe/maven-projects/measure

As a workaround I use the old ImageJ1 API which works, but is not as convenient as the new one.

Thanks for your Help!

imagejan commented 4 years ago

The Legacy UI (implemented in the imagej-legacy component) indeed fails to report (some of the) AWT events in the SciJava framework.

See https://github.com/imagej/imagej-legacy/issues/132.