Interface ElementTimeControl
-
- All Known Subinterfaces:
SVGAnimateColorElement,SVGAnimateElement,SVGAnimateMotionElement,SVGAnimateTransformElement,SVGAnimationElement,SVGSetElement
public interface ElementTimeControlSMILAnimation supports several methods for controlling the behavior of animation:
beginElement()andendElement(), et al. These methods are used to begin and end an animation that has declared the timing to respond to the DOM, using the following syntax:<animate begin="indefinite" end="indefinite" .../>
Note that only one of
beginorendneed be specified - either or both can be used. ThebeginElement()andbeginElementAt()methods must do nothing if the animation is not explicitly set with thebegin="indefinite"syntax above. TheendElement()andendElementAt()methods must do nothing if the animation is not explicitly set with theend="indefinite"syntax above.Calling
beginElement()causes the animation to begin in much the same way that an animation with event-based begin timing begins. The effective begin time is the current presentation time at the time of the DOM method call. Note thatbeginElement()is subject to therestartattribute in the same manner that event-based begin timing is. If an animation is specified to disallow restarting at a given point,beginElement()methods calls must fail. Refer also to the section Restarting animations.Calling
beginElementAt()has the same effect asbeginElement(), except that the effective begin time is offset from the current presentation time by an amount specified as a parameter. Passing a negative value for the offset causes the element to begin as forbeginElement(), but has the effect that the element begins at the specified offset into its active duration. ThebeginElementAt()method must also respect therestartattribute. The restart semantics for abeginElementAt()method call are evaluated at the time of the method call, and not at the effective begin time specified by the offset parameter.Calling
endElement()causes an animation to end the active duration, just asenddoes. Depending upon the value of thefillattribute, the animation effect may no longer be applied, or it may be frozen at the current effect. Refer also to the section Freezing animations. If an animation is not currently active (i.e. if it has not yet begun or if it is frozen), theendElement()method will fail.Calling
endElementAt()causes an animation to end the active duration, just asendElement()does, but allows the caller to specify a positive offset, to cause the element to end at a point in the future. Other than delaying when the end actually happens, the semantics are identical to those forendElement(). IfendElementAt()is called more than once while an element is active, the end time specified by the last method call will determine the end behavior.The expectation of the following interface is that an instance of the ElementTimeControl interface can be obtained by using binding-specific casting methods on an instance of an animate element. A DOM application can use the
hasFeaturemethod of the DOMImplementation interface to determine whether theElementTimeControlinterface is supported or not. The feature string for this interface is"TimeControl".- See Also:
- SMIL Animation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanbeginElement()Causes this element to begin the local timeline (subject to restart constraints).booleanbeginElementAt(float offset)Causes this element to begin the local timeline (subject to restart constraints), at the passed offset from the current time when the method is called.booleanendElement()Causes this element to end the local timeline.booleanendElementAt(float offset)Causes this element to end the local timeline at the specified offset from the current time when the method is called
-
-
-
Method Detail
-
beginElement
boolean beginElement() throws DOMExceptionCauses this element to begin the local timeline (subject to restart constraints).- Returns:
trueif the method call was successful and the element was begun.falseif the method call failed. Possible reasons for failure include:- The element does not support the
beginElementmethod. Thebeginattribute is not set to"indefinite". - The element is already active and cannot be restarted when it is
active. The
restartattribute is set to"whenNotActive". - The element is active or has been active and cannot be
restarted. The
restartattribute is set to"never".
- The element does not support the
- Throws:
DOMException
-
beginElementAt
boolean beginElementAt(float offset) throws DOMExceptionCauses this element to begin the local timeline (subject to restart constraints), at the passed offset from the current time when the method is called. If the offset is >= 0, the semantics are equivalent to an event-base begin with the specified offset. If the offset is < 0, the semantics are equivalent to beginElement(), but the element active duration is evaluated as though the element had begun at the passed (negative) offset from the current time when the method is called.- Parameters:
offset- The offset in seconds at which to begin the element.- Returns:
trueif the method call was successful and the element was begun.falseif the method call failed. Possible reasons for failure include:- The element does not support the
beginElementAtmethod. Thebeginattribute is not set to"indefinite". - The element is already active and cannot be
restarted when it is active. The
restartattribute is set to"whenNotActive". - The element is active or has been active and
cannot be restarted. The
restartattribute is set to"never".
- The element does not support the
- Throws:
DOMException
-
endElement
boolean endElement() throws DOMExceptionCauses this element to end the local timeline.- Returns:
trueif the method call was successful and the element was ended.falseif method call failed. Possible reasons for failure include:- The element does not support the
endElementmethod. Theendattribute is not set to"indefinite". - The element is not active.
- The element does not support the
- Throws:
DOMException
-
endElementAt
boolean endElementAt(float offset) throws DOMExceptionCauses this element to end the local timeline at the specified offset from the current time when the method is called- Parameters:
offset- The offset in seconds at which to end the element. Must be>= 0.- Returns:
trueif the method call was successful and the element was ended.falseif method call failed. Possible reasons for failure include:- The element does not support the
endElementAtmethod. Theendattribute is not set to"indefinite". - The element is not active.
- The element does not support the
- Throws:
DOMException
-
-