javax.media.j3d
Class MediaContainer

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.NodeComponent
              |
              +--javax.media.j3d.MediaContainer

public class MediaContainer
extends NodeComponent

The MediaContainer object defines all sound data: cached state flag, and associated sound data. Currently this references the media in the form of a URL path to the sound data. In future releases this will include references to Java Media Player objects.


Field Summary
static int ALLOW_CACHE_READ
          For MediaContainer component objects, specifies that this object allows the reading of its cached flag.
static int ALLOW_CACHE_WRITE
          For MediaContainer component objects, specifies that this object allows the writing of its cached flag.
static int ALLOW_URL_READ
          For MediaContainer component objects, specifies that this object allows the reading of it's sound data.
static int ALLOW_URL_WRITE
          For MediaContainer component objects, specifies that this object allows the writing of it's URL path.
 
Constructor Summary
MediaContainer()
          Constructs a MediaContainer object with default parameters.
MediaContainer(java.lang.String path)
          Constructs and initializes a MediaContainer object using specified parameters
MediaContainer(java.net.URL url)
          Constructs and initializes a MediaContainer object using specified parameters
 
Method Summary
 NodeComponent cloneNodeComponent()
          Creates a new MediaContainer object.
 void duplicateNodeComponent(NodeComponent originalNodeComponent)
          Copies the information found in originalNodeComponent to the current node.
 boolean getCacheEnable()
          Retrieve Cache Enable state flag
 java.lang.String getURL()
          Retrieve URL
 void setCacheEnable(boolean flag)
          Set Cache Enable state flag Allows the writing of sound data explicitly into the MediaContainer rather than just referencing a JavaMedia container.
 void setURL(java.lang.String path)
          Set URL
 void setURL(java.net.URL url)
          Set URL
 
Methods inherited from class javax.media.j3d.NodeComponent
getDuplicateOnCloneTree, setDuplicateOnCloneTree
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_CACHE_READ

public static final int ALLOW_CACHE_READ
For MediaContainer component objects, specifies that this object allows the reading of its cached flag.

ALLOW_CACHE_WRITE

public static final int ALLOW_CACHE_WRITE
For MediaContainer component objects, specifies that this object allows the writing of its cached flag.

ALLOW_URL_READ

public static final int ALLOW_URL_READ
For MediaContainer component objects, specifies that this object allows the reading of it's sound data.

ALLOW_URL_WRITE

public static final int ALLOW_URL_WRITE
For MediaContainer component objects, specifies that this object allows the writing of it's URL path.
Constructor Detail

MediaContainer

public MediaContainer()
Constructs a MediaContainer object with default parameters. The default values are as follows:

MediaContainer

public MediaContainer(java.lang.String path)
Constructs and initializes a MediaContainer object using specified parameters
Parameters:
path - string of URL path containing sound data

MediaContainer

public MediaContainer(java.net.URL url)
Constructs and initializes a MediaContainer object using specified parameters
Parameters:
url - URL path containing sound data
Method Detail

setCacheEnable

public final void setCacheEnable(boolean flag)
Set Cache Enable state flag Allows the writing of sound data explicitly into the MediaContainer rather than just referencing a JavaMedia container.
Parameters:
flag - boolean denoting if sound data is cached in this instance
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getCacheEnable

public final boolean getCacheEnable()
Retrieve Cache Enable state flag
Returns:
flag denoting is sound data is non-cached or cached.
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

setURL

public final void setURL(java.lang.String path)
Set URL
Parameters:
path - string of URL containing sound data
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph
SoundException - if URL is bad

setURL

public final void setURL(java.net.URL url)
Set URL
Parameters:
url - URL containing sound data
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getURL

public final java.lang.String getURL()
Retrieve URL
Returns:
string of URL containing sound data
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

cloneNodeComponent

public NodeComponent cloneNodeComponent()
Creates a new MediaContainer object. Called from a Leaf node's duplicateNode method.
Overrides:
cloneNodeComponent in class NodeComponent
Returns:
a duplicate of the MediaContainer object.
See Also:
Node.duplicateNode(javax.media.j3d.Node, boolean), Node.cloneTree(), NodeComponent.setDuplicateOnCloneTree(boolean)

duplicateNodeComponent

public void duplicateNodeComponent(NodeComponent originalNodeComponent)
Copies the information found in originalNodeComponent to the current node. This routine is called as part of the cloneNodeComponent operation.
Overrides:
duplicateNodeComponent in class NodeComponent
Parameters:
originalNodeComponent - the node to duplicate.
See Also:
Node.cloneTree(), Node.cloneNode(boolean), NodeComponent.duplicateNodeComponent(javax.media.j3d.NodeComponent), NodeComponent.setDuplicateOnCloneTree(boolean)