Methods Summary |
---|
void | dispatchEndEvent(Time currentTime)Dispatches endEvent. As per the SMIL 2 specification, this dispatches
an endEvent for the resolved end time, not the observed end
time.
super.dispatchEndEvent(currentTime);
// Now, force children to end now. Before invoking children, we need
// to update the container's simpleTime.
long time = currentInterval.end.value - currentInterval.begin.value;
if (simpleDur.isResolved()) {
if (time > 0) {
time = time % simpleDur.value;
if (time == 0) {
time = simpleDur.value;
}
}
}
endChildrenAt(time);
|
void | dispatchOnNewInterval()Calls all the registered TimeDependent s so that they
are notified of a new TimeInterval creation. When a time container
creates a new interval, its children are re-initialized.
super.dispatchOnNewInterval();
// Now, re-initialize all children.
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child =
(TimedElementSupport) timedElementChildren.elementAt(i);
child.initialize();
}
|
void | dump()Traces this viewport tree
dump(this, "", System.err);
|
static void | dump(TimedElementSupport t, java.lang.String prefix, java.io.PrintStream out)Debug: traces the input ModelNode, using the input prefix
out.println(prefix + t);
if (t instanceof TimeContainerSupport) {
TimeContainerSupport tc = (TimeContainerSupport) t;
for (int i = 0; i < tc.timedElementChildren.size(); i++) {
TimedElementSupport c
= (TimedElementSupport) tc
.timedElementChildren.elementAt(i);
dump(c, prefix + "+--> ", out);
}
}
|
void | endChildrenAt(long time)Implementation helper. Ends all children at the requested input time.
setSimpleTime(time);
// First, end all children. Adding end times does not cause a state
// transition. To make the children transition to their new state, we
// invoke sample in a second iteration (see below).
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child
= (TimedElementSupport) timedElementChildren.elementAt(i);
child.end();
}
// Now, sample children on the end time
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child
= (TimedElementSupport) timedElementChildren.elementAt(i);
child.sample(simpleTime);
}
|
public Time | getSimpleTime()
return simpleTime;
|
protected void | initialize()Resets this container and all its children. This, in effect, moves the
container back to the begining of its timeline, i.e., prior to begining
the first interval.
super.initialize();
// If a new interval was created, children have already been initialized
// (see dispatchOnNewInterval). Otherwise, make sure we initialize the
// full tree.
if (currentInterval == null) {
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child
= (TimedElementSupport) timedElementChildren.elementAt(i);
child.initialize();
}
}
|
protected void | onStartingRepeat(int prevIter, int curIter)When a container starts a new iteration, it needs to:
- end its children at the end of the previous interval.
- reset its children.
// First, force ending children at the end of the previous iteration.
long time = currentInterval.begin.value
+
simpleDur.value * (prevIter + 1);
endChildrenAt(time);
// Now, reset the children so that they are ready for the next sampling
// at the begining of current interval.
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child =
(TimedElementSupport) timedElementChildren.elementAt(i);
child.initialize();
}
|
void | removeSyncBaseTimesUnder(com.sun.perseus.model.TimeContainerSupport syncTimeContainer)Removes all IntervalTimeInstance s in the begin and end
instance list if the syncBase is a descendant of syncTimeContainer
super.removeSyncBaseTimesUnder(syncTimeContainer);
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child =
(TimedElementSupport) timedElementChildren.elementAt(i);
child.removeSyncBaseTimesUnder(syncTimeContainer);
}
|
void | reset()When a container resets, it needs to clear all its children which have
IntervalTimeInstances on syncBases which are also children
(or descendants) of this container.
super.reset();
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child =
(TimedElementSupport) timedElementChildren.elementAt(i);
child.removeSyncBaseTimesUnder(this);
}
|
void | sampleAt(long simpleTime)Samples this time container at the given simple time.
setSimpleTime(simpleTime);
for (int i = 0; i < timedElementChildren.size(); i++) {
TimedElementSupport child
= (TimedElementSupport) timedElementChildren.elementAt(i);
if (seeking) {
child.seeking = true;
child.sample(this.simpleTime);
child.seeking = false;
} else {
child.sample(this.simpleTime);
}
}
|
void | setSimpleTime(long time)Implementation helper to set the simple time object.
if (simpleTime == Time.UNRESOLVED) {
simpleTime = new Time(time);
} else {
simpleTime.value = time;
}
|