fi.hut.tml.xsmiles.mlfc.timesheet
Class TimesheetImpl

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.mlfc.timesheet.TimedElementImpl
                              extended byfi.hut.tml.xsmiles.mlfc.timesheet.TimesheetImpl
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Element, EventHandlerService, org.w3c.dom.events.EventTarget, InitializableElement, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.io.Serializable, StylableElement, TimedElement, org.w3c.dom.TypeInfo

public class TimesheetImpl
extends TimedElementImpl

This is the implementation of the timesheet root element. Every timesheet has only one instance of this class.

Since:
Feb 26, 2004
Version:
$Revision: 5573 $, $Date: 2004-10-14 14:02:49 +0300 (Thu, 14 Oct 2004) $
Author:
tjjalava
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class fi.hut.tml.xsmiles.mlfc.timesheet.TimedElementImpl
TimedElementImpl.Schedule
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
 
Fields inherited from class fi.hut.tml.xsmiles.mlfc.timesheet.TimedElementImpl
active, beginSchedule, childItems, currentTick, elementStarted, endSchedule, eventListener, eventTable, INFINITY, parent, paused, repeatCount, SELECT_FIRST, SELECT_LAST, SELECT_NEXT, SELECT_PREV, START_EVENT, START_SCHEDULED, STOP
 
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 fi.hut.tml.xsmiles.timesheet.TimedElement
BEGIN_ATTR, DURATION_ATTR, ELEMENT_BEGIN_EVENT, ELEMENT_END_EVENT, ELEMENT_NOT_PAUSED_EVENT, ELEMENT_PAUSED_EVENT, EXCL_ELEM, INDEFINITE_VALUE, ITEM_ELEM, PAR_ELEM, PREFETCH_ATTR, REPEAT_ATTR, SELECT_ATTR, SEQ_ELEM, TIMESHEET_ELEM
 
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
TimesheetImpl(TimeSheetMLFC mlfc, org.apache.xerces.dom.DocumentImpl owner, java.lang.String namespace, java.lang.String tag)
          Creates the root element implementation for the timesheet
 
Method Summary
protected  void addPauseListener(TimedElement elem)
          Informs the timesheet that the argument should know the changes in pause-state.
protected  void addPrefetchedMedia(MediaElement media)
          Informs the timesheet that the argument should be prefetched before the timing is started.
 void doPrefetch()
          Starts prefetching items that need to be prefetched.
protected  void doRepeat()
          Subclasses must implement this to handle the repeating
protected  void doStartElement()
          Subclasses must implement this to make it ready to be started
protected  void doStopElement()
          Subclasses must implement this to take care of all things needed for this element to stop
protected  void elementStarting(TimedElementImpl elem)
          Called by a child element of this element to notify that the child is going to start due to some dom event it was listening to.
protected  java.util.Hashtable getCache()
          Returns a Hashtable that is common to all the elements in current timesheet.
protected  boolean handleElementEnded(TimedElementImpl elem)
          Checks whether this element should take some specific action when a child element notifies it's going to end.
 void init()
          Initialize this element.
 void interruptPrefetch()
          Interrupts the current prefetch.
 void setEnabled(boolean enabled)
          Enables or disables the timesheet.
 void update()
          Called by the Timer instance of this element every tick.
 
Methods inherited from class fi.hut.tml.xsmiles.mlfc.timesheet.TimedElementImpl
activate, createEvent, doSetPaused, elementEnded, handleEvent, hasEventScheduled, isActive, isPaused, notifyEnd, notifyStart, parseRepeatCount, parseTimeAttribute, schedule, scheduleEnd, scheduleEvent, setActive, setEventListeners, setPaused, shouldRepeat, startElement, stopElement, toString, unSchedule
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, clone, clonePseudoElements, cloneSubtree, debugNode, debugNode, destroy, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getId, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getStyleAttrValue, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, initFinalFlattenedTree, initStyle, isInitedForReset, isPseudoClass, 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, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, 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, insertBefore, item, removeChild, replaceChild, 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 

Constructor Detail

TimesheetImpl

public TimesheetImpl(TimeSheetMLFC mlfc,
                     org.apache.xerces.dom.DocumentImpl owner,
                     java.lang.String namespace,
                     java.lang.String tag)
Creates the root element implementation for the timesheet

Parameters:
mlfc - owner MLFC
owner - the document of the timesheet
namespace -
tag -
Method Detail

init

public void init()
Description copied from class: XSmilesElementImpl
Initialize this element.

Specified by:
init in interface InitializableElement
Overrides:
init in class TimedElementImpl

doPrefetch

public void doPrefetch()
Starts prefetching items that need to be prefetched. This method hangs until all items are prefetched or interruptPrefetch()is called


interruptPrefetch

public void interruptPrefetch()
Interrupts the current prefetch. Causes doPrefetch()method to return immediately


addPauseListener

protected void addPauseListener(TimedElement elem)
Description copied from class: TimedElementImpl
Informs the timesheet that the argument should know the changes in pause-state.

Overrides:
addPauseListener in class TimedElementImpl
Parameters:
elem - TimedElement needing the pause information

getCache

protected java.util.Hashtable getCache()
Description copied from class: TimedElementImpl
Returns a Hashtable that is common to all the elements in current timesheet. Can be used to save information commonly needed.

Overrides:
getCache in class TimedElementImpl
Returns:
Hashtable

addPrefetchedMedia

protected void addPrefetchedMedia(MediaElement media)
Description copied from class: TimedElementImpl
Informs the timesheet that the argument should be prefetched before the timing is started.

Overrides:
addPrefetchedMedia in class TimedElementImpl
Parameters:
media - TimedElement needing prefetch

update

public void update()
Description copied from interface: TimedElement
Called by the Timer instance of this element every tick. Do all the actions corresponding to the current ticknumber here.

Specified by:
update in interface TimedElement
Overrides:
update in class TimedElementImpl

setEnabled

public void setEnabled(boolean enabled)
Description copied from class: TimedElementImpl
Enables or disables the timesheet. For timecontainers this method will recursively call the setEnabled-method of its children. The actual enabling/disabling happens in ItemImpl.

Overrides:
setEnabled in class TimedElementImpl
Parameters:
enabled -

doRepeat

protected void doRepeat()
Description copied from class: TimedElementImpl
Subclasses must implement this to handle the repeating

Specified by:
doRepeat in class TimedElementImpl

handleElementEnded

protected boolean handleElementEnded(TimedElementImpl elem)
Description copied from class: TimedElementImpl
Checks whether this element should take some specific action when a child element notifies it's going to end. If nothing special is needed to be done, the method should return false.

Specified by:
handleElementEnded in class TimedElementImpl
Parameters:
elem - the element that is about to end
Returns:
true if something special is done, false for the default action

doStartElement

protected void doStartElement()
Description copied from class: TimedElementImpl
Subclasses must implement this to make it ready to be started

Specified by:
doStartElement in class TimedElementImpl

doStopElement

protected void doStopElement()
Description copied from class: TimedElementImpl
Subclasses must implement this to take care of all things needed for this element to stop

Specified by:
doStopElement in class TimedElementImpl

elementStarting

protected void elementStarting(TimedElementImpl elem)
Description copied from class: TimedElementImpl
Called by a child element of this element to notify that the child is going to start due to some dom event it was listening to. Subclasses must implement this to handle the waking up of one of it's children

Specified by:
elementStarting in class TimedElementImpl
Parameters:
elem - the TimedElement that is starting


X-Smiles 1.2