public class MediaContainer extends NodeComponent
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.Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
MediaContainer()
Constructs a MediaContainer object with default parameters.
|
MediaContainer(InputStream stream)
Constructs and initializes a MediaContainer object using specified
parameters.
|
MediaContainer(String path)
Constructs and initializes a MediaContainer object using specified
parameters.
|
MediaContainer(URL url)
Constructs and initializes a MediaContainer object using specified
parameters.
|
Modifier and Type | Method and Description |
---|---|
NodeComponent |
cloneNodeComponent()
Deprecated.
As of Java 3D version 1.2, replaced with
cloneNodeComponent(boolean forceDuplicate) |
boolean |
getCacheEnable()
Retrieve Cache Enable state flag.
|
InputStream |
getInputStream()
Retrieve Input Stream.
|
String |
getURL()
Deprecated.
As of Java 3D version 1.2, replaced by
getURLString |
URL |
getURLObject()
Retrieve URL Object.
|
String |
getURLString()
Retrieve URL String.
|
void |
setCacheEnable(boolean flag)
Set Cache Enable state flag.
|
void |
setInputStream(InputStream stream)
Set Input Stream.
|
void |
setURL(String path)
Deprecated.
As of Java 3D version 1.2, replaced by
setURLString |
void |
setURL(URL url)
Deprecated.
As of Java 3D version 1.2, replaced by
setURLObject |
void |
setURLObject(URL url)
Set URL Object.
|
void |
setURLString(String path)
Set URL String.
|
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
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
public MediaContainer()
public MediaContainer(String path)
path
- string of URL path containing sound dataSoundException
- if the URL is not valid or cannot be openedpublic MediaContainer(URL url)
url
- URL path containing sound dataSoundException
- if the URL is not valid or cannot be openedpublic MediaContainer(InputStream stream)
stream
- input stream containing sound datapublic void setCacheEnable(boolean flag)
flag
- boolean denoting if sound data is cached in this instanceCapabilityNotSetException
- 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(String path)
setURLString
public void setURL(URL url)
setURLObject
public void setURLString(String path)
path
- string of URL containing sound dataCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphSoundException
- if the URL is not valid or cannot be openedIllegalArgumentException
- if the specified sound data is
non-null and any other sound data reference is also non-null.public void setURLObject(URL url)
url
- URL object containing sound dataCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphSoundException
- if the URL is not valid or cannot be openedIllegalArgumentException
- if the specified sound data is
non-null and any other sound data reference is also non-null.public void setInputStream(InputStream stream)
stream
- input stream object containing sound dataCapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphSoundException
- if InputStream is badIllegalArgumentException
- if the specified sound data is
non-null and any other sound data reference is also non-null.public String getURL()
getURLString
public String getURLString()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic URL getURLObject()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic 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
Copyright © 2016–2022 SciJava. All rights reserved.