XMT-O Reference Software

xmto2xmta
Class EventModel

java.lang.Object
  |
  +--xmto2xmta.EventModel

public class EventModel
extends java.lang.Object

Class to group together the various type of timing elements.

History:


Field Summary
private  java.util.Hashtable convertIndexTable_
           
private static boolean debug_
          Whether debug information is to be printed to the console.
private  java.util.Hashtable eventTable_
          Hash table Data structure for event times.
private  Xmto2Xmta o2aConverter_
          Input structures
private  ConvertElement root_
           
private  TimeScheduler timeScheduler_
           
private  java.util.ResourceBundle xmto2XmtaRes_
           
private  java.util.Hashtable xmtoIdTable_
           
 
Constructor Summary
EventModel(Xmto2Xmta converter, java.util.Hashtable xmtoIds, java.util.Hashtable convertIndexes, ConvertElement root, TimeScheduler timeScheduler)
          Create the Event Model.
 
Method Summary
 TimingAttribute getActiveDuration(java.lang.Integer convertTreeIndex)
          Return the active duration of the specified element.
 TimingAttribute getBeginSceneBeginTime(java.lang.Integer convertTreeIndex)
          Get the begining scene time for the begin event.
 TimingAttribute getBeginSceneEndTime(java.lang.Integer convertTreeIndex)
          Get the begining scene time for the end event The end event can occur across some range of times, usually this is the duration of the element which is clicked on.
 TimingAttribute getEndSceneBeginTime(java.lang.Integer convertTreeIndex)
          Get the ending scene time for the begin event The begin event can occur across some range of times, usually this is the duration of the element which is clicked on.
 TimingAttribute getEndSceneEndTime(java.lang.Integer convertTreeIndex)
          Get the ending scene time for the end event The end event can occur across some range of times, usually this is the duration of the element which is clicked on.
 TimingAttribute getSceneBeginTime(java.lang.Integer convertTreeIndex)
          This is the determines the event which kicks off the begining of the element.
 TimingAttribute getSceneEndTime(java.lang.Integer convertTreeIndex)
          This is the determines the event which kicks off the ending of the element.
 boolean isBeginEvent(java.lang.Integer convertTreeIndex)
           
 boolean isEndEvent(java.lang.Integer convertTreeIndex)
          is the end timing attribute an event or not.
static void setDebug(boolean debug)
          Enable debugging information to be printed to the console.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

debug_

private static boolean debug_
Whether debug information is to be printed to the console. default is not have debug information printed (false).

o2aConverter_

private Xmto2Xmta o2aConverter_
Input structures

xmtoIdTable_

private java.util.Hashtable xmtoIdTable_

convertIndexTable_

private java.util.Hashtable convertIndexTable_

timeScheduler_

private TimeScheduler timeScheduler_

root_

private ConvertElement root_

eventTable_

private java.util.Hashtable eventTable_
Hash table Data structure for event times. The prime number 89 was chosen as the hash table initialize size because it was mentioned as a better starting hash size for optimization than the default 101. The element2ClassMapTable_ table is composed of (key, data) The key is the convert tree element indexes (unique id). The data is the Data structure for resolved times.

xmto2XmtaRes_

private java.util.ResourceBundle xmto2XmtaRes_
Constructor Detail

EventModel

public EventModel(Xmto2Xmta converter,
                  java.util.Hashtable xmtoIds,
                  java.util.Hashtable convertIndexes,
                  ConvertElement root,
                  TimeScheduler timeScheduler)
Create the Event Model.
Parameters:
converter - converter with pointers to the convert tree, the xmto id hash table and the convert tree index hash table.
xmtoIds - table of the convert tree Elements. The hash index is the xmto id attribute. Not all convert tree elements are contained in this table, for example the elements which don't have xmto ids. Also this table may have elemnents removed if an element isn't supported or has an error which can't be converted.
convertIndexes - table of the convert tree Elements. The hash index is the unique index for each convert element (like an id, but not to be confused with the xmto id. This table may have elemnents removed if an element isn't supported or has an error which can't be converted.
resolveModel - Model holding all the resolved times for convert tree timing elements.
Method Detail

getActiveDuration

public TimingAttribute getActiveDuration(java.lang.Integer convertTreeIndex)
Return the active duration of the specified element. JSB: don't know if this method makes any sense in the EventModel. I don't know if the active duration can't be resoved in the ResolveModel and yet can be resolved in the EventModel? For now keep the method in.

getBeginSceneBeginTime

public TimingAttribute getBeginSceneBeginTime(java.lang.Integer convertTreeIndex)
Get the begining scene time for the begin event. The begin event can occur across some range of time. This range is dependent on range of this element and the range of the element which is clicked (sensor element).

Since this element is a click event, its range can't be determined via the lifecycle of the element, but try anyway. If we can't find the range from the life cycle use the range of the parent/ancestor timing element. The parent/ancestor range can be used to limit this element's range.

The the range of this element also depends on the duration of the element which is clicked (sensor element). Thus the range of time is limited to the active duration of the sensor element.

The range of the begin event is the intersection of sensor duration and the element/parent/ancestor element duration.

This routine is returns the earliest time in which the begin event can occur, the begining of the range.


getBeginSceneEndTime

public TimingAttribute getBeginSceneEndTime(java.lang.Integer convertTreeIndex)
Get the begining scene time for the end event The end event can occur across some range of times, usually this is the duration of the element which is clicked on. Thus the range of time is often the active duration of that element. This routine is returns the earliest time of the end event can occur. 20 Apr 2001 - Comment out this method since it end event isn't supported. Logic kept in as reference.

getEndSceneBeginTime

public TimingAttribute getEndSceneBeginTime(java.lang.Integer convertTreeIndex)
Get the ending scene time for the begin event The begin event can occur across some range of times, usually this is the duration of the element which is clicked on. Thus the range of time is often the active duration of that element. This routine is returns the latest time in which the begin event can occur. It might be indefinite, thus it might never start if the user never clicks. Get the ending scene time for the begin event. The begin event can occur across some range of time. This range is dependent on range of this element and the range of the element which is clicked (sensor element).

Since this element is a click event, its range can't be determined via the lifecycle of the element, but try anyway. If we can't find the range from the life cycle use the range of the parent/ancestor timing element. The parent/ancestor range can be used to limit this element's range.

The the range of this element also depends on the duration of the element which is clicked (sensor element). Thus the range of time is limited to the active duration of the sensor element.

The range of the begin event is the intersection of sensor duration and the element/parent/ancestor element duration.

This routine is returns the latest time in which the begin event can occur, the end of the range. It might be indefinite, thus it might never start if the user never clicks.


getEndSceneEndTime

public TimingAttribute getEndSceneEndTime(java.lang.Integer convertTreeIndex)
Get the ending scene time for the end event The end event can occur across some range of times, usually this is the duration of the element which is clicked on. Thus the range of time is often the active duration of that element. This routine is returns the latest time in which the end event can occur. It might be indefinite, thus it might never end. 20 Apr 2001 - Comment out this method since it end event isn't supported. Logic kept in as reference.

getSceneBeginTime

public TimingAttribute getSceneBeginTime(java.lang.Integer convertTreeIndex)
This is the determines the event which kicks off the begining of the element. This is the begin event, often a element.click time attribute. This often will contain a time offset from the event (element.click+40s).

getSceneEndTime

public TimingAttribute getSceneEndTime(java.lang.Integer convertTreeIndex)
This is the determines the event which kicks off the ending of the element. This is the end event, often a element.click time attribute. This often will contain a time offset from the event (element.click+40s). This can also be a multi value time attribute, often with a event value and a clock value attributes. The event is the standard click plus offset. The clock value would be often also be included because of the ending of a parent element. Thus it would end when a click is recieved or the <par> element ends. 20 Apr 2001 - Comment out this method since it end event isn't supported. Logic kept in as reference.

isBeginEvent

public boolean isBeginEvent(java.lang.Integer convertTreeIndex)

isEndEvent

public boolean isEndEvent(java.lang.Integer convertTreeIndex)
is the end timing attribute an event or not. If there isn't an end attribute check to see if the begin is an event. 20 Apr 2001 - Comment out this method since it end event isn't supported. Logic kept in as reference.

setDebug

public static void setDebug(boolean debug)
Enable debugging information to be printed to the console.
Parameters:
debug - sets debug information is printed

XMT-O Reference Software