float waitTime = timedDocumentRoot.seekTo(time, hyperlinking);
Map.Entry[] targetEntries =
(Map.Entry[]) targets.entrySet().toArray(MAP_ENTRY_ARRAY);
for (int i = 0; i < targetEntries.length; i++) {
Map.Entry e = targetEntries[i];
AnimationTarget target = (AnimationTarget) e.getKey();
TargetInfo info = (TargetInfo) e.getValue();
// Update the XML animations.
Iterator j = info.xmlAnimations.iterator();
while (j.hasNext()) {
DoublyIndexedTable.Entry e2 =
(DoublyIndexedTable.Entry) j.next();
String namespaceURI = (String) e2.getKey1();
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;
}
target.updateOtherValue(type, av);
sandwich.shouldUpdate = false;
}
}
}
return waitTime;