public class Viewer extends 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,
URL userConfig)
Deprecated.
create a ConfiguredUniverse to use a configuration file
|
Viewer(URL userConfig)
Deprecated.
create a ConfiguredUniverse to use a configuration file
|
Modifier and Type | Method and Description |
---|---|
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()
|
Frame |
getFrame()
Deprecated.
AWT Frame components are no longer created by the
Viewer class.
|
JFrame |
getJFrame(int frameNum)
Returns the JFrame object created by this Viewer object at the
specified index.
|
JFrame[] |
getJFrames()
Returns all the JFrames created by this Viewer object.
|
JPanel |
getJPanel(int panelNum)
Returns the JPanel object created by this Viewer object at the
specified index.
|
JPanel[] |
getJPanels()
Returns all the JPanel objects created by this Viewer object.
|
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.
|
ViewingPlatform |
getViewingPlatform()
Get the ViewingPlatform object used by this Viewer.
|
void |
setAvatar(ViewerAvatar avatar)
Sets the geometry to be associated with the viewer's avatar.
|
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(URL userConfig)
userConfig
- the URL of the user configuration file used to
initialize the PhysicalBody object; this is always ignoredpublic Viewer(Canvas3D userCanvas, 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 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 Frame getFrame()
UnsupportedOperationException
- if called.public 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 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 Panel getPanel()
UnsupportedOperationException
- if called.public 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 JPanel[] getJPanels()
public AudioDevice createAudioDevice()
public SimpleUniverse getUniverse()
Copyright © 2016–2022 SciJava. All rights reserved.