Class DefaultChangeEventSupport
java.lang.Object
edu.uci.ics.jung.visualization.util.DefaultChangeEventSupport
- All Implemented Interfaces:
ChangeEventSupport
Basic implementation of ChangeEventSupport, using
standard jdk classes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeEvent
Only oneChangeEvent
is needed instance since the event's only state is the source property.(package private) Object
protected EventListenerList
holds the registered listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Notifies all listeners that have registered interest for notification on this event type.Returns an array of all theChangeListener
s added with addChangeListener().void
Removes a ChangeListener.
-
Field Details
-
eventSource
Object eventSource -
listenerList
holds the registered listeners -
changeEvent
Only oneChangeEvent
is 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:
addChangeListener
in interfaceChangeEventSupport
-
removeChangeListener
Description copied from interface:ChangeEventSupport
Removes a ChangeListener.- Specified by:
removeChangeListener
in interfaceChangeEventSupport
- Parameters:
l
- the listener to be removed
-
getChangeListeners
Description copied from interface:ChangeEventSupport
Returns an array of all theChangeListener
s added with addChangeListener().- Specified by:
getChangeListeners
in interfaceChangeEventSupport
- Returns:
- all of the
ChangeListener
s 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:
fireStateChanged
in interfaceChangeEventSupport
- See Also:
-