|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.NodeComponent
javax.media.j3d.MediaContainer
public class MediaContainer
The MediaContainer object defines all sound data: cached state flag, and
associated sound media. Currently this references the sound media in
one of three forms: URL String, URL object, or InputStream object.
In future releases media data will include references to Java Media
Player objects.
Only one type of sound media data specified using
setURLString
, setURLObject
,
or setInputStream
may be
non-null (or they may all be null). An attempt to set more
than one of these attributes to a non-null reference will
result in an exception being thrown. If all sound media data
references are null, there is no sound associated with this
MediaContainer and Sound nodes referencing this object cannot
be played.
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. |
private static int[] |
readCapabilities
|
Fields inherited from class javax.media.j3d.NodeComponent |
---|
forceDuplicate |
Fields inherited from class javax.media.j3d.SceneGraphObject |
---|
nodeHashtable, retained |
Constructor Summary | |
---|---|
MediaContainer()
Constructs a MediaContainer object with default parameters. |
|
MediaContainer(java.io.InputStream stream)
Constructs and initializes a MediaContainer object using specified 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()
Deprecated. As of Java 3D version 1.2, replaced with cloneNodeComponent(boolean forceDuplicate) |
(package private) void |
createRetained()
Creates the retained mode MediaContainerRetained object that this component object will point to. |
(package private) void |
duplicateAttributes(NodeComponent originalNodeComponent,
boolean forceDuplicate)
Copies all MediaContainer information from originalNodeComponent into
the current node. |
boolean |
getCacheEnable()
Retrieve Cache Enable state flag. |
java.io.InputStream |
getInputStream()
Retrieve Input Stream. |
java.lang.String |
getURL()
Deprecated. As of Java 3D version 1.2, replaced by getURLString |
java.net.URL |
getURLObject()
Retrieve URL Object. |
java.lang.String |
getURLString()
Retrieve URL String. |
void |
setCacheEnable(boolean flag)
Set Cache Enable state flag. |
void |
setInputStream(java.io.InputStream stream)
Set Input Stream. |
void |
setURL(java.lang.String path)
Deprecated. As of Java 3D version 1.2, replaced by setURLString |
void |
setURL(java.net.URL url)
Deprecated. As of Java 3D version 1.2, replaced by setURLObject |
void |
setURLObject(java.net.URL url)
Set URL Object. |
void |
setURLString(java.lang.String path)
Set URL String. |
Methods inherited from class javax.media.j3d.NodeComponent |
---|
checkDuplicateNodeComponent, cloneNodeComponent, duplicateChild, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree, validateImageIllegalSharing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ALLOW_CACHE_READ
public static final int ALLOW_CACHE_WRITE
public static final int ALLOW_URL_READ
public static final int ALLOW_URL_WRITE
private static final int[] readCapabilities
Constructor Detail |
---|
public MediaContainer()
public MediaContainer(java.lang.String path)
path
- string of URL path containing sound data
SoundException
- if the URL is not valid or cannot be openedpublic MediaContainer(java.net.URL url)
url
- URL path containing sound data
SoundException
- if the URL is not valid or cannot be openedpublic MediaContainer(java.io.InputStream stream)
stream
- input stream containing sound dataMethod Detail |
---|
void createRetained()
createRetained
in class NodeComponent
public void setCacheEnable(boolean flag)
flag
- boolean denoting if sound data is cached in this instance
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic boolean getCacheEnable()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setURL(java.lang.String path)
setURLString
public void setURL(java.net.URL url)
setURLObject
public void setURLString(java.lang.String path)
path
- string of URL containing sound data
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
SoundException
- if the URL is not valid or cannot be opened
java.lang.IllegalArgumentException
- if the specified sound data is
non-null and any other sound data reference is also non-null.public void setURLObject(java.net.URL url)
url
- URL object containing sound data
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
SoundException
- if the URL is not valid or cannot be opened
java.lang.IllegalArgumentException
- if the specified sound data is
non-null and any other sound data reference is also non-null.public void setInputStream(java.io.InputStream stream)
stream
- input stream object containing sound data
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
SoundException
- if InputStream is bad
java.lang.IllegalArgumentException
- if the specified sound data is
non-null and any other sound data reference is also non-null.public java.lang.String getURL()
getURLString
public java.lang.String getURLString()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic java.net.URL getURLObject()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic java.io.InputStream getInputStream()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic NodeComponent cloneNodeComponent()
cloneNodeComponent(boolean forceDuplicate)
cloneNodeComponent
in class NodeComponent
void duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate)
originalNodeComponent
into
the current node. This method is called from the
cloneNodeComponent
method and duplicateNodeComponent
method which is, in turn, called by the
cloneTree
method.
duplicateAttributes
in class NodeComponent
originalNodeComponent
- the original node component to duplicate.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node component's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.
RestrictedAccessException
- if this object is part of a live
or compiled scenegraph.Node.cloneTree()
,
NodeComponent.setDuplicateOnCloneTree(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |