XMT-O Reference Software

xmto2xmta.tree
Class texture

java.lang.Object
  |
  +--xmto2xmta.tree.TreeElement
        |
        +--xmto2xmta.tree.ConvertElement
              |
              +--xmto2xmta.tree.XmediaChildrenElement
                    |
                    +--xmto2xmta.tree.XmediaChildrenExternalElement
                          |
                          +--xmto2xmta.tree.texture
All Implemented Interfaces:
Animatable, DefsObject

public class texture
extends XmediaChildrenExternalElement
implements DefsObject, Animatable

Class to handle the conversion of the texture element. The texture element is different than the other XmediaChildrenDefsElements in that it create two different XMT-A elements rather than the standard one element.

History:


Field Summary
private  java.lang.String[] animXmtaAttrFieldDefaultValue_
           
private  int[] animXmtaAttrFieldType_
           
private  java.lang.String[] animXmtaAttrName_
           
private  int[] animXmtoAttrFieldType_
           
private  java.lang.String[] animXmtoAttrName_
           
private static boolean debug_
          Whether debug information is to be printed to the console.
private static java.lang.String FILE_URL_PREFIX
           
private  boolean isDefsParent_
           
private  boolean isInDefsTree_
           
private  boolean isInDefsTreeInitialized_
           
private static java.lang.String ODID_URL_PREFIX
           
private  java.lang.String xmtaTextureId_
           
(package private)  java.util.Hashtable xmtaTextureIds_
           
private  java.lang.String xmtaTextureTransformId_
           
(package private)  java.util.Hashtable xmtaTextureTransformIds_
           
private  java.util.ResourceBundle xmto2XmtaRes_
           
private  java.lang.String xmtoAttrCenter_
           
private  java.lang.String xmtoAttrRepeatS_
           
private  java.lang.String xmtoAttrRepeatT_
           
private  java.lang.String xmtoAttrRotation_
           
private  java.lang.String xmtoAttrScale_
           
private  java.lang.String xmtoAttrTranslation_
           
 
Fields inherited from class xmto2xmta.tree.XmediaChildrenExternalElement
externalElementRes_, xmtaEsDescriptorId_, xmtaEsDescriptorIds_, xmtaObjectDescriptorId_, xmtaObjectDescriptorIds_, xmtoAttrSrc_
 
Fields inherited from class xmto2xmta.tree.ConvertElement
convertIndexTable_, index_, xmtaDoc_, xmtaIds_, xmtaParNodes_, xmtaParOds_, xmtaParRoutes_, xmto2Xmta_, xmtoAttrId_, xmtoElement_, xmtoIds_
 
Fields inherited from class xmto2xmta.tree.TreeElement
children, parent_
 
Fields inherited from interface xmto2xmta.tree.Animatable
TYPE_MFBool, TYPE_MFColor, TYPE_MFFloat, TYPE_MFInt32, TYPE_MFString, TYPE_MFVec2f, TYPE_SFBool, TYPE_SFColor, TYPE_SFFloat, TYPE_SFInt32, TYPE_SFString, TYPE_SFVec2f, TYPE_UNSUPPORTED
 
Constructor Summary
texture(org.w3c.dom.Element xmtoElement, java.util.Hashtable xmtoIds, java.util.Hashtable xmtaIds, java.util.Hashtable convertIndexTable, org.w3c.dom.Document xmtaDoc, Xmto2Xmta xmto2Xmta)
          constructor.
 
Method Summary
 java.lang.String getAnimConvertValueXmto2Xmta(java.lang.String xmtoAttrName, java.lang.String xmtoValue, int xmtoFieldType, int xmtaFieldType)
          This function converts a xmto attribute value to its xmta equivalent.
 int getAnimXmtaAttrFieldType(java.lang.String xmtoAttrName)
          This function returns the MPEG-4 field type being animated.
 java.lang.String getAnimXmtaAttrInitialValue(java.lang.String xmtoAttrName)
          This function returns the initial value of the field begin animated.
 java.lang.String getAnimXmtaAttrName(java.lang.String xmtoAttrName)
          This function returns the MPEG-4 field being animated.
 java.lang.String getAnimXmtaDefsNodeId(java.lang.String xmtoAttrName)
          This function returns the MPEG-4 node whose field is being animated.
 java.lang.String getAnimXmtaNodeId(java.lang.String xmtoAttrName, ELASid elasId)
          This function returns the MPEG-4 node whose field is being animated.
 int getAnimXmtoAttrFieldType(java.lang.String xmtoAttrName)
          This function returns the MPEG-4 field type being animated.
 java.lang.String getXmtaDefsId()
          Normally this returns the defs id of the object.
 java.lang.String getXmtaTextureId()
          Get the defs id of the object.
 java.lang.String getXmtaTextureId(ELASid elasId)
          get the id for the MovieTexture or ImageTexture element.
 java.lang.String getXmtaTextureTransformId()
          Get the defs id of the object.
 java.lang.String getXmtaTextureTransformId(ELASid elasId)
          get the id for the TextureTransform element.
 java.lang.String getXmtoAttrCenter()
           
 java.lang.String getXmtoAttrRepeatS()
           
 java.lang.String getXmtoAttrRepeatT()
           
 java.lang.String getXmtoAttrRotation()
           
 java.lang.String getXmtoAttrScale()
           
 java.lang.String getXmtoAttrTranslation()
           
protected  boolean handleValidateSyntax(java.lang.String attributeName, java.lang.String attributeValue)
          Handle the attribute by checking its syntax.
 void initDefsFlags()
          Routine to initialize the defs query flags.
 boolean isDefsParent()
          Determine whether the object is a child of the defs element or not.
 boolean isInDefsTree()
          Determine whether the object is in the defs tree or not.
static void setDebug(boolean debug)
          Enable debugging information to be printed to the console.
 java.lang.String toString()
           
 
Methods inherited from class xmto2xmta.tree.XmediaChildrenExternalElement
getXmtaEsDescriptorId, getXmtaEsDescriptorId, getXmtaObjectDescriptorId, getXmtaObjectDescriptorId, getXmtoAttrSrc, getXmtoAttrSrcCanonical, validateSyntax
 
Methods inherited from class xmto2xmta.tree.ConvertElement
addToParNode, addToParOd, addToParRoutes, createChildren, fireErrorEvent, fireErrorEvent, fireErrorEvent, getConvertIndexTable, getIndex, getXmtaDoc, getXmtaIds, getXmto2Xmta, getXmtoAttrId, getXmtoElement, getXmtoIds, insertIntoXmtaTree, remove
 
Methods inherited from class xmto2xmta.tree.TreeElement
addChild, getChildren, getParent, removeChild, setParent
 
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).

ODID_URL_PREFIX

private static final java.lang.String ODID_URL_PREFIX

FILE_URL_PREFIX

private static final java.lang.String FILE_URL_PREFIX

xmtoAttrRepeatS_

private java.lang.String xmtoAttrRepeatS_

xmtoAttrRepeatT_

private java.lang.String xmtoAttrRepeatT_

xmtoAttrCenter_

private java.lang.String xmtoAttrCenter_

xmtoAttrRotation_

private java.lang.String xmtoAttrRotation_

xmtoAttrScale_

private java.lang.String xmtoAttrScale_

xmtoAttrTranslation_

private java.lang.String xmtoAttrTranslation_

xmtaTextureIds_

java.util.Hashtable xmtaTextureIds_

xmtaTextureTransformIds_

java.util.Hashtable xmtaTextureTransformIds_

xmtaTextureId_

private java.lang.String xmtaTextureId_

xmtaTextureTransformId_

private java.lang.String xmtaTextureTransformId_

isInDefsTreeInitialized_

private boolean isInDefsTreeInitialized_

isInDefsTree_

private boolean isInDefsTree_

isDefsParent_

private boolean isDefsParent_

animXmtoAttrName_

private java.lang.String[] animXmtoAttrName_

animXmtoAttrFieldType_

private int[] animXmtoAttrFieldType_

animXmtaAttrName_

private java.lang.String[] animXmtaAttrName_

animXmtaAttrFieldType_

private int[] animXmtaAttrFieldType_

animXmtaAttrFieldDefaultValue_

private java.lang.String[] animXmtaAttrFieldDefaultValue_

xmto2XmtaRes_

private java.util.ResourceBundle xmto2XmtaRes_
Constructor Detail

texture

public texture(org.w3c.dom.Element xmtoElement,
               java.util.Hashtable xmtoIds,
               java.util.Hashtable xmtaIds,
               java.util.Hashtable convertIndexTable,
               org.w3c.dom.Document xmtaDoc,
               Xmto2Xmta xmto2Xmta)
constructor.
Parameters:
xmtoElement - XMT-O element for conversion.
xmtoIds - hashtable to contain XMT-O Conversion elements with the key of their XMT-O id.
xmtaIds - hashtable to contain XMT-A elements with the key of their XMT-A id.
xmtaDoc - DOM Document for the new XMT-A elements.
xmto2Xmta - Converter, used for firing error events.
Method Detail

getAnimConvertValueXmto2Xmta

public java.lang.String getAnimConvertValueXmto2Xmta(java.lang.String xmtoAttrName,
                                                     java.lang.String xmtoValue,
                                                     int xmtoFieldType,
                                                     int xmtaFieldType)
This function converts a xmto attribute value to its xmta equivalent. It then returns the converted value.
Specified by:
getAnimConvertValueXmto2Xmta in interface Animatable

getAnimXmtaAttrFieldType

public int getAnimXmtaAttrFieldType(java.lang.String xmtoAttrName)
This function returns the MPEG-4 field type being animated. e.g. SFVec2f, MFVec3f, SFColor, MFColor, ...
Specified by:
getAnimXmtaAttrFieldType in interface Animatable

getAnimXmtaAttrInitialValue

public java.lang.String getAnimXmtaAttrInitialValue(java.lang.String xmtoAttrName)
This function returns the initial value of the field begin animated. This is used in case the attribute is not specified in the animaiton. Generally this is the original value so that after the animation is finished the node field can be returned to its original state. If this value isn't specified then the default value will be used.
Specified by:
getAnimXmtaAttrInitialValue in interface Animatable

getAnimXmtaAttrName

public java.lang.String getAnimXmtaAttrName(java.lang.String xmtoAttrName)
This function returns the MPEG-4 field being animated.
Specified by:
getAnimXmtaAttrName in interface Animatable

getAnimXmtaDefsNodeId

public java.lang.String getAnimXmtaDefsNodeId(java.lang.String xmtoAttrName)
This function returns the MPEG-4 node whose field is being animated. This method is for when there is no elasId for this instantiation of the object. This can occur for xMediaChildrenObject that are defs objects, but the parent isn't a TimingElement.
Specified by:
getAnimXmtaDefsNodeId in interface Animatable

getAnimXmtaNodeId

public java.lang.String getAnimXmtaNodeId(java.lang.String xmtoAttrName,
                                          ELASid elasId)
This function returns the MPEG-4 node whose field is being animated.
Specified by:
getAnimXmtaNodeId in interface Animatable

getAnimXmtoAttrFieldType

public int getAnimXmtoAttrFieldType(java.lang.String xmtoAttrName)
This function returns the MPEG-4 field type being animated. e.g. SFVec2f, MFVec3f, SFColor, MFColor, ...
Specified by:
getAnimXmtoAttrFieldType in interface Animatable

getXmtaDefsId

public java.lang.String getXmtaDefsId()
Normally this returns the defs id of the object. For the Texture element there are actually 2 defs ids of the object and thus anyone who would want to query this object must instead get both the texture and textureTransform ids.
Specified by:
getXmtaDefsId in interface DefsObject
Returns:
the empty string.

getXmtaTextureId

public java.lang.String getXmtaTextureId()
Get the defs id of the object.
Returns:
the unique id of this object.

getXmtaTextureId

public java.lang.String getXmtaTextureId(ELASid elasId)
get the id for the MovieTexture or ImageTexture element.

getXmtaTextureTransformId

public java.lang.String getXmtaTextureTransformId()
Get the defs id of the object.
Returns:
the unique id of this object.

getXmtaTextureTransformId

public java.lang.String getXmtaTextureTransformId(ELASid elasId)
get the id for the TextureTransform element.

getXmtoAttrCenter

public java.lang.String getXmtoAttrCenter()

getXmtoAttrRepeatS

public java.lang.String getXmtoAttrRepeatS()

getXmtoAttrRepeatT

public java.lang.String getXmtoAttrRepeatT()

getXmtoAttrRotation

public java.lang.String getXmtoAttrRotation()

getXmtoAttrScale

public java.lang.String getXmtoAttrScale()

getXmtoAttrTranslation

public java.lang.String getXmtoAttrTranslation()

handleValidateSyntax

protected boolean handleValidateSyntax(java.lang.String attributeName,
                                       java.lang.String attributeValue)
Handle the attribute by checking its syntax. This is to catch all syntax errors which the schema can not check for, and thus the DOM parser doesn't find any problems. Call the parent handler to see if it can handle the attribute or not.
Overrides:
handleValidateSyntax in class XmediaChildrenExternalElement
Parameters:
attributeName - node name of attribute.
attributeValue - node value of attribute.
Returns:
whether this attribute is handled or not.

initDefsFlags

public void initDefsFlags()
Routine to initialize the defs query flags. This is added to provide consistency for all the classes that implement the DefsObject interface.
Specified by:
initDefsFlags in interface DefsObject

isDefsParent

public boolean isDefsParent()
Determine whether the object is a child of the defs element or not. This means that the object is a direct child of the defs element. It isn't a child if it isn't in the defs tree or is a descendent (starting at grandchild) of the defs element.
Specified by:
isDefsParent in interface DefsObject
Returns:
whether the object is a child of the defs element. True if it is a child of the defs element, false otherwise.

isInDefsTree

public boolean isInDefsTree()
Determine whether the object is in the defs tree or not. This means that the object is defined somewhere in the Defs tree. It may be a child or descendent of the defs element.
Specified by:
isInDefsTree in interface DefsObject
Returns:
whether the object is in the defs tree. True if a descendent of the defs element, false otherwise.

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 TreeElement

XMT-O Reference Software