Package VASSAL.property
Class AbstractPropertyContainer
java.lang.Object
VASSAL.property.AbstractPropertyContainer
- All Implemented Interfaces:
PropertyContainer
public abstract class AbstractPropertyContainer extends Object implements PropertyContainer
An abstract base class for
PropertyContainers.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Field Summary
Fields Modifier and Type Field Description protected PropertySupportps -
Constructor Summary
Constructors Constructor Description AbstractPropertyContainer()Creates anAbstractPropertyContainer.AbstractPropertyContainer(PropertySupport ps)Creates anAbstractPropertyContainer. -
Method Summary
Modifier and Type Method Description <T> voidaddPropertyListener(Property<T> prop, PropertyListener<? super T> l)Adds a listener for a specificProperty.voidaddPropertyListener(PropertyListener<Object> l)Adds a listener for all changes to this container.protected <T> voidfireChanged(Property<T> prop, T oldVal, T newVal)List<PropertyListener<Object>>getPropertyListeners()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.booleanhasListeners()Checks 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.voidremovePropertyListener(PropertyListener<Object> l)Removes a listner 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 listner 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
-