FileDocCategorySizeDatePackage
SMILSample.javaAPI DocphoneME MR2 API (J2ME)5535Wed May 02 18:00:34 BST 2007com.sun.perseus.model

SMILSample

public class SMILSample extends Object implements Runnable
SMILSample is the root of the SMIL Timing engine operation. This class simply samples the time graph at the current time where the current time is controlled by a Clock abstraction.
version
$Id: SMILSample.java,v 1.2 2006/04/21 06:38:28 st125089 Exp $

Fields Summary
protected DocumentNode
doc
The document on which sampling is done.
protected TimeContainerRootSupport
root
The root of the time graph to sample.
protected Time
currentTime
The time at which we are currently sampling.
protected Clock
clock
The clock used by this sampler to define the current document time.
Constructors Summary
public SMILSample(DocumentNode doc, Clock clock)
Builds a new time graph sampler which samples the time graph at the current real-world time.

param
doc the document, root of the time graph to sample. Should not be null. The DocumentNode's timeContainerRootSupport should not be null either.
param
clock the clock used to provide the current time. Should not be null.


                                                                             
       
                         
        if (doc == null || doc.timeContainerRootSupport == null) {
            throw new NullPointerException();
        }

        if (clock == null) {
            throw new NullPointerException();
        }
         
        this.doc = doc;
        this.root = doc.timeContainerRootSupport;
        this.clock = clock;
    
Methods Summary
public voidrun()
Runnable implementation.

        currentTime.value = clock.currentTimeMillis();
        doc.sample(currentTime);
        // System.err.println("\n\n\n");
        // root.dump();
        doc.applyAnimations();
        doc.applyMedia();