org.robokind.api.common.property
Class PropertyChangeMonitor
java.lang.Object
org.robokind.api.common.property.PropertyChangeMonitor
- All Implemented Interfaces:
- PropertyChangeListener, EventListener
public class PropertyChangeMonitor
- extends Object
- implements PropertyChangeListener
A support class for listening to PropertyChangeEvents. This class is
useful for class inheritance hierarchies which need to listen for property
change events.
This class holds property event names and property change actions.
When a property change event is received, all PropertyChangeActions
associated with the given event name will be fired in the order they were
added.
- Author:
- Matthew Stevenson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myPropertyActions
protected Map<String,List<PropertyChangeActionBase>> myPropertyActions
- A map associating PropertyChangeActions with an event name.
PropertyChangeMonitor
public PropertyChangeMonitor()
addAction
public void addAction(String property,
PropertyChangeActionBase action)
- Adds a PropertyChangeAction to be fired when an event with the given name
is found.
- Parameters:
property
- event name to listen foraction
- action to fire
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Fires all actions associated with the name of the given event.
- Specified by:
propertyChange
in interface PropertyChangeListener
- Parameters:
evt
- PropertyChangeEvent for the property being changed
Copyright © 2011. All Rights Reserved.