Class DefaultChangeEventSupport
java.lang.Object
edu.uci.ics.jung.visualization.util.DefaultChangeEventSupport
- All Implemented Interfaces:
ChangeEventSupport
Basic implementation of ChangeEventSupport, using
standard jdk classes
- Author:
- Tom Nelson - tomnelson@dev.java.net
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeEventOnly oneChangeEventis needed instance since the event's only state is the source property.protected EventListenerListholds the registered listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidNotifies all listeners that have registered interest for notification on this event type.Returns an array of all theChangeListeners added with addChangeListener().voidRemoves a ChangeListener.
-
Field Details
-
listenerList
holds the registered listeners -
changeEvent
Only oneChangeEventis needed instance since the event's only state is the source property. The source of events generated is always "this".
-
-
Constructor Details
-
DefaultChangeEventSupport
-
-
Method Details
-
addChangeListener
- Specified by:
addChangeListenerin interfaceChangeEventSupport
-
removeChangeListener
Description copied from interface:ChangeEventSupportRemoves a ChangeListener.- Specified by:
removeChangeListenerin interfaceChangeEventSupport- Parameters:
l- the listener to be removed
-
getChangeListeners
Description copied from interface:ChangeEventSupportReturns an array of all theChangeListeners added with addChangeListener().- Specified by:
getChangeListenersin interfaceChangeEventSupport- Returns:
- all of the
ChangeListeners added or an empty array if no listeners have been added
-
fireStateChanged
public void fireStateChanged()Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created. The primary listeners will be views that need to be repainted because of changes in this model instance- Specified by:
fireStateChangedin interfaceChangeEventSupport- See Also:
-