fi.hut.tml.xsmiles.mlfc.aaml
Class Audio3DElementImpl

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.ElementImpl
                  extended byorg.apache.xerces.dom.ElementNSImpl
                      extended byfi.hut.tml.xsmiles.dom.XSmilesElementImpl
                          extended byfi.hut.tml.xsmiles.mlfc.aaml.Audio3DElementImpl
All Implemented Interfaces:
AudioUpdate, java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.events.EventTarget, InitializableElement, org.w3c.dom.Node, org.w3c.dom.NodeList, PseudoClassController, ResourceFetcher, java.lang.Runnable, java.io.Serializable, StylableElement, org.w3c.dom.TypeInfo, VisualComponentService
Direct Known Subclasses:
ListenerElementImpl

public class Audio3DElementImpl
extends XSmilesElementImpl
implements AudioUpdate, VisualComponentService, java.lang.Runnable

Audio3D element plays audio in a 3d space. The audio file must be in WAVE format, with the following header: RIFF....WAVEfmt ........xx..xx......data Otherwise, the file is not loaded or played!

Author:
Kari Pihkala
See Also:
Serialized Form

Nested Class Summary
 class Audio3DElementImpl.InvisibleComponent
           
 
Nested classes inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
XSmilesElementImpl.PseudoNodeList
 
Field Summary
protected  AAMLFC aaMLFC
           
protected  float back
           
protected  java.awt.Component component
           
protected  float depth
           
protected  float front
           
protected  int height
           
protected  float last2front
           
protected  float last2left
           
protected  float last2top
           
protected  float last3front
           
protected  float last3left
           
protected  float last3top
           
protected  float lastfront
           
protected  float lastleft
           
protected  float lasttop
           
protected  float left
           
protected  org.apache.xerces.dom.DocumentImpl ownerDoc
           
protected  java.util.Hashtable regions
           
protected  int sid
           
protected  float top
           
protected  boolean visible
           
protected  int width
           
 
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.dom.VisualComponentService
EVENT_STYLECHANGED
 
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
Audio3DElementImpl(org.apache.xerces.dom.DocumentImpl owner, AAMLFC aamlfc, java.lang.String namespace, java.lang.String tag)
          Constructor - Set the owner, name and namespace.
 
Method Summary
protected  float convertToFloat(java.lang.String val)
          Convert string val to float.
 void destroy()
          Destroy this element.
 java.lang.String getClassName()
          The class attribute.
 java.awt.Component getComponent()
          Return the visual component for this extension element
protected  java.awt.Dimension getCoords(java.awt.Component parent)
          Return the coordinates of this audio element.
protected  java.lang.String getLocalname(java.lang.String tagname)
           
protected  java.lang.String getNSAttr(org.w3c.dom.Element e, java.lang.String a)
          Get either animated or normal attribute (AAML, SMIL or no namespace).
protected  boolean getRegionCoords()
          Get the front, back, depth values of the element.
 java.awt.Dimension getSize()
          Returns the approximate size of this extension element
 boolean getVisible()
           
 void init()
          Initialize this element.
 void run()
           
 void setClassName(java.lang.String cl)
           
 void setVisible(boolean v)
           
 void setZoom(double zoom)
           
protected  Point3D translate(float left, float top, float front)
          Calculate matrix translation.
 void update()
          Update the audio data to the native side.
 void visualEvent(int event, java.lang.Object object)
           
 
Methods inherited from class fi.hut.tml.xsmiles.dom.XSmilesElementImpl
addBinding, addUndistributedChild, clone, clonePseudoElements, cloneSubtree, debugNode, debugNode, dispatchEventInMainThread, get, getApplyBindingSheets, getAuthorSheets, getChildNodes, getElementStatus, getId, getOriginalClone, getPseudoClass, getResourceReferencer, getRuleNode, getStyle, getStyleAttrValue, getText, getText, getUndistributedChildNodes, getXblImplementations, hasBinding, hasStyle, initFinalFlattenedTree, initStyle, isInitedForReset, isPseudoClass, removeBinding, removeUndistributedChild, replaceNode, resetFinalFlattenedTree, resolveURI, searchElementWithId, searchElementWithId, setApplyBindingSheets, setAuthorSheets, setPseudoClass, setRuleNode, setStyle, updateStyle
 
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, toString
 
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

aaMLFC

protected AAMLFC aaMLFC

ownerDoc

protected org.apache.xerces.dom.DocumentImpl ownerDoc

width

protected int width

height

protected int height

visible

protected boolean visible

component

protected java.awt.Component component

regions

protected java.util.Hashtable regions

front

protected float front

back

protected float back

depth

protected float depth

left

protected float left

top

protected float top

lastfront

protected float lastfront

lasttop

protected float lasttop

lastleft

protected float lastleft

last2front

protected float last2front

last2top

protected float last2top

last2left

protected float last2left

last3front

protected float last3front

last3top

protected float last3top

last3left

protected float last3left

sid

protected int sid
Constructor Detail

Audio3DElementImpl

public Audio3DElementImpl(org.apache.xerces.dom.DocumentImpl owner,
                          AAMLFC aamlfc,
                          java.lang.String namespace,
                          java.lang.String tag)
Constructor - Set the owner, name and namespace.

Method Detail

visualEvent

public void visualEvent(int event,
                        java.lang.Object object)
Specified by:
visualEvent in interface VisualComponentService

init

public void init()
Initialize this element. This requires that the DOM tree is available.

Specified by:
init in interface InitializableElement
Overrides:
init in class XSmilesElementImpl

update

public void update()
Update the audio data to the native side.

Specified by:
update in interface AudioUpdate

getCoords

protected java.awt.Dimension getCoords(java.awt.Component parent)
Return the coordinates of this audio element.


getRegionCoords

protected boolean getRegionCoords()
Get the front, back, depth values of the element. Returns either region, inline or CSS coords (left, top, front). Note, this cannot handle SMIL right & width attribute combination!

Returns:
true if depth information was found.

getNSAttr

protected java.lang.String getNSAttr(org.w3c.dom.Element e,
                                     java.lang.String a)
Get either animated or normal attribute (AAML, SMIL or no namespace).


convertToFloat

protected float convertToFloat(java.lang.String val)
Convert string val to float. returns 0 in errors.


getLocalname

protected java.lang.String getLocalname(java.lang.String tagname)

translate

protected Point3D translate(float left,
                            float top,
                            float front)
Calculate matrix translation. Uses child elements translate, rotate, scale, in the order in the DOM.


destroy

public void destroy()
Destroy this element.

Overrides:
destroy in class XSmilesElementImpl

getClassName

public java.lang.String getClassName()
The class attribute. This method should be called getClass, but it is already reserved by java.lang.Object.

Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly.

setClassName

public void setClassName(java.lang.String cl)
                  throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getComponent

public java.awt.Component getComponent()
Return the visual component for this extension element

Specified by:
getComponent in interface VisualComponentService

getSize

public java.awt.Dimension getSize()
Returns the approximate size of this extension element

Specified by:
getSize in interface VisualComponentService

setZoom

public void setZoom(double zoom)
Specified by:
setZoom in interface VisualComponentService

run

public void run()
Specified by:
run in interface java.lang.Runnable

setVisible

public void setVisible(boolean v)
Specified by:
setVisible in interface VisualComponentService

getVisible

public boolean getVisible()
Specified by:
getVisible in interface VisualComponentService


X-Smiles 1.2