Package VASSAL.property
Class AbstractPropertyContainer
java.lang.Object
VASSAL.property.AbstractPropertyContainer
- All Implemented Interfaces:
PropertyContainer
An abstract base class for
PropertyContainers.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates anAbstractPropertyContainer.Creates anAbstractPropertyContainer. -
Method Summary
Modifier and TypeMethodDescription<T> voidaddPropertyListener(Property<T> prop, PropertyListener<? super T> l) Adds a listener for a specificProperty.voidAdds a listener for all changes to this container.protected <T> voidfireChanged(Property<T> prop, T oldVal, T newVal) Returns a list ofPropertyListeners listening to all changes to this container.<T> List<PropertyListener<? super T>> getPropertyListeners(Property<T> prop) Returns a list ofPropertyListeners listening to a givenProperty.booleanChecks whether there arePropertyListeners for all changes to this container.<T> booleanhasListeners(Property<T> prop) Checks whether there arePropertyListeners for a givenProperty.<T> voidremovePropertyListener(Property<T> prop, PropertyListener<? super T> l) Removes a listener for a specificProperty.voidRemoves a listener for all changes to this container.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface VASSAL.property.PropertyContainer
getProperties, getValue, setValue
-
Field Details
-
ps
-
-
Constructor Details
-
AbstractPropertyContainer
public AbstractPropertyContainer()Creates anAbstractPropertyContainer. -
AbstractPropertyContainer
Creates anAbstractPropertyContainer.- Parameters:
ps- thePropertySupport
-
-
Method Details
-
addPropertyListener
Adds a listener for all changes to this container.- Specified by:
addPropertyListenerin interfacePropertyContainer- Parameters:
l- the listener to add
-
addPropertyListener
Adds a listener for a specificProperty.- Specified by:
addPropertyListenerin interfacePropertyContainer- Parameters:
prop- thePropertyto listen onl- the listener to add
-
removePropertyListener
Removes a listener for all changes to this container.- Specified by:
removePropertyListenerin interfacePropertyContainer- Parameters:
l- the listener to remove
-
removePropertyListener
Removes a listener for a specificProperty.- Specified by:
removePropertyListenerin interfacePropertyContainer- Parameters:
prop- thePropertylistened onl- the listener to remove
-
getPropertyListeners
Returns a list ofPropertyListeners listening to all changes to this container.- Specified by:
getPropertyListenersin interfacePropertyContainer- Returns:
- a list of listeners
-
getPropertyListeners
Returns a list ofPropertyListeners listening to a givenProperty.- Specified by:
getPropertyListenersin interfacePropertyContainer- Parameters:
prop- thePropertylistened on- Returns:
- a list of listeners
-
hasListeners
public boolean hasListeners()Checks whether there arePropertyListeners for all changes to this container.- Specified by:
hasListenersin interfacePropertyContainer- Returns:
trueif there are listeners
-
hasListeners
Checks whether there arePropertyListeners for a givenProperty.- Specified by:
hasListenersin interfacePropertyContainer- Returns:
trueif there are listeners for the given property
-
fireChanged
-