Package org.openstreetmap.josm.gui.util
Class ChangeNotifier
java.lang.Object
org.openstreetmap.josm.gui.util.ChangeNotifier
- Direct Known Subclasses:
AbstractListMergeModel,AbstractTextComponentValidator,HelpBrowserHistory,HistoryBrowserModel,PluginPreferencesModel,PropertiesMergeModel
Replacement to
java.util.Observable class, deprecated with Java 9.- Since:
- 10210
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChangeEventOnly oneChangeEventis needed per button model instance since the event's only state is the source property.private final EventListenerListStores the listeners on this model. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdds aChangeListener.protected final voidNotifies all listeners that have registered interest for notification on this event type.final voidRemoves aChangeListener.
-
Field Details
-
listenerList
Stores the listeners on this model. -
changeEvent
Only oneChangeEventis needed per button model instance since the event's only state is the source property. The source of events generated is always "this".
-
-
Constructor Details
-
ChangeNotifier
public ChangeNotifier()
-
-
Method Details
-
addChangeListener
Adds aChangeListener.- Parameters:
l- the listener to add
-
removeChangeListener
Removes aChangeListener.- Parameters:
l- the listener to add
-
fireStateChanged
Notifies all listeners that have registered interest for notification on this event type. The event instance is created lazily.
-