org.apache.batik.anim.timing

Class TimedDocumentRoot

public abstract class TimedDocumentRoot extends TimeContainer

An abstract base class for the root time container element for a document.
Field Summary
protected CalendardocumentBeginTime
The wallclock time that the document began.
protected booleanisHyperlinking
Whether the document is currently being sampled for a hyperlink.
protected booleanisSampling
Whether the document is currently being sampled.
protected LinkedListlisteners
List of {link TimegraphListener}s to be notified of changes to the timed elements in this document.
protected DoublyIndexedSetpropagationFlags
A set to determine when propagation of new Instance times should be stopped.
protected booleanuseSVG11AccessKeys
Allows the use of accessKey() timing specifiers with a single character, as specified in SVG 1.1.
protected booleanuseSVG12AccessKeys
Allows the use of accessKey() timing specifiers with a DOM 3 key name, as specified in SVG 1.2.
Constructor Summary
TimedDocumentRoot(boolean useSVG11AccessKeys, boolean useSVG12AccessKeys)
Creates a new TimedDocumentRoot.
Method Summary
voidaddTimegraphListener(TimegraphListener l)
Adds a {@link TimegraphListener} to the document.
floatconvertEpochTime(long t)
Converts an epoch time to document time.
floatconvertWallclockTime(Calendar time)
Converts a wallclock time to document time.
protected voidcurrentIntervalWillUpdate()
Invoked by timed elements in this document to indicate that the current interval will be re-evaluated at the next sample.
floatgetCurrentTime()
Returns the last sampled document time.
floatgetDefaultBegin(TimedElement child)
Returns the default begin time for the given child timed element.
CalendargetDocumentBeginTime()
Returns the wallclock time that the document began.
protected abstract StringgetEventNamespaceURI(String eventName)
Returns the namespace URI of the event that corresponds to the given animation event name.
protected abstract StringgetEventType(String eventName)
Returns the type of the event that corresponds to the given animation event name.
protected floatgetImplicitDur()
Returns the implicit duration of the element.
protected abstract StringgetRepeatEventName()
Returns the name of the repeat event.
booleanisHyperlinking()
Returns whether the document is currently being sampled for a hyperlink.
booleanisSampling()
Returns whether the document is currently being sampled.
voidremoveTimegraphListener(TimegraphListener l)
Removes a {@link TimegraphListener} from the document.
voidresetDocument(Calendar documentBeginTime)
Resets the entire timegraph.
floatseekTo(float time, boolean hyperlinking)
Samples the entire timegraph at the given time.

Field Detail

documentBeginTime

protected Calendar documentBeginTime
The wallclock time that the document began.

isHyperlinking

protected boolean isHyperlinking
Whether the document is currently being sampled for a hyperlink.

isSampling

protected boolean isSampling
Whether the document is currently being sampled.

listeners

protected LinkedList listeners
List of {link TimegraphListener}s to be notified of changes to the timed elements in this document.

propagationFlags

protected DoublyIndexedSet propagationFlags
A set to determine when propagation of new Instance times should be stopped.

useSVG11AccessKeys

protected boolean useSVG11AccessKeys
Allows the use of accessKey() timing specifiers with a single character, as specified in SVG 1.1.

useSVG12AccessKeys

protected boolean useSVG12AccessKeys
Allows the use of accessKey() timing specifiers with a DOM 3 key name, as specified in SVG 1.2.

Constructor Detail

TimedDocumentRoot

public TimedDocumentRoot(boolean useSVG11AccessKeys, boolean useSVG12AccessKeys)
Creates a new TimedDocumentRoot.

Parameters: useSVG11AccessKeys allows the use of accessKey() timing specifiers with a single character useSVG12AccessKeys allows the use of accessKey() with a DOM 3 key name

Method Detail

addTimegraphListener

public void addTimegraphListener(TimegraphListener l)
Adds a {@link TimegraphListener} to the document.

convertEpochTime

public float convertEpochTime(long t)
Converts an epoch time to document time.

convertWallclockTime

public float convertWallclockTime(Calendar time)
Converts a wallclock time to document time.

currentIntervalWillUpdate

protected void currentIntervalWillUpdate()
Invoked by timed elements in this document to indicate that the current interval will be re-evaluated at the next sample. This should be overridden in a concrete class so that ticks can be scheduled immediately if they are currently paused due to no animations being active.

getCurrentTime

public float getCurrentTime()
Returns the last sampled document time.

getDefaultBegin

public float getDefaultBegin(TimedElement child)
Returns the default begin time for the given child timed element. In SVG, this is always 0, since the only time container is the root SVG element, which acts like a 'par'.

getDocumentBeginTime

public Calendar getDocumentBeginTime()
Returns the wallclock time that the document began.

getEventNamespaceURI

protected abstract String getEventNamespaceURI(String eventName)
Returns the namespace URI of the event that corresponds to the given animation event name.

getEventType

protected abstract String getEventType(String eventName)
Returns the type of the event that corresponds to the given animation event name.

getImplicitDur

protected float getImplicitDur()
Returns the implicit duration of the element. The document root has an {@link #INDEFINITE} implicit duration.

getRepeatEventName

protected abstract String getRepeatEventName()
Returns the name of the repeat event.

Returns: either "repeat" or "repeatEvent"

isHyperlinking

public boolean isHyperlinking()
Returns whether the document is currently being sampled for a hyperlink.

isSampling

public boolean isSampling()
Returns whether the document is currently being sampled.

removeTimegraphListener

public void removeTimegraphListener(TimegraphListener l)
Removes a {@link TimegraphListener} from the document.

resetDocument

public void resetDocument(Calendar documentBeginTime)
Resets the entire timegraph.

seekTo

public float seekTo(float time, boolean hyperlinking)
Samples the entire timegraph at the given time.
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.