|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.xerces.dom.NodeImpl
org.apache.xerces.dom.ChildNode
org.apache.xerces.dom.ParentNode
org.apache.xerces.dom.ElementImpl
org.apache.xerces.dom.ElementNSImpl
fi.hut.tml.xsmiles.dom.XSmilesElementImpl
fi.hut.tml.xsmiles.mlfc.timesheet.TimedElementImpl
Implementation of the Timesheets. Subclasses of this class implement all the timesheet elements in the document.
| Nested Class Summary | |
protected class |
TimedElementImpl.Schedule
Inner class that holds all the information for this element's start or stop scheduling |
| Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl |
XSmilesElementImpl.PseudoNodeList |
| Field Summary | |
protected boolean |
active
The current active state of this TimedElement instance |
protected TimedElementImpl.Schedule |
beginSchedule
Holds the information of when this element is to be started |
protected java.util.Vector |
childItems
All children of this element that are instances of TimedElement. |
protected long |
currentTick
Current time |
protected boolean |
elementStarted
The status of this TimedElement, whether it is started or not |
protected TimedElementImpl.Schedule |
endSchedule
Holds the information of when this element is to be stopped |
protected fi.hut.tml.xsmiles.mlfc.timesheet.TimesheetEventListener |
eventListener
The event listener of this TimedElement |
protected TimedEventTable |
eventTable
Event table for start and end events of the children of this TimedElement |
protected static int |
INFINITY
Value used for repeat count when repeat attribute is infinite |
protected TimedElementImpl |
parent
The parent element of this TimedElement. |
protected boolean |
paused
Is this instance paused |
protected int |
repeatCount
The value of repeat attribute |
static java.lang.String |
SELECT_FIRST
|
static java.lang.String |
SELECT_LAST
|
static java.lang.String |
SELECT_NEXT
|
static java.lang.String |
SELECT_PREV
|
static int |
START_EVENT
|
static int |
START_SCHEDULED
Event code for the TimedEvent START_SCHEDULED command |
static int |
STOP
Event code for the TimedEvent STOP command |
| 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 | |
protected |
TimedElementImpl(org.apache.xerces.dom.DocumentImpl owner,
java.lang.String namespace,
java.lang.String tag)
Creates a new TimedElement instance. |
| Method Summary | |
void |
activate(org.w3c.dom.events.Event evt)
Activate this element |
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. |
protected static org.w3c.dom.events.Event |
createEvent(java.lang.String event)
Creates a new dom event. |
protected abstract void |
doRepeat()
Subclasses must implement this to handle the repeating |
protected void |
doSetPaused()
Subclasses should implement this method for the actions caused by the change in pause status |
protected abstract void |
doStartElement()
Subclasses must implement this to make it ready to be started |
protected abstract void |
doStopElement()
Subclasses must implement this to take care of all things needed for this element to stop |
protected void |
elementEnded(TimedElementImpl elem)
Informs this TimedElement instance that the argument has ended |
protected abstract 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 abstract boolean |
handleElementEnded(TimedElementImpl elem)
Checks whether this element should take some specific action when a child element notifies it's going to end. |
protected void |
handleEvent(org.w3c.dom.events.Event evt)
Handle the DOMEvent targeted to this element. |
protected boolean |
hasEventScheduled(int event)
|
void |
init()
Initialize this element. |
boolean |
isActive()
Is element active right now |
boolean |
isPaused()
Is element paused right now |
protected void |
notifyEnd()
Notifies the parent element that this element is about to end |
protected void |
notifyStart()
Notifies the parent element that this element is about to start |
protected static int |
parseRepeatCount(TimedElementImpl elem)
Parses the repeat count of the argument |
protected TimedElementImpl.Schedule |
parseTimeAttribute(java.lang.String attr)
Parses the attribute containing schedule information of this element, ie. |
void |
schedule()
Schedules the element, sets the time when the element should be set active. |
protected void |
scheduleEnd()
Schedule the time when this element should stop |
protected void |
scheduleEvent(long tick,
int event)
Schedules a new event. |
void |
setActive(boolean active)
Sets the element active or non-active. |
void |
setEnabled(boolean enabled)
Enables or disables the timesheet. |
protected void |
setEventListeners()
Sets this element to listen to the selected custom DOMEvents. |
void |
setPaused(boolean paused)
Sets the pause status of the element |
protected boolean |
shouldRepeat()
Should this element still repeat itself |
protected void |
startElement()
Called by the Timer thread when eventTable has START_SCHEDULED event scheduled for the argument on current update round. |
protected void |
stopElement()
Called by the Timer thread when eventTable has STOP event scheduled for the argument on current update round. |
java.lang.String |
toString()
|
protected void |
unSchedule()
Unschedules all the children of this element and clears the event table |
void |
update()
Called by the Timer instance of this element every tick. |
| 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 |
| Field Detail |
public static final int START_SCHEDULED
public static final int START_EVENT
public static final int STOP
public static final java.lang.String SELECT_NEXT
public static final java.lang.String SELECT_PREV
public static final java.lang.String SELECT_FIRST
public static final java.lang.String SELECT_LAST
protected static final int INFINITY
protected boolean active
protected TimedEventTable eventTable
protected long currentTick
protected boolean paused
protected TimedElementImpl parent
protected int repeatCount
repeat attribute
protected boolean elementStarted
protected TimedElementImpl.Schedule beginSchedule
protected TimedElementImpl.Schedule endSchedule
protected java.util.Vector childItems
protected fi.hut.tml.xsmiles.mlfc.timesheet.TimesheetEventListener eventListener
| Constructor Detail |
protected TimedElementImpl(org.apache.xerces.dom.DocumentImpl owner,
java.lang.String namespace,
java.lang.String tag)
| Method Detail |
protected static int parseRepeatCount(TimedElementImpl elem)
elem - the element which repeat count is to be parsed
protected TimedElementImpl.Schedule parseTimeAttribute(java.lang.String attr)
throws java.lang.NumberFormatException
begin or dur attributes
attr - the value of the attribute
Schedule containing all the scheduling information of the attribute
java.lang.NumberFormatException - if attribute cannot be parsedprotected static org.w3c.dom.events.Event createEvent(java.lang.String event)
event - the type of event
protected abstract void doRepeat()
protected abstract void elementStarting(TimedElementImpl elem)
elem - the TimedElement that is startingprotected abstract void doStartElement()
protected abstract void doStopElement()
protected abstract boolean handleElementEnded(TimedElementImpl elem)
elem - the element that is about to end
true if something special is done, false for the default actionprotected void setEventListeners()
protected void handleEvent(org.w3c.dom.events.Event evt)
evt - the catched DOM eventprotected final void elementEnded(TimedElementImpl elem)
elem - the element instance that has endedprotected final void startElement()
protected final void stopElement()
protected void doSetPaused()
protected void addPauseListener(TimedElement elem)
elem - TimedElement needing the pause informationprotected java.util.Hashtable getCache()
protected void addPrefetchedMedia(MediaElement media)
media - TimedElement needing prefetch
protected void scheduleEvent(long tick,
int event)
tick - time when event should happenevent - the event code, from TimedElementinterfaceprotected void unSchedule()
protected void notifyStart()
protected void notifyEnd()
protected void scheduleEnd()
protected boolean shouldRepeat()
true if repeat count is still more that zeroprotected boolean hasEventScheduled(int event)
public void init()
XSmilesElementImpl
init in interface InitializableElementinit in class XSmilesElementImplpublic final void setActive(boolean active)
active - true to set element active, false otherwisepublic final void setPaused(boolean paused)
paused - pause statuspublic void setEnabled(boolean enabled)
ItemImpl.
enabled - public boolean isActive()
public void schedule()
public boolean isPaused()
public void update()
TimedElement
update in interface TimedElementpublic void activate(org.w3c.dom.events.Event evt)
EventHandlerService
activate in interface EventHandlerServicepublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||