com.guiseframework.model
Class ValuePolicyModelGroup<V>

java.lang.Object
  extended by com.guiseframework.model.AbstractModelGroup<ValueModel<V>>
      extended by com.guiseframework.model.ValuePolicyModelGroup<V>
Type Parameters:
V - The type of value contained in the value model.
All Implemented Interfaces:
com.globalmentor.beans.GenericPropertyChangeListener<V>, ModelGroup<ValueModel<V>>, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
MutualExclusionPolicyModelGroup

public abstract class ValuePolicyModelGroup<V>
extends AbstractModelGroup<ValueModel<V>>
implements com.globalmentor.beans.GenericPropertyChangeListener<V>

An abstract implementation of a group of value models implementing a value policy across several models, such as mutual exclusion. When value models are added to the list, the group adds itself as a property value change listeners to the model, listening for changes in the value.

Author:
Garret Wilson.
See Also:
ValueModel

Constructor Summary
ValuePolicyModelGroup(ValueModel<V>... models)
          Model constructor.
 
Method Summary
protected  void addImpl(ValueModel<V> valueModel)
          Actual implementation of adding a model to the group.
 void propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
          Called when a bound property is changed.
protected  void removeImpl(ValueModel<V> valueModel)
          Actual implementation of removing a model from the group.
 
Methods inherited from class com.guiseframework.model.AbstractModelGroup
add, contains, getModelSet, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.globalmentor.beans.GenericPropertyChangeListener
propertyChange
 

Constructor Detail

ValuePolicyModelGroup

public ValuePolicyModelGroup(ValueModel<V>... models)
Model constructor.

Parameters:
models - Zero or more models with which to initially place in the group.
Throws:
java.lang.NullPointerException - if one of the models is null.
Method Detail

addImpl

protected void addImpl(ValueModel<V> valueModel)
Actual implementation of adding a model to the group. This version adds this class instance as a listener to the model's value changing.

Overrides:
addImpl in class AbstractModelGroup<ValueModel<V>>
Parameters:
valueModel - The model to add to the group.

removeImpl

protected void removeImpl(ValueModel<V> valueModel)
Actual implementation of removing a model from the group. This version removes this class instance as a listener to the model's value changing.

Overrides:
removeImpl in class AbstractModelGroup<ValueModel<V>>
Parameters:
valueModel - The model to remove from the group.

propertyChange

public final void propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Called when a bound property is changed. This not-generics version calls the generic version, creating a new event if necessary. No checks are made at compile time to ensure the given event actually supports the given generic type.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
propertyChangeEvent - An event object describing the event source, the property that has changed, and its old and new values.
See Also:
GenericPropertyChangeListener.propertyChange(GenericPropertyChangeEvent)


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.