Package org.apache.batik.anim.timing
Class TimedDocumentRoot
- java.lang.Object
-
- org.apache.batik.anim.timing.TimedElement
-
- org.apache.batik.anim.timing.TimeContainer
-
- org.apache.batik.anim.timing.TimedDocumentRoot
-
- All Implemented Interfaces:
SMILConstants
- Direct Known Subclasses:
SVGAnimationEngine.AnimationRoot
public abstract class TimedDocumentRoot extends TimeContainer
An abstract base class for the root time container element for a document.- Version:
- $Id: TimedDocumentRoot.java 1804130 2017-08-04 14:41:11Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.CalendardocumentBeginTimeThe wallclock time that the document began.protected booleanisHyperlinkingWhether the document is currently being sampled for a hyperlink.protected booleanisSamplingWhether the document is currently being sampled.protected java.util.LinkedListlistenersList of {link TimegraphListener}s to be notified of changes to the timed elements in this document.protected DoublyIndexedSetpropagationFlagsA set to determine when propagation of new Instance times should be stopped.protected booleanuseSVG11AccessKeysAllows the use of accessKey() timing specifiers with a single character, as specified in SVG 1.1.protected booleanuseSVG12AccessKeysAllows the use of accessKey() timing specifiers with a DOM 3 key name, as specified in SVG 1.2.-
Fields inherited from class org.apache.batik.anim.timing.TimeContainer
children
-
Fields inherited from class org.apache.batik.anim.timing.TimedElement
beginDependents, beginInstanceTimes, beginTimes, currentInterval, currentRepeatIteration, durMedia, endDependents, endInstanceTimes, endTimes, FILL_FREEZE, FILL_REMOVE, fillMode, handledEvents, hasParsed, hasPropagated, INDEFINITE, isActive, isFrozen, lastIntervalEnd, lastRepeatTime, lastSampleTime, localizableSupport, max, maxMedia, min, minMedia, parent, previousInterval, repeatCount, repeatDur, repeatDuration, RESOURCES, RESTART_ALWAYS, RESTART_NEVER, RESTART_WHEN_NOT_ACTIVE, restartMode, root, shouldUpdateCurrentInterval, simpleDur, UNRESOLVED
-
Fields inherited from interface org.apache.batik.util.SMILConstants
SMIL_ACCUMULATE_ATTRIBUTE, SMIL_ADDITIVE_ATTRIBUTE, SMIL_ALWAYS_VALUE, SMIL_ANIMATE_COLOR_TAG, SMIL_ANIMATE_MOTION_TAG, SMIL_ANIMATE_TAG, SMIL_ATTRIBUTE_NAME_ATTRIBUTE, SMIL_ATTRIBUTE_TYPE_ATTRIBUTE, SMIL_AUTO_VALUE, SMIL_BEGIN_ATTRIBUTE, SMIL_BEGIN_DEFAULT_VALUE, SMIL_BEGIN_EVENT_NAME, SMIL_BY_ATTRIBUTE, SMIL_CALC_MODE_ATTRIBUTE, SMIL_CSS_VALUE, SMIL_DEFAULT_VALUE, SMIL_DISCRETE_VALUE, SMIL_DUR_ATTRIBUTE, SMIL_END_ATTRIBUTE, SMIL_END_EVENT_NAME, SMIL_FILL_ATTRIBUTE, SMIL_FREEZE_VALUE, SMIL_FROM_ATTRIBUTE, SMIL_HOLD_VALUE, SMIL_INDEFINITE_VALUE, SMIL_KEY_POINTS_ATTRIBUTE, SMIL_KEY_SPLINES_ATTRIBUTE, SMIL_KEY_TIMES_ATTRIBUTE, SMIL_LINEAR_VALUE, SMIL_MAX_ATTRIBUTE, SMIL_MEDIA_VALUE, SMIL_MIN_ATTRIBUTE, SMIL_NEVER_VALUE, SMIL_NONE_VALUE, SMIL_ORIGIN_ATTRIBUTE, SMIL_PACED_VALUE, SMIL_PATH_ATTRIBUTE, SMIL_REMOVE_VALUE, SMIL_REPEAT_COUNT_ATTRIBUTE, SMIL_REPEAT_DUR_ATTRIBUTE, SMIL_REPEAT_EVENT_ALT_NAME, SMIL_REPEAT_EVENT_NAME, SMIL_REPLACE_VALUE, SMIL_RESTART_ATTRIBUTE, SMIL_SET_TAG, SMIL_SPLINE_VALUE, SMIL_SUM_VALUE, SMIL_TO_ATTRIBUTE, SMIL_VALUES_ATTRIBUTE, SMIL_WHEN_NOT_ACTIVE_VALUE, SMIL_XML_VALUE
-
-
Constructor Summary
Constructors Constructor Description TimedDocumentRoot(boolean useSVG11AccessKeys, boolean useSVG12AccessKeys)Creates a new TimedDocumentRoot.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddTimegraphListener(TimegraphListener l)Adds aTimegraphListenerto the document.floatconvertEpochTime(long t)Converts an epoch time to document time.floatconvertWallclockTime(java.util.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.(package private) voidfireElementAdded(TimedElement e)Fires anTimegraphListener.elementAdded(org.apache.batik.anim.timing.TimedElement)event on all timegraph listeners.(package private) voidfireElementRemoved(TimedElement e)Fires anTimegraphListener.elementRemoved(org.apache.batik.anim.timing.TimedElement)event on all timegraph listeners.floatgetCurrentTime()Returns the last sampled document time.floatgetDefaultBegin(TimedElement child)Returns the default begin time for the given child timed element.java.util.CalendargetDocumentBeginTime()Returns the wallclock time that the document began.protected abstract java.lang.StringgetEventNamespaceURI(java.lang.String eventName)Returns the namespace URI of the event that corresponds to the given animation event name.protected abstract java.lang.StringgetEventType(java.lang.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 java.lang.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 aTimegraphListenerfrom the document.voidresetDocument(java.util.Calendar documentBeginTime)Resets the entire timegraph.floatseekTo(float time, boolean hyperlinking)Samples the entire timegraph at the given time.(package private) booleanshouldPropagate(Interval i, TimingSpecifier ts, boolean isBegin)Returns whether the specified newly createdIntervalshould propagate its times to the givenTimingSpecifier.-
Methods inherited from class org.apache.batik.anim.timing.TimeContainer
addChild, getChildren, isConstantAnimation, removeChild, reset, sampleAt, sampleChildren, setRoot
-
Methods inherited from class org.apache.batik.anim.timing.TimedElement
addDependent, addInstanceTime, beginElement, beginElement, canBegin, canEnd, computeInterval, createException, deinitialize, endElement, endElement, endHasEventConditions, eventOccurred, fireTimeEvent, fireTimeEvent, formatMessage, getActiveDur, getActiveTime, getAnimationEventTarget, getBeginTimingSpecifiers, getCurrentBeginTime, getElement, getEndTimingSpecifiers, getEventTargetById, getHyperlinkBeginTime, getLastSampleTime, getLocale, getRoot, getRootEventTarget, getSimpleDur, getSimpleTime, getTimedElementById, initialize, instanceTimeChanged, isBefore, isUnresolved, maxTime, minTime, minusTime, multiplyTime, notifyNewInterval, notifyRemoveInterval, parseAttributes, parseBegin, parseClockValue, parseDur, parseEnd, parseFill, parseMax, parseMin, parseRepeatCount, parseRepeatDur, parseRestart, removeDependent, removeFill, removeInstanceTime, sampledAt, sampledLastValue, selectNewInterval, setLocale, toActive, toInactive, toString
-
-
-
-
Field Detail
-
documentBeginTime
protected java.util.Calendar documentBeginTime
The wallclock time that the document began.
-
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.
-
propagationFlags
protected DoublyIndexedSet propagationFlags
A set to determine when propagation of new Instance times should be stopped.
-
listeners
protected java.util.LinkedList listeners
List of {link TimegraphListener}s to be notified of changes to the timed elements in this document.
-
isSampling
protected boolean isSampling
Whether the document is currently being sampled.
-
isHyperlinking
protected boolean isHyperlinking
Whether the document is currently being sampled for a hyperlink.
-
-
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 characteruseSVG12AccessKeys- allows the use of accessKey() with a DOM 3 key name
-
-
Method Detail
-
getImplicitDur
protected float getImplicitDur()
Returns the implicit duration of the element. The document root has anTimedElement.INDEFINITEimplicit duration.- Overrides:
getImplicitDurin classTimedElement
-
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'.- Specified by:
getDefaultBeginin classTimeContainer
-
getCurrentTime
public float getCurrentTime()
Returns the last sampled document time.
-
isSampling
public boolean isSampling()
Returns whether the document is currently being sampled.
-
isHyperlinking
public boolean isHyperlinking()
Returns whether the document is currently being sampled for a hyperlink.
-
seekTo
public float seekTo(float time, boolean hyperlinking)Samples the entire timegraph at the given time.
-
resetDocument
public void resetDocument(java.util.Calendar documentBeginTime)
Resets the entire timegraph.
-
getDocumentBeginTime
public java.util.Calendar getDocumentBeginTime()
Returns the wallclock time that the document began.
-
convertEpochTime
public float convertEpochTime(long t)
Converts an epoch time to document time.
-
convertWallclockTime
public float convertWallclockTime(java.util.Calendar time)
Converts a wallclock time to document time.
-
addTimegraphListener
public void addTimegraphListener(TimegraphListener l)
Adds aTimegraphListenerto the document.
-
removeTimegraphListener
public void removeTimegraphListener(TimegraphListener l)
Removes aTimegraphListenerfrom the document.
-
fireElementAdded
void fireElementAdded(TimedElement e)
Fires anTimegraphListener.elementAdded(org.apache.batik.anim.timing.TimedElement)event on all timegraph listeners.
-
fireElementRemoved
void fireElementRemoved(TimedElement e)
Fires anTimegraphListener.elementRemoved(org.apache.batik.anim.timing.TimedElement)event on all timegraph listeners.
-
shouldPropagate
boolean shouldPropagate(Interval i, TimingSpecifier ts, boolean isBegin)
Returns whether the specified newly createdIntervalshould propagate its times to the givenTimingSpecifier.- Parameters:
i- the Interval that has just been createdts- the TimingSpecifier that is a dependent of the IntervalisBegin- whether the dependency is on the begin or end time of the Interval
-
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.
-
getEventNamespaceURI
protected abstract java.lang.String getEventNamespaceURI(java.lang.String eventName)
Returns the namespace URI of the event that corresponds to the given animation event name.
-
getEventType
protected abstract java.lang.String getEventType(java.lang.String eventName)
Returns the type of the event that corresponds to the given animation event name.
-
getRepeatEventName
protected abstract java.lang.String getRepeatEventName()
Returns the name of the repeat event.- Returns:
- either "repeat" or "repeatEvent"
-
-