|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Browser
This interface is used to access, replace and create X3DScene's, and also provides methods to load resources.
To access the Browser object associated with a 3D Scene, you access the 3D Scene Wob through calls to
getParent and getChild and cast the Wob to Browser.
Example:
In a Java Object located in the same Scene
as a 3D Scene Object named "Your 3D Scene", the Browser for the 3D Scene would be accessed by:
Browser browser = (Browser) getParent().getChild("Your 3D Scene");
| Method Summary | |
|---|---|
java.io.InputStream |
getResource(java.net.URL url)
Retrieves an InputStream of the resource specified by the URL. |
X3DScene |
getScene()
Retrieves the X3D scene that is active in the Browser display. |
X3DScene |
loadScene(java.lang.String sceneFileName)
Loads and creates a X3D scene. |
Texture3D |
loadTexture(java.lang.String textureImageFileName,
java.lang.String alphaImageFileName)
Loads a texture with the specified texture image file name and alpha image file name. |
void |
replaceScene(X3DScene newScene)
Replaces the X3D scene. |
| Method Detail |
|---|
java.io.InputStream getResource(java.net.URL url)
url - The URL for the resourceX3DScene getScene()
X3DScene loadScene(java.lang.String sceneFileName)
sceneFileName - the name of the file to load.
Texture3D loadTexture(java.lang.String textureImageFileName,
java.lang.String alphaImageFileName)
aTextureNode.getField(Texture.image).set(myBrowser.loadTexture("myImage.jpg"))
Specifying an empty string or null for either the texture or the alpha file name will load a texture without the respective texture or alpha.
textureImageFileName - the name of the texture image file to load.alphaImageFileName - the name of the alpha image file to load.
void replaceScene(X3DScene newScene)
newScene - the new X3D scene to be used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||