com.sun.j3d.utils.universe
public class Viewer extends java.lang.Object
Canvas3D
,
PhysicalEnvironment
,
PhysicalBody
,
View
,
ViewerAvatar
Constructor and Description |
---|
Viewer()
Creates a default viewer object.
|
Viewer(Canvas3D userCanvas)
Creates a default viewer object.
|
Viewer(Canvas3D[] userCanvases)
Creates a default viewer object.
|
Viewer(Canvas3D[] userCanvases,
PhysicalBody userBody,
PhysicalEnvironment userEnvironment,
boolean setVisible)
Creates a viewer object.
|
Viewer(Canvas3D userCanvas,
java.net.URL userConfig)
Deprecated.
create a ConfiguredUniverse to use a configuration file
|
Viewer(java.net.URL userConfig)
Deprecated.
create a ConfiguredUniverse to use a configuration file
|
Modifier and Type | Method and Description |
---|---|
static void |
clearViewerMap()
Removes all Viewer mappings from the Viewer map.
|
AudioDevice |
createAudioDevice()
Used to create and initialize a default AudioDevice3D used for sound
rendering.
|
ViewerAvatar |
getAvatar()
Gets the geometry associated with the viewer's avatar.
|
Canvas3D |
getCanvas3D()
Returns the 0th Canvas3D object associated with this Viewer object
|
Canvas3D |
getCanvas3D(int canvasNum)
Returns the Canvas3D object at the specified index associated with
this Viewer object.
|
Canvas3D[] |
getCanvas3Ds()
Returns all the Canvas3D objects associated with this Viewer object.
|
Canvas3D |
getCanvases()
Deprecated.
superceded by getCanvas3D()
|
float |
getDvrFactor()
Retrieves the dynamic video resize factor of this
viewer.
|
boolean |
getDvrResizeCompensationEnable()
Returns a status flag indicating whether or not dynamic video resize
compensation is enabled.
|
java.awt.Frame |
getFrame()
Deprecated.
AWT Frame components are no longer created by the
Viewer class.
|
javax.swing.JFrame |
getJFrame(int frameNum)
Returns the JFrame object created by this Viewer object at the
specified index.
|
javax.swing.JFrame[] |
getJFrames()
Returns all the JFrames created by this Viewer object.
|
javax.swing.JPanel |
getJPanel(int panelNum)
Returns the JPanel object created by this Viewer object at the
specified index.
|
javax.swing.JPanel[] |
getJPanels()
Returns all the JPanel objects created by this Viewer object.
|
java.awt.Panel |
getPanel()
Deprecated.
AWT Panel components are no longer created by the
Viewer class.
|
PhysicalBody |
getPhysicalBody()
Returns the PhysicalBody object associated with the Viewer object.
|
PhysicalEnvironment |
getPhysicalEnvironment()
Returns the PhysicalEnvironment object associated with the Viewer
object.
|
SimpleUniverse |
getUniverse()
Returns the Universe to which this Viewer is attached
|
View |
getView()
Returns the View object associated with the Viewer object.
|
static Viewer |
getViewer(View view)
Get the Viewer associated with the view object.
|
ViewingPlatform |
getViewingPlatform()
Get the ViewingPlatform object used by this Viewer.
|
boolean |
isDvrEnabled()
Returns a status flag indicating whether or not dynamic video size
is enabled.
|
static Viewer |
removeViewerMapEntry(View view)
Removes the entry associated with the view object.
|
void |
setAvatar(ViewerAvatar avatar)
Sets the geometry to be associated with the viewer's avatar.
|
void |
setDvrEnable(boolean dvr)
Turns on or off dynamic video size.
|
void |
setDvrFactor(float dvr)
Set the dynamic video resize factor for this viewer.
|
void |
setDvrResizeCompensationEnable(boolean dvrRCE)
Turns on or off dynamic video resize compensation.
|
void |
setViewingPlatform(ViewingPlatform platform)
Set the ViewingPlatform object used by this Viewer.
|
void |
setVisible(boolean visible)
Call setVisible() on all Window components created by this Viewer.
|
public Viewer()
public Viewer(Canvas3D userCanvas)
userCanvas
- the Canvas3D object to be used for rendering;
if this is null then a single RGB, double buffered and depth buffered
Canvas3D object is createdpublic Viewer(Canvas3D[] userCanvases)
userCanvases
- the Canvas3D objects to be used for rendering;
if this is null then a single RGB, double buffered and depth buffered
Canvas3D object is createdpublic Viewer(Canvas3D[] userCanvases, PhysicalBody userBody, PhysicalEnvironment userEnvironment, boolean setVisible)
userCanvases
- the Canvas3D objects to be used for rendering;
if this is null then a single RGB, double buffered and depth buffered
Canvas3D object is createduserBody
- the PhysicalBody to use for this Viewer; if it is
null, a default PhysicalBody object is createduserEnvironment
- the PhysicalEnvironment to use for this Viewer;
if it is null, a default PhysicalEnvironment object is createdsetVisible
- determines if the Frames should be set to visible once createdpublic Viewer(java.net.URL userConfig)
userConfig
- the URL of the user configuration file used to
initialize the PhysicalBody object; this is always ignoredpublic Viewer(Canvas3D userCanvas, java.net.URL userConfig)
userCanvas
- the Canvas3D object to be used for rendering;
if this is null then a single RGB, double buffered and depth buffered
Canvas3D object is createduserConfig
- the URL of the user configuration file used to
initialize the PhysicalBody object; this is always ignoredpublic static Viewer getViewer(View view)
view
- The View object for inquiry.public static Viewer removeViewerMapEntry(View view)
view
- The View object to be removed.public static void clearViewerMap()
public boolean isDvrEnabled()
public void setDvrEnable(boolean dvr)
dvr
- enables or disables dynamic video size.public float getDvrFactor()
public void setDvrFactor(float dvr)
dvr
- set the dynamic video resize factor for this viewer.public void setDvrResizeCompensationEnable(boolean dvrRCE)
dvrRCE
- enables or disables dynamic video resize compensation.public boolean getDvrResizeCompensationEnable()
public void setVisible(boolean visible)
visible
- boolean to be passed to the setVisible() calls on the
Window components created by this Viewerpublic View getView()
public void setViewingPlatform(ViewingPlatform platform)
platform
- The ViewingPlatform object to set for this
Viewer object. Use null to unset the current value and
not assign assign a new ViewingPlatform object.public ViewingPlatform getViewingPlatform()
public void setAvatar(ViewerAvatar avatar)
avatar
- The geometry to associate with this Viewer object.
Passing in null will cause any geometry associated with the Viewer
to be removed from the scen graph.public ViewerAvatar getAvatar()
public PhysicalBody getPhysicalBody()
public PhysicalEnvironment getPhysicalEnvironment()
public Canvas3D getCanvas3D()
public Canvas3D getCanvas3D(int canvasNum)
canvasNum
- the index of the Canvas3D object to retrieve;
if there is no Canvas3D object for the given index, null is returnedpublic Canvas3D[] getCanvas3Ds()
public Canvas3D getCanvases()
public java.awt.Frame getFrame()
java.lang.UnsupportedOperationException
- if called.public javax.swing.JFrame getJFrame(int frameNum)
NOTE: When running under JDK 1.4 or newer, the JFrame always directly contains the JPanel which contains the Canvas3D. When running under JDK 1.3.1 and creating a borderless full screen through a configuration file, the JFrame will instead contain a JWindow which will contain the JPanel and Canvas3D.
frameNum
- the index of the JFrame object to retrieve;
if there is no JFrame object for the given index, null is returnedpublic javax.swing.JFrame[] getJFrames()
NOTE: When running under JDK 1.4 or newer, the JFrame always directly contains the JPanel which contains the Canvas3D. When running under JDK 1.3.1 and creating a borderless full screen through a configuration file, the JFrame will instead contain a JWindow which will contain the JPanel and Canvas3D.
public java.awt.Panel getPanel()
java.lang.UnsupportedOperationException
- if called.public javax.swing.JPanel getJPanel(int panelNum)
panelNum
- the index of the JPanel object to retrieve;
if there is no JPanel object for the given index, null is returnedpublic javax.swing.JPanel[] getJPanels()
public AudioDevice createAudioDevice()
public SimpleUniverse getUniverse()
Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.