fi.hut.tml.xsmiles.mlfc.smil.basic
Class ElementBasicTimeImpl

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.ElementImpl
                  extended byorg.apache.xerces.dom.ElementNSImpl
                      extended byfi.hut.tml.xsmiles.dom.XSmilesElementImpl
                          extended byfi.hut.tml.xsmiles.dom.VisualElementImpl
                              extended byfi.hut.tml.xsmiles.mlfc.smil.basic.SMILElementImpl
                                  extended byfi.hut.tml.xsmiles.mlfc.smil.basic.ElementTimeControlImpl
                                      extended byfi.hut.tml.xsmiles.mlfc.smil.basic.ElementBasicTimeImpl
All Implemented Interfaces:
java.lang.Cloneable, CSSStyleChangeListener, org.w3c.dom.Element, ElementTimeControl, org.w3c.dom.events.EventListener, org.w3c.dom.events.EventTarget, InitializableElement, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.io.Serializable, SMILElement, StylableElement, org.w3c.dom.TypeInfo, VisualElement, XElementBasicTime, XSmilesLayoutReference
Direct Known Subclasses:
ElementTimeImpl

public class ElementBasicTimeImpl
extends ElementTimeControlImpl
implements XElementBasicTime

This interface defines the set of basic timing attributes that are common to all timed elements.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
protected  long accActiveDuration
           
protected  long activateTime
           
protected  Time activeDuration
           
protected  long beginTime
           
protected  Time clipBeginTime
           
protected  Time currentIntervalBegin
           
protected  Time currentIntervalEnd
           
protected  long elementForceStartTime
           
protected  float manualRepeat
           
protected  Time previousIntervalBegin
           
protected  Time previousIntervalEnd
           
protected  int repeatIteration
           
protected  long repeatTime
           
protected  long startupTime
           
protected  int state
           
protected static int STATE_AFTERPLAY
           
protected static int STATE_DESTROYED
           
protected static int STATE_IDLE
           
protected static int STATE_PLAY
           
protected static int STATE_PREFETCHED
           
protected static int STATE_UNINIT
           
protected static int STATE_WAIT
           
protected static int TIMER_ACTIVATE
           
protected static int TIMER_DEACTIVATE
           
protected static int TIMER_SIMPLEDUR
           
protected static MyFloat zero
           
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.smil.basic.SMILElementImpl
smilDoc
 
Fields inherited from class fi.hut.tml.xsmiles.dom.VisualElementImpl
views
 
Fields inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
DESTROYED, elementStatus, INITIALIZED, INITIALIZING, setPseudoClasses, style, UNINITIALIZED, xblpropname
 
Fields inherited from class org.apache.xerces.dom.ElementNSImpl
localName, namespaceURI
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE, UNNORMALIZED
 
Fields inherited from interface org.w3c.dom.smil20.XElementBasicTime
RESTART_ALWAYS, RESTART_NEVER, RESTART_WHEN_NOT_ACTIVE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
protected ElementBasicTimeImpl(org.apache.xerces.dom.DocumentImpl owner, SMILDocumentImpl smil, java.lang.String ns, java.lang.String name)
           
 
Method Summary
 Time ACAdd(Time m1, Time m2)
          Addition/Substraction for active duration computation.
 void activate()
          ACTIVE DURATION START - playing an interval.
 void addIntervalBeginListener(Time time, ElementBasicTimeImpl dependent)
          Add a new begin interval changed listener.
 void addIntervalEndListener(Time time, ElementBasicTimeImpl dependent)
          Add a new end interval changed listener.
 void addNewIntervalListener(Time time, ElementBasicTimeImpl dependent)
          Add a new interval created listener.
 void addTime(boolean begin, TimeImpl time)
          Add a time to begin/end instance list
 boolean beginElement()
          Causes this element to begin the local timeline.
 boolean beginElementAt(int offset)
          Causes this element to begin the local timeline.
 void childEnded(long childDuration)
          This is called from the child to tell that it has ended.
 void closeChildren()
           
 void closedown()
          This closes this element.
protected  Time computeSimpleDuration()
          Define the simple duration.
 void deactivate()
          ACTIVE DURATION END / END OF INTERVAL / POST ACTIVE This is called to deactivate the element - after the active duration end has been reached.
protected  java.lang.String defaultBegin()
          Default begin value For media, par and seq this is 0s, for excl this is indefinite.
 void destroy()
          Close down this element immediately, if the presentation is playing.
 void display()
          Simple display for inherited elements.
 boolean endElement()
          Causes this element to end the local timeline (subject to sync constraints).
 boolean endElementAt(int offset)
          Causes this element to end the local timeline (subject to sync constraints).
 void freeze()
          Freeze the element - can be called if the parent ends its Simple Duration Pass through the call to all children
 java.lang.String getBegin()
          The desired value (as a list of times) of the begin instant of this node.
 TimeListImpl getBeginList()
          Get a begin time list
 Time getCurrentIntervalBegin()
          Get the current interval begin time.
 Time getCurrentIntervalEnd()
          Get the current interval end time.
 int getCurrentParentTime()
          Returns the current time in the parent time space.
 Time getDur()
          The desired simple duration value of this node in seconds.
 java.lang.String getEnd()
          The list of active ends for this node.
 TimeListImpl getEndList()
          Get an end time list
 java.lang.String getFill()
          Dummy getFill() method - this returns always null.
 Time getMax()
          The minimum play time for this element in milliseconds.
 Time getMin()
          The minimum play time for this element in milliseconds.
 MyFloat getRepeat()
          The repeat causes the element to play repeatedly (loop) for the specified duration in milliseconds.
 java.lang.String getRepeatCount()
          The repeatCount attribute causes the element to play repeatedly (loop) for the specified number of times.
 Time getRepeatDur()
          The repeatDur causes the element to play repeatedly (loop) for the specified duration in seconds.
 short getRestart()
          A code representing the value of the restart attribute, as defined above.
 int getState()
           
 org.w3c.dom.NodeList getTimeChildren()
          A NodeList that contains all timed childrens of this node.
 long getTimeInBodyTime(long t)
          Returns time in body time space,
 Time getTimeInParentTime(Time t)
           
 boolean hasStarted()
          Checks if this element has ever started.
protected  void immediateIntervalEnd(TimeImpl endtime)
          Ends current interval immediately notifying dependent elements.
 void init()
          Initialize this element.
 boolean isActive()
          Checks if this element is playing.
 boolean isChildStartable(ElementBasicTimeImpl child)
          Checks if this child is startable - i.e.
 boolean isResolved()
          Checks whether this element still has begin values in the future.
 boolean isStartable()
          Checks if this is startable - i.e.
 void mediaEnded()
          Callback method - called when the media has ended.
 void notifyBeginListeners(Time newBeginTime)
          Notify all begin interval changed listeners.
 void notifyEndListeners(Time newEndTime)
          Notify all end interval changed listeners.
 void notifyNewIntervalListeners()
          Notify all new interval listeners about the new interval.
 void prefetch()
          PREFETCH - prefetching the media This prefetches the element for playing.
 void reevaluateIntervalBegin(TimeImpl newBegin)
          Re-evaluates the current interval begin time.
 void reevaluateIntervalEnd(TimeImpl newEnd)
          Re-evaluates the current interval end time.
 void remove()
          Remove the element - can be called if the parent ends its Simple Duration Pass through the call to all children
 boolean removeFreeze()
           
 void repeat(long time)
          Repeat the element - if simpleDur ended or childEnded or mediaEnded.
 void repeatRemoveFreeze(long timeDur)
           
 void resolveSeekTime(ElementBasicTimeImpl child)
          HACK to resolve seek times for links.
 void restartelement()
           
 void restartelementparent()
           
 void setBegin(TimeList begin)
           
 void setCurrentIntervalBegin(Time b)
          Set the current interval begin time.
 void setCurrentIntervalEnd(Time e)
          Set the current interval end time.
 void setDur(java.lang.String dur)
           
 void setEnd(TimeList end)
           
 void setForceStartTime(long t)
          Set the element activation time.
 void setMax(Time max)
           
 void setMin(Time min)
           
 void setRepeat(MyFloat repeatDur)
           
 void setRepeatCount(java.lang.String repeatCount)
           
 void setRepeatDur(MyFloat repeatDur)
           
 void setRestart(short restart)
           
 void simpleDurEnded()
          This is called when simple duration for this element is ended.
 void startChildren()
           
 void startup()
          STARTUP - getting the first interval.
 boolean timeContainerHasEnded()
           
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.smil.basic.ElementTimeControlImpl
getShadowElement, getStyleAttrValue, getStyleString, pauseElement, resumeElement, seekElement
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.smil.basic.SMILElementImpl
dispatch, getAlt, getClassName, getId, getLongdesc, getOwnerDoc, getSMILDoc, getTitle, setAlt, setClassName, setId, setLongdesc, setTitle
 
Methods inherited from class fi.hut.tml.xsmiles.dom.VisualElementImpl
addView, belongsToTree, getViews, handleEvent, insertBefore, isCurrentlyVisible, isFocusPoint, isPseudoClass, isVisibleByCSSProperties, notifyPseudoRemoved, removeAllViews, removeAttribute, removeChild, replaceChild, setAttribute, setStatus, styleChanged, updateViews
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, clone, clonePseudoElements, cloneSubtree, debugNode, debugNode, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, initFinalFlattenedTree, initStyle, isInitedForReset, removeBinding, removeUndistributedChild, replaceNode, resetFinalFlattenedTree, resolveURI, searchElementWithId, searchElementWithId, setApplyBindingSheets, setAuthorSheets, setPseudoClass, setRuleNode, setStyle, updateStyle
 
Methods inherited from class org.apache.xerces.dom.ElementNSImpl
getBaseURI, getLocalName, getNamespaceURI, getPrefix, getTypeName, getTypeNamespace, setPrefix, setType, setValues
 
Methods inherited from class org.apache.xerces.dom.ElementImpl
cloneNode, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isEqualNode, normalize, reconcileDefaultAttributes, removeAttributeNode, removeAttributeNS, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setNodeValue, setUserData, setUserData, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.smil20.ElementTimeControl
pauseElement, resumeElement, seekElement
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.StylableElement
getRuleNode, getStyle, hasStyle, isPseudoClass, setRuleNode, setStyle
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.VisualElement
getStyle
 
Methods inherited from interface fi.hut.tml.xsmiles.dom.PseudoClassController
getPseudoClass, setPseudoClass
 

Field Detail

zero

protected static final MyFloat zero

currentIntervalBegin

protected Time currentIntervalBegin

currentIntervalEnd

protected Time currentIntervalEnd

previousIntervalBegin

protected Time previousIntervalBegin

previousIntervalEnd

protected Time previousIntervalEnd

state

protected int state

clipBeginTime

protected Time clipBeginTime

manualRepeat

protected float manualRepeat

repeatIteration

protected int repeatIteration

beginTime

protected long beginTime

repeatTime

protected long repeatTime

accActiveDuration

protected long accActiveDuration

activeDuration

protected Time activeDuration

startupTime

protected long startupTime

activateTime

protected long activateTime

elementForceStartTime

protected long elementForceStartTime

STATE_UNINIT

protected static final int STATE_UNINIT
See Also:
Constant Field Values

STATE_IDLE

protected static final int STATE_IDLE
See Also:
Constant Field Values

STATE_WAIT

protected static final int STATE_WAIT
See Also:
Constant Field Values

STATE_PLAY

protected static final int STATE_PLAY
See Also:
Constant Field Values

STATE_AFTERPLAY

protected static final int STATE_AFTERPLAY
See Also:
Constant Field Values

STATE_PREFETCHED

protected static final int STATE_PREFETCHED
See Also:
Constant Field Values

STATE_DESTROYED

protected static final int STATE_DESTROYED
See Also:
Constant Field Values

TIMER_ACTIVATE

protected static final int TIMER_ACTIVATE
See Also:
Constant Field Values

TIMER_DEACTIVATE

protected static final int TIMER_DEACTIVATE
See Also:
Constant Field Values

TIMER_SIMPLEDUR

protected static final int TIMER_SIMPLEDUR
See Also:
Constant Field Values
Constructor Detail

ElementBasicTimeImpl

protected ElementBasicTimeImpl(org.apache.xerces.dom.DocumentImpl owner,
                               SMILDocumentImpl smil,
                               java.lang.String ns,
                               java.lang.String name)
Method Detail

init

public void init()
Initialize this element.

Specified by:
init in interface SMILElement
Overrides:
init in class ElementTimeControlImpl

destroy

public void destroy()
Close down this element immediately, if the presentation is playing. This is required to get dynamic SMIL presentations.

Specified by:
destroy in interface XElementBasicTime
Overrides:
destroy in class ElementTimeControlImpl

prefetch

public void prefetch()
PREFETCH - prefetching the media This prefetches the element for playing. It set's the element to 'prefetched' state.

Specified by:
prefetch in interface XElementBasicTime

restartelementparent

public void restartelementparent()

restartelement

public void restartelement()

resolveSeekTime

public void resolveSeekTime(ElementBasicTimeImpl child)
HACK to resolve seek times for links.


startup

public void startup()
STARTUP - getting the first interval. This initializes the element for playing. It set's the element to 'wait' state. This method is called from the parent container, when its simple dur begins.

Specified by:
startup in interface XElementBasicTime

isStartable

public boolean isStartable()
Checks if this is startable - i.e. if the element's parent is active and if the parent is seq, that this element is the active child. This is used to prevent syncbased elements responding if not active. This will be overridden in body time container.


isChildStartable

public boolean isChildStartable(ElementBasicTimeImpl child)
Checks if this child is startable - i.e. if the child's parent is active and if the parent is seq, that this child is the active child. This is used to prevent syncbased elements responding if not active. This will be overridden in seq time container.


startChildren

public void startChildren()

closeChildren

public void closeChildren()

activate

public void activate()
ACTIVE DURATION START - playing an interval. This is called to activate the element - after begin time has been reached. This sets the element to 'play' state. TODO: If restart==RESTART_ALWAYS - create a next BeginTimer to restart the element. Question: Can it be taken into account in the ActiveDuration calculation?

Specified by:
activate in interface XElementBasicTime

display

public void display()
Simple display for inherited elements.


simpleDurEnded

public void simpleDurEnded()
This is called when simple duration for this element is ended. This repeats the media.


childEnded

public void childEnded(long childDuration)
This is called from the child to tell that it has ended. childEnded and activate may have to be synchronized - to allow starting all children before they are closed down. (in case of ad = 0)

Parameters:
childDuration - Duration of the child element

timeContainerHasEnded

public boolean timeContainerHasEnded()

mediaEnded

public void mediaEnded()
Callback method - called when the media has ended. This may cause the media to end its simple duration, if dur = "media" or dur = unspecified. The reason is that Simple Duration is first unresolved, and now it is resolved.


repeatRemoveFreeze

public void repeatRemoveFreeze(long timeDur)
Parameters:
timeDur - childDur / mediaDur
Returns:
REPEAT/REMOVE/FREEZE

removeFreeze

public boolean removeFreeze()
Returns:
REMOVE/FREEZE

repeat

public void repeat(long time)
Repeat the element - if simpleDur ended or childEnded or mediaEnded.


remove

public void remove()
Remove the element - can be called if the parent ends its Simple Duration Pass through the call to all children


freeze

public void freeze()
Freeze the element - can be called if the parent ends its Simple Duration Pass through the call to all children

Specified by:
freeze in interface XElementBasicTime

deactivate

public void deactivate()
ACTIVE DURATION END / END OF INTERVAL / POST ACTIVE This is called to deactivate the element - after the active duration end has been reached. This will search for the next interval and call activate() and set the element to 'fill' state.

Specified by:
deactivate in interface XElementBasicTime
Returns:
true if element is frozen, false if removed

closedown

public void closedown()
This closes this element. The element will not be active or show fill behaviour. It will be in 'idle' state. This method is called from the parent container, when its simple dur ends.

Specified by:
closedown in interface XElementBasicTime

setForceStartTime

public void setForceStartTime(long t)
Set the element activation time.

Parameters:
t - System time

getTimeInBodyTime

public long getTimeInBodyTime(long t)
Returns time in body time space,

Specified by:
getTimeInBodyTime in interface XElementBasicTime
Parameters:
t - Time to convert, in millisecs
Returns:
time in body time, in millisecs

getTimeInParentTime

public Time getTimeInParentTime(Time t)
Returns:
time in parent time

getTimeChildren

public org.w3c.dom.NodeList getTimeChildren()
A NodeList that contains all timed childrens of this node. If there are no timed children, the Nodelist is empty. An iterator is more appropriate here than a node list but it requires Traversal module support. Required method by SMIL-DOM. However, returns false answer.


getCurrentIntervalBegin

public Time getCurrentIntervalBegin()
Get the current interval begin time.

Specified by:
getCurrentIntervalBegin in interface XElementBasicTime
Returns:
Current interval begin time, in future or past, or unresolved or null

setCurrentIntervalBegin

public void setCurrentIntervalBegin(Time b)
Set the current interval begin time. If the begin time changes, the dependent elements will be notified of IntervalBeginChange.

Parameters:
b - New current interval begin time, in future or past, or unresolved or null

getCurrentIntervalEnd

public Time getCurrentIntervalEnd()
Get the current interval end time.

Returns:
Current interval end time, in future or past, or unresolved or null

setCurrentIntervalEnd

public void setCurrentIntervalEnd(Time e)
Set the current interval end time. If the end time changes, the dependent elements will be notified of IntervalEndChange.


getState

public int getState()

isActive

public boolean isActive()
Checks if this element is playing.

Specified by:
isActive in interface XElementBasicTime
Returns:
true if this element is active.

hasStarted

public boolean hasStarted()
Checks if this element has ever started. Note, restarting will cause the element to be not started. (?)

Specified by:
hasStarted in interface XElementBasicTime
Returns:
true if this element has ever started.

isResolved

public boolean isResolved()
Checks whether this element still has begin values in the future.

Returns:
true if more begin values in the future.

getBeginList

public TimeListImpl getBeginList()
Get a begin time list


getEndList

public TimeListImpl getEndList()
Get an end time list


addTime

public void addTime(boolean begin,
                    TimeImpl time)
Add a time to begin/end instance list


reevaluateIntervalBegin

public void reevaluateIntervalBegin(TimeImpl newBegin)
Re-evaluates the current interval begin time. The restart attribute will control this. In Basic profile, the element will restart ="always". Otherwise, the default value is restartDefault (which default value is "always").

If current interval is waiting to play, the element recalculates the begin and end times. If current interval is playing and a new begin instance time was added, then 1. if restart="never" then nothing will be done. 2. if restart="whenNotActive" then nothing will be done. 3. if restart="always" and the new instance time is between start and end times, then the element will restart and set a new interval


immediateIntervalEnd

protected void immediateIntervalEnd(TimeImpl endtime)
Ends current interval immediately notifying dependent elements.

Parameters:
endtime - This is the end time - sent by event or media end. Current Interval End will be endtime-10ms, to let possibly added event time to start.

reevaluateIntervalEnd

public void reevaluateIntervalEnd(TimeImpl newEnd)
Re-evaluates the current interval end time.
In Event Based timing, this method will be called only if the element is active.

Parameters:
newEnd - Proposed new currentIntervalEnd

addIntervalBeginListener

public void addIntervalBeginListener(Time time,
                                     ElementBasicTimeImpl dependent)
Add a new begin interval changed listener.

Parameters:
time - Time object, which has the syncbase clock value
dependent - The dependent element, which will be notified of changes

notifyBeginListeners

public void notifyBeginListeners(Time newBeginTime)
Notify all begin interval changed listeners.

Parameters:
newBeginTime - The new current interval begin time in this base element.

addIntervalEndListener

public void addIntervalEndListener(Time time,
                                   ElementBasicTimeImpl dependent)
Add a new end interval changed listener.

Parameters:
time - Time object, which has the syncbase clock value
dependent - The dependent element, which will be notified of changes

notifyEndListeners

public void notifyEndListeners(Time newEndTime)
Notify all end interval changed listeners.

Parameters:
newEndTime - The new current interval end time in this base element.

addNewIntervalListener

public void addNewIntervalListener(Time time,
                                   ElementBasicTimeImpl dependent)
Add a new interval created listener.

Parameters:
time - Time object, which has the syncbase clock value
dependent - The dependent element, which will be notified of changes

notifyNewIntervalListeners

public void notifyNewIntervalListeners()
Notify all new interval listeners about the new interval.


getCurrentParentTime

public int getCurrentParentTime()
Returns the current time in the parent time space. Valid only if the parent is active. (activate() has been called). In Seq Time Container, this will return the time since the startup() of this element.

Returns:
time from parent activate() in millisecs, except under seq time container.

ACAdd

public Time ACAdd(Time m1,
                  Time m2)
Addition/Substraction for active duration computation. value +/- value = value indefinite +/- value = indefinite indefinite +/- indefinite = indefinite unresolved +/- anything = unresolved


computeSimpleDuration

protected Time computeSimpleDuration()
Define the simple duration. This is based on the dur and other attributes. Based on the Simple Duration Table in the spec. MediaElement also checks the Simple Duration Table, when the media ends.

Returns:
Simple duration

defaultBegin

protected java.lang.String defaultBegin()
Default begin value For media, par and seq this is 0s, for excl this is indefinite.

Returns:
Time string

beginElement

public boolean beginElement()
                     throws org.w3c.dom.DOMException
Causes this element to begin the local timeline.

Specified by:
beginElement in interface ElementTimeControl
Overrides:
beginElement in class ElementTimeControlImpl
Returns:
true if the method call was successful and the element was begun. false if the method call failed, the element cannot be restarted.
Throws:
org.w3c.dom.DOMException - SYNTAX_ERR: The element was not defined with the appropriate syntax to allow beginElement calls.

beginElementAt

public boolean beginElementAt(int offset)
                       throws org.w3c.dom.DOMException
Causes this element to begin the local timeline.

Specified by:
beginElementAt in interface ElementTimeControl
Overrides:
beginElementAt in class ElementTimeControlImpl
Parameters:
offset - Time in seconds
Returns:
true if the method call was successful and the element was begun. false if the method call failed, the element cannot be restarted.
Throws:
org.w3c.dom.DOMException - SYNTAX_ERR: The element was not defined with the appropriate syntax to allow beginElement calls.

endElement

public boolean endElement()
                   throws org.w3c.dom.DOMException
Causes this element to end the local timeline (subject to sync constraints).

Specified by:
endElement in interface ElementTimeControl
Overrides:
endElement in class ElementTimeControlImpl
Returns:
true if the method call was successful and the element was ended. false if method call failed (the element is not active).
Throws:
org.w3c.dom.DOMException - SYNTAX_ERR: The element was not defined with the appropriate syntax to allow endElement calls.

endElementAt

public boolean endElementAt(int offset)
                     throws org.w3c.dom.DOMException
Causes this element to end the local timeline (subject to sync constraints).

Specified by:
endElementAt in interface ElementTimeControl
Overrides:
endElementAt in class ElementTimeControlImpl
Parameters:
offset - Time in seconds
Returns:
true if the method call was successful and the element was ended. false if method call failed (the element is not active).
Throws:
org.w3c.dom.DOMException - SYNTAX_ERR: The element was not defined with the appropriate syntax to allow endElement calls.

getBegin

public java.lang.String getBegin()
The desired value (as a list of times) of the begin instant of this node. If not found, default time 0s is returned.

Specified by:
getBegin in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setBegin

public void setBegin(TimeList begin)
              throws org.w3c.dom.DOMException
Specified by:
setBegin in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getEnd

public java.lang.String getEnd()
The list of active ends for this node.

Specified by:
getEnd in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setEnd

public void setEnd(TimeList end)
            throws org.w3c.dom.DOMException
Specified by:
setEnd in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getDur

public Time getDur()
The desired simple duration value of this node in seconds. Note that this returns a Time, not a String. Therefore, dur="media" is returned as null.

Specified by:
getDur in interface XElementBasicTime
Returns:
Time object, which can have a value, be indefinite or null. Null means unspecified.
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setDur

public void setDur(java.lang.String dur)
            throws org.w3c.dom.DOMException
Specified by:
setDur in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getRestart

public short getRestart()
A code representing the value of the restart attribute, as defined above. Default value is RESTART_ALWAYS .

Specified by:
getRestart in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setRestart

public void setRestart(short restart)
                throws org.w3c.dom.DOMException
Specified by:
setRestart in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getRepeatCount

public java.lang.String getRepeatCount()
The repeatCount attribute causes the element to play repeatedly (loop) for the specified number of times. A negative value repeat the element indefinitely. Default value is 0 (unspecified).

Specified by:
getRepeatCount in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setRepeatCount

public void setRepeatCount(java.lang.String repeatCount)
                    throws org.w3c.dom.DOMException
Specified by:
setRepeatCount in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getRepeatDur

public Time getRepeatDur()
The repeatDur causes the element to play repeatedly (loop) for the specified duration in seconds.

Specified by:
getRepeatDur in interface XElementBasicTime
Returns:
Time object, which can have a value, be indefinite or null. Null means unspecified.
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setRepeatDur

public void setRepeatDur(MyFloat repeatDur)
                  throws org.w3c.dom.DOMException
Specified by:
setRepeatDur in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getRepeat

public MyFloat getRepeat()
The repeat causes the element to play repeatedly (loop) for the specified duration in milliseconds.

Specified by:
getRepeat in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setRepeat

public void setRepeat(MyFloat repeatDur)
               throws org.w3c.dom.DOMException
Specified by:
setRepeat in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getMin

public Time getMin()
The minimum play time for this element in milliseconds. Negative means "indefinite".

Specified by:
getMin in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setMin

public void setMin(Time min)
            throws org.w3c.dom.DOMException
Specified by:
setMin in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getMax

public Time getMax()
The minimum play time for this element in milliseconds. Negative means "indefinite".

Specified by:
getMax in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setMax

public void setMax(Time max)
            throws org.w3c.dom.DOMException
Specified by:
setMax in interface XElementBasicTime
Throws:
org.w3c.dom.DOMException

getFill

public java.lang.String getFill()
Dummy getFill() method - this returns always null. To be overridden in inherited elements with a real implementation.



X-Smiles 1.2