Package VASSAL.property
Interface PropertySupport
- All Known Implementing Classes:
ConcurrentPropertySupport
public interface PropertySupport
An interface for handling
PropertyListener
s.
PropertyContainer
s may delegate listener handling to instances
of this class.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Method Summary
Modifier and TypeMethodDescription<T> void
addPropertyListener
(Property<T> prop, PropertyListener<? super T> listener) Adds a listener for a specificProperty
.void
addPropertyListener
(PropertyListener<Object> listener) Adds a listener for all changes.<T> void
fireChanged
(Object src, Property<T> prop, T oldVal, T newVal) Notifies listeners of a property change.Returns a list ofPropertyListener
s listening to all changes.<T> List
<PropertyListener<? super T>> getPropertyListeners
(Property<T> prop) Returns a list ofPropertyListener
s listening to a givenProperty
.boolean
Checks whether there arePropertyListener
s for all changes.<T> boolean
hasListeners
(Property<T> prop) Checks whether there arePropertyListener
s for a givenProperty
.<T> void
removePropertyListener
(Property<T> prop, PropertyListener<? super T> listener) Removes a listener for a specificProperty
.void
removePropertyListener
(PropertyListener<Object> listener) Removes a listener for all changes.
-
Method Details
-
addPropertyListener
Adds a listener for all changes.- Parameters:
listener
- the listener to add
-
removePropertyListener
Removes a listener for all changes.- Parameters:
listener
- the listener to remove
-
hasListeners
boolean hasListeners()Checks whether there arePropertyListener
s for all changes.- Returns:
true
if there are listeners
-
getPropertyListeners
List<PropertyListener<Object>> getPropertyListeners()Returns a list ofPropertyListener
s listening to all changes.- Returns:
- a list of listeners
-
addPropertyListener
-
removePropertyListener
-
getPropertyListeners
Returns a list ofPropertyListener
s listening to a givenProperty
.- Parameters:
prop
- theProperty
listened on- Returns:
- a list of listeners
-
hasListeners
Checks whether there arePropertyListener
s for a givenProperty
.- Returns:
true
if there are listeners for the given property
-
fireChanged
-