Frederic Marion-Poll March 31, 2020 at 10:36 am
in the Icy documentation, there are 2 types of SequenceListener, one of which is called WeakSequenceListener. Is this class still relevant? I did not find it in use anywhere. The purpose of WeakListener is to be able to do a “getListener”?
Thank you in advance for your help
FredFrederic Marion-Poll March 31, 2020 at 11:06 am
PS more specifically, I was looking for a way to know when a viewer is displaying a different image from a sequence. I suppose I should not add a listener to the sequence, but rather to its viewer?
Frederic Marion-Poll March 31, 2020 at 12:02 pm
- This reply was modified 3 years, 10 months ago by Frederic Marion-Poll.
PPS problem solved by listening to the Viewer. Sorry for the previous PS. But I would still be interested to understand the difference between a plain listener and a weaklistener.Stephane Dallongeville March 31, 2020 at 2:44 pm
Indeed when you want to have change from the viewer (Z / T position change for instance) then you need to listen the Viewer then. About Weak vs no Weak, it’s a java thing 🙂 Using a WeakListener mean that the listener won’t be retained by the object you are listening (it uses a WeakReference to the listener and automatically remove it when the reference become null). It may be useful when you want to add a listener to an object that you won’t be able to remove later (the listener), avoiding retaining your listener (and attached object) in memory.
The forum ‘Development’ is closed to new topics and replies.