String localName = (String) e2.getKey2();
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.shouldUpdate ||
sandwich.animation != null
&& sandwich.animation.isDirty) {
AnimatableValue av = null;
boolean usesUnderlying = false;
AbstractAnimation anim = sandwich.animation;
if (anim != null) {
av = anim.getComposedValue();
usesUnderlying =
sandwich.lowestAnimation.usesUnderlyingValue();
anim.isDirty = false;
}
if (usesUnderlying && !sandwich.listenerRegistered) {
target.addTargetListener(namespaceURI, localName, false,
targetListener);
sandwich.listenerRegistered = true;
} else if (!usesUnderlying && sandwich.listenerRegistered) {
target.removeTargetListener(namespaceURI, localName,
false, targetListener);
sandwich.listenerRegistered = false;
}
target.updateAttributeValue(namespaceURI, localName, av);
sandwich.shouldUpdate = false;
}
}
// Update the CSS animations.
j = info.cssAnimations.entrySet().iterator();
while (j.hasNext()) {
Map.Entry e2 = (Map.Entry) j.next();
String propertyName = (String) e2.getKey();
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.shouldUpdate ||
sandwich.animation != null
&& sandwich.animation.isDirty) {
AnimatableValue av = null;
boolean usesUnderlying = false;
AbstractAnimation anim = sandwich.animation;
if (anim != null) {
av = anim.getComposedValue();
usesUnderlying =
sandwich.lowestAnimation.usesUnderlyingValue();
anim.isDirty = false;
}
if (usesUnderlying && !sandwich.listenerRegistered) {
target.addTargetListener(null, propertyName, true,
targetListener);
sandwich.listenerRegistered = true;
} else if (!usesUnderlying && sandwich.listenerRegistered) {
target.removeTargetListener(null, propertyName, true,
targetListener);
sandwich.listenerRegistered = false;
}
if (usesUnderlying) {
target.updatePropertyValue(propertyName, null);
}
if (!(usesUnderlying && av == null)) {
target.updatePropertyValue(propertyName, av);
}
sandwich.shouldUpdate = false;
}
}
// Update the other animations.
j = info.otherAnimations.entrySet().iterator();
while (j.hasNext()) {
Map.Entry e2 = (Map.Entry) j.next();
String type = (String) e2.getKey();
Sandwich sandwich = (Sandwich) e2.getValue();
if (sandwich.shouldUpdate || sandwich.animation.isDirty) {
AnimatableValue av = null;
AbstractAnimation anim = sandwich.animation;
if (anim != null) {
av = sandwich.animation.getComposedValue();
anim.isDirty = false;
}