Class 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 Details

    • documentBeginTime

      protected 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 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 Details

    • 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 Details

    • getImplicitDur

      protected float getImplicitDur()
      Returns the implicit duration of the element. The document root has an TimedElement.INDEFINITE implicit duration.
      Overrides:
      getImplicitDur in class TimedElement
    • 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:
      getDefaultBegin in class TimeContainer
    • 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(Calendar documentBeginTime)
      Resets the entire timegraph.
    • getDocumentBeginTime

      public 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(Calendar time)
      Converts a wallclock time to document time.
    • addTimegraphListener

      public void addTimegraphListener(TimegraphListener l)
      Adds a TimegraphListener to the document.
    • removeTimegraphListener

      public void removeTimegraphListener(TimegraphListener l)
      Removes a TimegraphListener from the document.
    • fireElementAdded

      void fireElementAdded(TimedElement e)
    • fireElementRemoved

      void fireElementRemoved(TimedElement e)
    • shouldPropagate

      boolean shouldPropagate(Interval i, TimingSpecifier ts, boolean isBegin)
      Returns whether the specified newly created Interval should propagate its times to the given TimingSpecifier.
      Parameters:
      i - the Interval that has just been created
      ts - the TimingSpecifier that is a dependent of the Interval
      isBegin - 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 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.
    • getRepeatEventName

      protected abstract String getRepeatEventName()
      Returns the name of the repeat event.
      Returns:
      either "repeat" or "repeatEvent"