|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.utils.universe.Viewer
public class Viewer
The Viewer class holds all the information that describes the physical and virtual "presence" in the Java 3D universe. The Viewer object consists of:
Canvas3D
,
PhysicalEnvironment
,
PhysicalBody
,
View
,
ViewerAvatar
Field Summary | |
---|---|
private ViewerAvatar |
avatar
|
private Canvas3D[] |
canvases
|
private static boolean |
debug
|
private boolean |
doDvr
|
private boolean |
doDvrResizeCompensation
|
private float |
dvrFactor
|
private javax.swing.JFrame[] |
j3dJFrames
|
private javax.swing.JPanel[] |
j3dJPanels
|
private java.awt.Window[] |
j3dWindows
|
private static PhysicalBody |
physicalBody
|
private static PhysicalEnvironment |
physicalEnvironment
|
private View |
view
|
(package private) static java.util.HashMap |
viewerMap
|
private ViewingPlatform |
viewingPlatform
|
Constructor Summary | |
---|---|
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(ConfigScreen[] cs,
ConfigView cv,
boolean setVisible)
Package-scoped constructor to create a Viewer from the configuration objects provided by ConfiguredUniverse. |
|
Viewer(java.net.URL userConfig)
Deprecated. create a ConfiguredUniverse to use a configuration file |
Method Summary | |
---|---|
(package private) void |
addWindowCloseListener(java.awt.Window win)
|
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. |
private void |
createFramesAndPanels(boolean setVisible)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean debug
private static PhysicalBody physicalBody
private static PhysicalEnvironment physicalEnvironment
private View view
private ViewerAvatar avatar
private Canvas3D[] canvases
private javax.swing.JFrame[] j3dJFrames
private javax.swing.JPanel[] j3dJPanels
private java.awt.Window[] j3dWindows
private ViewingPlatform viewingPlatform
static java.util.HashMap viewerMap
private float dvrFactor
private boolean doDvr
private boolean doDvrResizeCompensation
Constructor Detail |
---|
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 ignoredViewer(ConfigScreen[] cs, ConfigView cv, boolean setVisible)
cs
- array of ConfigScreen objects containing configuration
information for the physical screens in the environmentcv
- ConfigView object containing configuration information about
the view to be created using the given screenssetVisible
- if true, call setVisible(true) on all created Window
components; otherwise, they remain invisibleMethod Detail |
---|
public 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()
private void createFramesAndPanels(boolean setVisible)
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 returned
public 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 returned
public 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 returned
public javax.swing.JPanel[] getJPanels()
public AudioDevice createAudioDevice()
public SimpleUniverse getUniverse()
void addWindowCloseListener(java.awt.Window win)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |