XMT-O Reference Software

xmto2xmta.mapanimation
Class AniSet

java.lang.Object
  |
  +--xmto2xmta.MapRoot
        |
        +--xmto2xmta.mapanimation.AniAnimationBaseElement
              |
              +--xmto2xmta.mapanimation.AniSet
All Implemented Interfaces:
MapInterface

public class AniSet
extends AniAnimationBaseElement

Class to handle the conversion of the set element.

History:


Field Summary
private static boolean debug_
          Whether debug information is to be printed to the console.
private  java.util.ResourceBundle setRes_
           
private  set treeSet_
           
private  java.util.ResourceBundle xmto2XmtaRes_
           
 
Fields inherited from class xmto2xmta.mapanimation.AniAnimationBaseElement
xmtaNodeContainerId_
 
Fields inherited from class xmto2xmta.MapRoot
treeElement_, xmto2xmta_
 
Constructor Summary
AniSet()
           
 
Method Summary
private  boolean createDeleteEventMapping(java.lang.String groupId)
          Delete the group containing the conditionals and valuator.
private  boolean createDeleteMapping(ELASid elasId)
          Don't do anything for the deletion.
private  boolean createInsertEventMapping(java.lang.String groupId)
          Create the event mapping for the set element.
private  boolean createInsertEventMappingSensor(java.lang.String valuatorId, TimingAttribute setInsertTime, TimingAttribute setDeleteTime, Sensorable sensorObject)
          Create the sensor mapping for the set infrastructure for event timing.
private  boolean createInsertEventMappingTarget(org.w3c.dom.Element insertNodes, java.lang.String valuatorId, TimingAttribute setInsertTime, TimingAttribute setDeleteTime, Animatable animatableObject)
          Create the target mapping for the set infrastructure for event timing.
private  boolean createInsertMapping(ELASid elasId)
          Create the set infrastructure.
private  boolean createReplaceTarget(TimingAttribute setInsertTime)
          Reset the target element's value.
 void doMapping()
           
private  boolean doTimingMapping()
           
private  boolean fillInReplace(org.w3c.dom.Element parNode, java.lang.String animXmtaNodeId, java.lang.String animXmtaAttrName, java.lang.String animXmtaAttrValue)
          Reset the target element's value.
private  boolean fillInReplaceDefsTarget(org.w3c.dom.Element parNodes, Animatable target)
          Reset the target element's value.
private  boolean fillInReplaceTimingTarget(org.w3c.dom.Element parNodes, Animatable target, ELASid targetElasId)
          Reset the target element's value.
private  java.lang.String getXmtoAttrAttributeName()
          Return the name of the attribute to be animated.
 void init(Xmto2Xmta xmto2xmta, ConvertElement element)
           
static void setDebug(boolean debug)
          Enable debugging information to be printed to the console.
 java.lang.String toString()
           
 
Methods inherited from class xmto2xmta.mapanimation.AniAnimationBaseElement
getXmtaNodeContainerId
 
Methods inherited from class xmto2xmta.MapRoot
fireErrorEvent, fireErrorEvent, fireErrorEvent, getConvertElement
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, 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).

treeSet_

private set treeSet_

xmto2XmtaRes_

private java.util.ResourceBundle xmto2XmtaRes_

setRes_

private java.util.ResourceBundle setRes_
Constructor Detail

AniSet

public AniSet()
Method Detail

createDeleteEventMapping

private boolean createDeleteEventMapping(java.lang.String groupId)
Delete the group containing the conditionals and valuator. This method also should reset the value but we are not determining the interval time of the set. For now the timing of the set can be figured out by the time of its parent timing element.

All the conditionals and the valuator will be created under a group to make it easier to remove them all at the end of the set interval.

 <par begin="???">
   <Delete atNode"???"/>
 </par>
 

createDeleteMapping

private boolean createDeleteMapping(ELASid elasId)
Don't do anything for the deletion.

createInsertEventMapping

private boolean createInsertEventMapping(java.lang.String groupId)
Create the event mapping for the set element. For the event we have three timings to consider, the timing of the set, the target (receiver) and the sensor object. For now the timing of the set can be figured out by the time of its parent timing element. The timing of the target and sensor can be obtained by those objects.

In essence the structure of the set is to have a sensor object (from touchSensor) route an event to a valuator. The valuator converts the time event into a activate event. The activate event is routed to the conditional which contains the command to replace the value. The replace is the actual setting of the value.

The problem is that there can be multiple timing intervals for both the target and the sensor objects. There can also be multiple timing intervals for the set, but for now the event timing is only determined by the parent maximum begin and end. Thus it can look like the following:

 timeline           0    5   10   15   20   25
 sensor intervals   ****  ****  **** **** ****
 set interval              *************
 target intervals     ** ** ** ** ** ** ** **
 

In order to take care the multiple interval problems:

All the conditionals and the valuator will be created under a group to make it easier to remove them all at the end of the set interval.

Thus the normal event set infrastructure is:

  1. Group to hold the valuator and conditionals,
  2. Valuator.
  3. List of conditionals each with a replace. There is a conditional/replace for each target interval. with a route from the valuator.
  4. List of sensor routes. Each sensor route goes from the valuator to each sensor interval.
 <par begin="???">
   <Insert atNode"???">
     <group DEF="???">
       <children>
         <Valuator DEF="???" Factor1="0" Offset1="1"/>
       </children>
     </group>
   </Insert>

   <Insert atNode"???">
       <Conditional DEF="???">
         <buffer>
           <Replace atNode="???" atField="??" value="???"/>
         </buffer>
       </Conditional>
       <ROUTE fromField="outSFBool" fromNode="???" toField="activate" toNode="???"/>
   </Insert>
 </par>

 <par begin="???">
   <Insert>
     <ROUTE fromField="touchTime" fromNode="???" toField="inSFTime" toNode="???"/>
   </Insert>
 </par>
 

createInsertEventMappingSensor

private boolean createInsertEventMappingSensor(java.lang.String valuatorId,
                                               TimingAttribute setInsertTime,
                                               TimingAttribute setDeleteTime,
                                               Sensorable sensorObject)
Create the sensor mapping for the set infrastructure for event timing. This is to create a route from the sensor object to the valuator. This method goes through all the intervals of the sensor element adding a route from the sensor's touchsensor to the valuator. It is also necessary to enable the touchsensor.

The route has to be inserted on the later of the insert time of the set interval and the insert time of the sensor interval.

   <par begin="???">
	   <Insert>
       <ROUTE fromField="touchTime" fromNode="???" toField="inSFTime" toNode="???"/>
	   </Insert>
   </par>
   <par begin="???">
	   <Replace atNode="???" atField="enabled" value="true"/>
   </par>
 

createInsertEventMappingTarget

private boolean createInsertEventMappingTarget(org.w3c.dom.Element insertNodes,
                                               java.lang.String valuatorId,
                                               TimingAttribute setInsertTime,
                                               TimingAttribute setDeleteTime,
                                               Animatable animatableObject)
Create the target mapping for the set infrastructure for event timing. The normal set infrastructure is a replace command. For the event timing wrap the replace in a conditional which can be executed when ever the touch sensor is activated.

This method goes through all the intervals of the target element adding a conditional to replace the value, then connecting the conditional to the valuator with a route. In the case of a def object there is only one target interval.

Thus the steps for each target interval are:

  1. Add the conditional with the replace command into the scene
  2. Create a route from the valuator to the conditional
     <Conditional DEF="???">
       <buffer>
         <Replace atNode="???" atField="??" value="???"/>
       </buffer>
     </Conditional>
     <ROUTE fromField="outSFBool" fromNode="???" toField="activate" toNode="???"/>
 

createInsertMapping

private boolean createInsertMapping(ELASid elasId)
Create the set infrastructure.
   <par begin="???">
     <Replace atNode="???" atField="inSFInt32" value="1"/>
	   <Delete atNode="???"/>
   </par>
 

createReplaceTarget

private boolean createReplaceTarget(TimingAttribute setInsertTime)
Reset the target element's value.
   <par begin="???">
     <Replace atNode="???" atField="??" value="???"/>
   </par>
 

doMapping

public void doMapping()

doTimingMapping

private boolean doTimingMapping()

fillInReplace

private boolean fillInReplace(org.w3c.dom.Element parNode,
                              java.lang.String animXmtaNodeId,
                              java.lang.String animXmtaAttrName,
                              java.lang.String animXmtaAttrValue)
Reset the target element's value.
   <Replace atNode="???" atField="??" value="???"/>
 

fillInReplaceDefsTarget

private boolean fillInReplaceDefsTarget(org.w3c.dom.Element parNodes,
                                        Animatable target)
Reset the target element's value.
   <Replace atNode="???" atField="??" value="???"/>
 

fillInReplaceTimingTarget

private boolean fillInReplaceTimingTarget(org.w3c.dom.Element parNodes,
                                          Animatable target,
                                          ELASid targetElasId)
Reset the target element's value.
   <Replace atNode="???" atField="??" value="???"/>
 

getXmtoAttrAttributeName

private java.lang.String getXmtoAttrAttributeName()
Return the name of the attribute to be animated.

init

public void init(Xmto2Xmta xmto2xmta,
                 ConvertElement element)
          throws java.lang.Exception
Overrides:
init in class MapRoot

setDebug

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

XMT-O Reference Software