A utility class for a mechanism common to many GUI objects : they listen to certain preferences and need to act upon changes. However to improve performance, the listening is paused when the components are hidden and resumed when they are shown or added to ancestor GUI components.
This class tracks a set of preferences specified by key strings. It implements the DynamicListening interface and thus can be used in a DynamicAncestorAdapter. When the listening is resumes, this class checks for changes that might have occured to the tracked preferences. All relevant PreferenceChangeEvents are forwarded to the LaterInvocationManager.Listener provided in the constructor call.
Another important issue is to avoid deadlocks that can be easily caused in the java.util.prefs.Preferences context because it provides no means to find out who changed the preferences. Therefore if a component both changes a preferences and tracks (listens to) changes of the same preference, it can produce and infinite loop. Besides, if another component changes to prefs but the old value equals the new value, unneccessary overhead might be created. To avoid this, this class checks to see if a preference value really changed - if not, that PreferenceChangeEvent is NOT forwarded to the LIM-Listener.
@author Hanns Holger Rutz
@version 0.14, 20-Mar-08