XMT-O Reference Software

xmto2xmta.mapxmtamedia
Class XmaXmtaMedia

java.lang.Object
  |
  +--xmto2xmta.MapRoot
        |
        +--xmto2xmta.mapxmtamedia.XmaXmtaMedia
All Implemented Interfaces:
MapInterface

public class XmaXmtaMedia
extends MapRoot

Class to group together the various type of media elements.

History:


Field Summary
private static boolean debug_
          Whether debug information is to be printed to the console.
private  xmtaMedia treeXmtaMediaElement_
           
private  java.util.ResourceBundle xmto2XmtaRes_
           
 
Fields inherited from class xmto2xmta.MapRoot
treeElement_, xmto2xmta_
 
Constructor Summary
XmaXmtaMedia()
           
 
Method Summary
private  void addCmds(org.w3c.dom.Element xmtaElement)
          This will go through the cmds element in the xmtaMedia adding the elements to the xmta tree element.
private  void addNodes(org.w3c.dom.Element xmtaElement)
          This will go through the nodes element in the xmtaMedia adding the elements to the xmta tree element.
private  void copy(org.w3c.dom.Node input, org.w3c.dom.Node output)
           
private  boolean createCmdsMapping(TimingAttribute insertTime)
          Create the infrastructure to add the nodes' elements in an insert into the scene structure.
private  boolean createContainerMapping(java.lang.String parentOrderedGroupId, boolean parentUsePositions, java.lang.String groupId, java.lang.String touchSensorId, java.lang.String containerId, TimingAttribute insertTime)
          Create the xmtaMedia Element infrastructure.
protected  boolean createDeleteMapping(ELASid elasId)
          Create the media Element infrastructure.
protected  boolean createInsertMapping(ELASid elasId)
          Create the xmtaMedia Element infrastructure.
private  boolean createNodesMapping(java.lang.String containerId, TimingAttribute insertTime)
          Create the infrastructure to add the nodes' elements in an insert into the scene structure.
 void doMapping()
           
private  boolean doTimingMapping()
           
 void init(Xmto2Xmta xmto2xmta, ConvertElement element)
           
static void setDebug(boolean debug)
          Enable debugging information to be printed to the console.
 
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, 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).

treeXmtaMediaElement_

private xmtaMedia treeXmtaMediaElement_

xmto2XmtaRes_

private java.util.ResourceBundle xmto2XmtaRes_
Constructor Detail

XmaXmtaMedia

public XmaXmtaMedia()
Method Detail

addCmds

private void addCmds(org.w3c.dom.Element xmtaElement)
This will go through the cmds element in the xmtaMedia adding the elements to the xmta tree element.

addNodes

private void addNodes(org.w3c.dom.Element xmtaElement)
This will go through the nodes element in the xmtaMedia adding the elements to the xmta tree element.

copy

private void copy(org.w3c.dom.Node input,
                  org.w3c.dom.Node output)

createCmdsMapping

private boolean createCmdsMapping(TimingAttribute insertTime)
Create the infrastructure to add the nodes' elements in an insert into the scene structure. The infrastructure contains the par node for the insertion. The insert places the nodes' elements in the container for the xmtaMedia element.
   <par begin="???">
     ***** xmta elmements under the <cmds> element. *****
   </par>
 

createContainerMapping

private boolean createContainerMapping(java.lang.String parentOrderedGroupId,
                                       boolean parentUsePositions,
                                       java.lang.String groupId,
                                       java.lang.String touchSensorId,
                                       java.lang.String containerId,
                                       TimingAttribute insertTime)
Create the xmtaMedia Element infrastructure. The infrastructure contains the par node for the insertion. The par node for the insertion contains the top level group which will contain the information for the element. This also takes care of the position in the ordered group field (for z-order).

The infrasturcture requires adding the elements to the BIFS scene requires creating a container to add all the elements in the xmt-o nodes element. Since we are in a 2D context if the xmtaMedia element is 3D then make the container element a Layer3D so that we can switch to a 3D context. If the xmtaMedia element isn't 3D just create a Group as the container.

   <par begin="???">
     <Insert atNode="???">
       <Group DEF="???">
         <children>
           <TouchSensor DEF="???" enabled="false">
           <Group DEF="???"/> OR <Layer3D DEF="???"/> 
         </children>
       </Group>
     </Insert>
     <Insert atField="order" atNode="???" position="END" value="-1"/>
   </par>
 

createDeleteMapping

protected boolean createDeleteMapping(ELASid elasId)
Create the media Element infrastructure. The infrastructure contains the par node for the deletion. The par for the deletion, deletes the top level group for the element. It also takes care of the position in the ordered group field (for z-order)
   <par begin="???">
     <Delete atNode="???"/>
     <Delete atField="order" atNode="???"/>
   </par>
 

createInsertMapping

protected boolean createInsertMapping(ELASid elasId)
Create the xmtaMedia Element infrastructure. The xmtaMedia Element infrastructure consists of 3 parts, the nodes for the container, the nodes and cmds.
  1. The container infrastructure is the wrapper for placing the xmtaMedia nodes in the bifs tree.
  2. The nodes infrastructure inserts all the xmta elements found in the nodes section of the xmtaMedia element. The xmta elements are inserted into the a container created in the container infrastructure creation.
  3. The cmds infrastructure inserts all the xmta cmd elements. These are wrapped by a par which contains the timing of the xmtaMedia element.

createNodesMapping

private boolean createNodesMapping(java.lang.String containerId,
                                   TimingAttribute insertTime)
Create the infrastructure to add the nodes' elements in an insert into the scene structure. The infrastructure contains the par node for the insertion. The insert places the nodes' elements in the container for the xmtaMedia element.
   <par begin="???">
     <Insert atNode="???">
       ***** xmta elmements under the <nodes> element. *****
     </Insert>
   </par>
 

doMapping

public void doMapping()

doTimingMapping

private boolean doTimingMapping()

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

XMT-O Reference Software