Class AbstractPropertyContainer
java.lang.Object
VASSAL.property.AbstractPropertyContainer
- All Implemented Interfaces:
PropertyContainer
An abstract base class for
PropertyContainer
s.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates anAbstractPropertyContainer
.Creates anAbstractPropertyContainer
. -
Method Summary
Modifier and TypeMethodDescription<T> void
addPropertyListener
(Property<T> prop, PropertyListener<? super T> l) Adds a listener for a specificProperty
.void
Adds a listener for all changes to this container.protected <T> void
fireChanged
(Property<T> prop, T oldVal, T newVal) Returns a list ofPropertyListener
s listening to all changes to this container.<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 to this container.<T> boolean
hasListeners
(Property<T> prop) Checks whether there arePropertyListener
s for a givenProperty
.<T> void
removePropertyListener
(Property<T> prop, PropertyListener<? super T> l) Removes a listener for a specificProperty
.void
Removes 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, wait
Methods 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:
addPropertyListener
in interfacePropertyContainer
- Parameters:
l
- the listener to add
-
addPropertyListener
Adds a listener for a specificProperty
.- Specified by:
addPropertyListener
in interfacePropertyContainer
- Parameters:
prop
- theProperty
to listen onl
- the listener to add
-
removePropertyListener
Removes a listener for all changes to this container.- Specified by:
removePropertyListener
in interfacePropertyContainer
- Parameters:
l
- the listener to remove
-
removePropertyListener
Removes a listener for a specificProperty
.- Specified by:
removePropertyListener
in interfacePropertyContainer
- Parameters:
prop
- theProperty
listened onl
- the listener to remove
-
getPropertyListeners
Returns a list ofPropertyListener
s listening to all changes to this container.- Specified by:
getPropertyListeners
in interfacePropertyContainer
- Returns:
- a list of listeners
-
getPropertyListeners
Returns a list ofPropertyListener
s listening to a givenProperty
.- Specified by:
getPropertyListeners
in interfacePropertyContainer
- Parameters:
prop
- theProperty
listened on- Returns:
- a list of listeners
-
hasListeners
public boolean hasListeners()Checks whether there arePropertyListener
s for all changes to this container.- Specified by:
hasListeners
in interfacePropertyContainer
- Returns:
true
if there are listeners
-
hasListeners
Checks whether there arePropertyListener
s for a givenProperty
.- Specified by:
hasListeners
in interfacePropertyContainer
- Returns:
true
if there are listeners for the given property
-
fireChanged
-