| java.lang.Object javax.media.j3d.VirtualUniverse com.sun.j3d.utils.universe.SimpleUniverse
All known Subclasses: com.sun.j3d.utils.universe.ConfiguredUniverse, org.jdesktop.j3dedit.interposer.InterposerUniverse,
SimpleUniverse | public class SimpleUniverse extends VirtualUniverse (Code) | | This class sets up a minimal user environment to quickly and easily
get a Java 3D program up and running. This utility class creates
all the necessary objects on the "view" side of the scene graph.
Specifically, this class creates a locale, a single ViewingPlatform,
and a Viewer object (both with their default values).
Many basic Java 3D applications
will find that SimpleUniverse provides all necessary functionality
needed by their applications. More sophisticated applications
may find that they need more control in order to get extra functionality
and will not be able to use this class.
See Also: Viewer See Also: ViewingPlatform |
Field Summary | |
protected Locale | locale Locale reference needed to create the "view" portion
of the scene graph. | protected Viewer[] | viewer Viewer reference needed to create the "view" portion
of the scene graph. |
Constructor Summary | |
public | SimpleUniverse() Creates a locale, a single ViewingPlatform, and
and a Viewer object (both with their default values). | public | SimpleUniverse(int numTransforms) Creates a locale, a single ViewingPlatform, and a Viewer object
(with default values). | public | SimpleUniverse(Canvas3D canvas) Creates a locale, a single ViewingPlatform (with default values), and
and a Viewer object. | public | SimpleUniverse(Canvas3D canvas, int numTransforms) Creates a locale, a single ViewingPlatform, and a Viewer object
The Viewer object uses default values for everything but the canvas.
The ViewingPlatform is created with the specified number of
TransformGroups.
Parameters: canvas - The canvas to associate with the Viewer object. | public | SimpleUniverse(Canvas3D canvas, int numTransforms, LocaleFactory localeFactory) Creates a locale, a single ViewingPlatform, and a Viewer object
The Viewer object uses default values for everything but the canvas.
The ViewingPlatform is created with the specified number of
TransformGroups.
Parameters: canvas - The canvas to associate with the Viewer object. | public | SimpleUniverse(HiResCoord origin, int numTransforms, Canvas3D canvas, URL userConfig) Creates the "view" side of the scene graph. | public | SimpleUniverse(HiResCoord origin, int numTransforms, Canvas3D canvas, URL userConfig, LocaleFactory localeFactory) Creates the "view" side of the scene graph. | public | SimpleUniverse(ViewingPlatform viewingPlatform, Viewer viewer) Creates the "view" side of the scene graph. | public | SimpleUniverse(ViewingPlatform viewingPlatform, Viewer viewer, LocaleFactory localeFactory) Creates the "view" side of the scene graph. | | SimpleUniverse(HiResCoord origin, LocaleFactory localeFactory) |
Method Summary | |
public void | addBranchGraph(BranchGroup bg) Used to add Nodes to the geometry side (as opposed to the view side)
of the scene graph. | public void | cleanup() Cleanup memory use and reference by SimpleUniverse. | public Canvas3D | getCanvas() Returns the Canvas3D object associated with this Java 3D Universe.
A reference to the Canvas3D object associated with theViewer object. | public Canvas3D | getCanvas(int canvasNum) Returns the Canvas3D object at the specified index associated with
this Java 3D Universe.
Parameters: canvasNum - The index of the Canvas3D object to retrieve.If there is no Canvas3D object for the given index, null is returned. | public Locale | getLocale() Returns the Locale object associated with this scene graph. | public static GraphicsConfiguration | getPreferredConfiguration() Finds the preferred GraphicsConfiguration object
for the system. | public Viewer | getViewer() Returns the Viewer object associated with this scene graph. | public ViewingPlatform | getViewingPlatform() Returns the ViewingPlatform object associated with this scene graph. |
locale | protected Locale locale(Code) | | Locale reference needed to create the "view" portion
of the scene graph.
|
viewer | protected Viewer[] viewer(Code) | | Viewer reference needed to create the "view" portion
of the scene graph.
|
SimpleUniverse | public SimpleUniverse()(Code) | | Creates a locale, a single ViewingPlatform, and
and a Viewer object (both with their default values).
See Also: Locale See Also: Viewer See Also: ViewingPlatform |
SimpleUniverse | public SimpleUniverse(int numTransforms)(Code) | | Creates a locale, a single ViewingPlatform, and a Viewer object
(with default values). The ViewingPlatform is created with the
specified number of TransformGroups.
Parameters: numTransforms - The number of transforms to be in theMultiTransformGroup object. See Also: Locale See Also: Viewer See Also: ViewingPlatform since: Java 3D 1.2.1 |
SimpleUniverse | public SimpleUniverse(Canvas3D canvas)(Code) | | Creates a locale, a single ViewingPlatform (with default values), and
and a Viewer object. The Viewer object uses default values for
everything but the canvas.
Parameters: canvas - The canvas to associate with the Viewer object. Passingin null will cause this parameter to be ignored and a canvas to becreated by the utility. See Also: Locale See Also: Viewer See Also: ViewingPlatform |
SimpleUniverse | public SimpleUniverse(Canvas3D canvas, int numTransforms)(Code) | | Creates a locale, a single ViewingPlatform, and a Viewer object
The Viewer object uses default values for everything but the canvas.
The ViewingPlatform is created with the specified number of
TransformGroups.
Parameters: canvas - The canvas to associate with the Viewer object. Passingin null will cause this parameter to be ignored and a canvas to becreated by the utility. Parameters: numTransforms - The number of transforms to be in theMultiTransformGroup object. See Also: Locale See Also: Viewer See Also: ViewingPlatform See Also: MultiTransformGroup since: Java 3D 1.2.1 |
SimpleUniverse | public SimpleUniverse(Canvas3D canvas, int numTransforms, LocaleFactory localeFactory)(Code) | | Creates a locale, a single ViewingPlatform, and a Viewer object
The Viewer object uses default values for everything but the canvas.
The ViewingPlatform is created with the specified number of
TransformGroups.
Parameters: canvas - The canvas to associate with the Viewer object. Passingin null will cause this parameter to be ignored and a canvas to becreated by the utility. Parameters: numTransforms - The number of transforms to be in theMultiTransformGroup object. Parameters: localeFactory - Factory for creating the locale See Also: Locale See Also: Viewer See Also: ViewingPlatform See Also: MultiTransformGroup since: Java 3D 1.5.1 |
SimpleUniverse | public SimpleUniverse(HiResCoord origin, int numTransforms, Canvas3D canvas, URL userConfig)(Code) | | Creates the "view" side of the scene graph. The passed in parameters
override the default values where appropriate.
Parameters: origin - The origin used to set the origin of the Locale object.If this object is null, then 0.0 is used. Parameters: numTransforms - The number of transforms to be in theMultiTransformGroup object. Parameters: canvas - The canvas to draw into. If this is null, it isignored and a canvas will be created by the utility. Parameters: userConfig - The URL to the user's configuration file, usedby the Viewer object. This is never examined and default values arealways taken. See Also: Locale See Also: Viewer See Also: ViewingPlatform See Also: MultiTransformGroup |
SimpleUniverse | public SimpleUniverse(HiResCoord origin, int numTransforms, Canvas3D canvas, URL userConfig, LocaleFactory localeFactory)(Code) | | Creates the "view" side of the scene graph. The passed in parameters
override the default values where appropriate.
Parameters: origin - The origin used to set the origin of the Locale object.If this object is null, then 0.0 is used. Parameters: numTransforms - The number of transforms to be in theMultiTransformGroup object. Parameters: canvas - The canvas to draw into. If this is null, it isignored and a canvas will be created by the utility. Parameters: userConfig - The URL to the user's configuration file, usedby the Viewer object. This is never examined and default values arealways taken. Parameters: localeFactory - The Locale Factory which will instantiate thelocale(s) for this universe. See Also: Locale See Also: Viewer See Also: ViewingPlatform See Also: MultiTransformGroup |
SimpleUniverse | public SimpleUniverse(ViewingPlatform viewingPlatform, Viewer viewer)(Code) | | Creates the "view" side of the scene graph. The passed in parameters
override the default values where appropriate.
Parameters: viewingPlatform - The viewingPlatform to use to createthe "view" side of the scene graph. Parameters: viewer - The viewer object to use to createthe "view" side of the scene graph. |
SimpleUniverse | public SimpleUniverse(ViewingPlatform viewingPlatform, Viewer viewer, LocaleFactory localeFactory)(Code) | | Creates the "view" side of the scene graph. The passed in parameters
override the default values where appropriate.
Parameters: viewingPlatform - The viewingPlatform to use to createthe "view" side of the scene graph. Parameters: viewer - The viewer object to use to createthe "view" side of the scene graph. Parameters: localeFactory - The factory used to create the Locale Object |
addBranchGraph | public void addBranchGraph(BranchGroup bg)(Code) | | Used to add Nodes to the geometry side (as opposed to the view side)
of the scene graph. This is a short cut to getting the Locale object
and calling that object's addBranchGraph() method.
Parameters: bg - The BranchGroup to attach to this Universe's Locale. |
cleanup | public void cleanup()(Code) | | Cleanup memory use and reference by SimpleUniverse.
Typically it should be invoked by the applet's destroy method.
|
getCanvas | public Canvas3D getCanvas()(Code) | | Returns the Canvas3D object associated with this Java 3D Universe.
A reference to the Canvas3D object associated with theViewer object. This method is equivalent to calling getCanvas(0). See Also: Viewer |
getCanvas | public Canvas3D getCanvas(int canvasNum)(Code) | | Returns the Canvas3D object at the specified index associated with
this Java 3D Universe.
Parameters: canvasNum - The index of the Canvas3D object to retrieve.If there is no Canvas3D object for the given index, null is returned. A reference to the Canvas3D object associated with theViewer object. |
getLocale | public Locale getLocale()(Code) | | Returns the Locale object associated with this scene graph.
The Locale object used in the construction of this scenegraph. |
getPreferredConfiguration | public static GraphicsConfiguration getPreferredConfiguration()(Code) | | Finds the preferred GraphicsConfiguration object
for the system. This object can then be used to create the
Canvas3D objet for this system.
The best GraphicsConfiguration object forthe system. |
getViewer | public Viewer getViewer()(Code) | | Returns the Viewer object associated with this scene graph.
SimpleUniverse creates a single Viewer object for use in the
scene graph.
The Viewer object associated with this scene graph. |
getViewingPlatform | public ViewingPlatform getViewingPlatform()(Code) | | Returns the ViewingPlatform object associated with this scene graph.
The ViewingPlatform object of this scene graph. |
|
|