| |
|
| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.NodeComponent javax.media.j3d.MediaContainer
MediaContainer | public class MediaContainer extends NodeComponent (Code) | | 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 | |
final public static int | ALLOW_CACHE_READ For MediaContainer component objects, specifies that this object
allows the reading of its cached flag. | final public static int | ALLOW_CACHE_WRITE For MediaContainer component objects, specifies that this object
allows the writing of its cached flag. | final public static int | ALLOW_URL_READ For MediaContainer component objects, specifies that this object
allows the reading of it's sound data. | final public static int | ALLOW_URL_WRITE For MediaContainer component objects, specifies that this object
allows the writing of it's URL path. |
Constructor Summary | |
public | MediaContainer() Constructs a MediaContainer object with default parameters. | public | MediaContainer(String path) Constructs and initializes a MediaContainer object using specified
parameters. | public | MediaContainer(URL url) Constructs and initializes a MediaContainer object using specified
parameters. | public | MediaContainer(InputStream stream) Constructs and initializes a MediaContainer object using specified
parameters. |
ALLOW_CACHE_READ | final public static int ALLOW_CACHE_READ(Code) | | For MediaContainer component objects, specifies that this object
allows the reading of its cached flag.
|
ALLOW_CACHE_WRITE | final public static int ALLOW_CACHE_WRITE(Code) | | For MediaContainer component objects, specifies that this object
allows the writing of its cached flag.
|
ALLOW_URL_READ | final public static int ALLOW_URL_READ(Code) | | For MediaContainer component objects, specifies that this object
allows the reading of it's sound data.
|
ALLOW_URL_WRITE | final public static int ALLOW_URL_WRITE(Code) | | For MediaContainer component objects, specifies that this object
allows the writing of it's URL path.
|
MediaContainer | public MediaContainer()(Code) | | Constructs a MediaContainer object with default parameters.
The default values are as follows:
URL String data : null
URL object data : null
InputStream data : null
cache enable : true
|
MediaContainer | public MediaContainer(String path)(Code) | | Constructs and initializes a MediaContainer object using specified
parameters.
Parameters: path - string of URL path containing sound data exception: SoundException - if the URL is not valid or cannot be opened |
MediaContainer | public MediaContainer(URL url)(Code) | | Constructs and initializes a MediaContainer object using specified
parameters.
Parameters: url - URL path containing sound data exception: SoundException - if the URL is not valid or cannot be opened |
MediaContainer | public MediaContainer(InputStream stream)(Code) | | Constructs and initializes a MediaContainer object using specified
parameters.
Parameters: stream - input stream containing sound data since: Java 3D 1.2 |
createRetained | void createRetained()(Code) | | Creates the retained mode MediaContainerRetained object that this
component object will point to.
|
duplicateAttributes | void duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate)(Code) | | Copies all MediaContainer information from
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.
Parameters: originalNodeComponent - the original node component to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node component'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getCacheEnable | public boolean getCacheEnable()(Code) | | Retrieve Cache Enable state flag.
flag denoting is sound data is non-cached or cached exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
getInputStream | public InputStream getInputStream()(Code) | | Retrieve Input Stream.
reference to input stream containing sound data exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
getURLObject | public URL getURLObject()(Code) | | Retrieve URL Object.
URL containing sound data exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
getURLString | public String getURLString()(Code) | | Retrieve URL String.
string of URL containing sound data exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
setCacheEnable | public void setCacheEnable(boolean flag)(Code) | | 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 exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
setInputStream | public void setInputStream(InputStream stream)(Code) | | Set Input Stream.
Parameters: stream - input stream object containing sound data exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph exception: SoundException - if InputStream is bad exception: IllegalArgumentException - if the specified sound data isnon-null and any other sound data reference is also non-null. since: Java 3D 1.2 |
setURLObject | public void setURLObject(URL url)(Code) | | Set URL Object.
Parameters: url - URL object containing sound data exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph exception: SoundException - if the URL is not valid or cannot be opened exception: IllegalArgumentException - if the specified sound data isnon-null and any other sound data reference is also non-null. since: Java 3D 1.2 |
setURLString | public void setURLString(String path)(Code) | | Set URL String.
Parameters: path - string of URL containing sound data exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph exception: SoundException - if the URL is not valid or cannot be opened exception: IllegalArgumentException - if the specified sound data isnon-null and any other sound data reference is also non-null. since: Java 3D 1.2 |
Fields inherited from javax.media.j3d.NodeComponent | boolean forceDuplicate(Code)(Java Doc)
|
|
|
|