net.jbeans.j3d.universe
Class Universe

java.lang.Object
  extended byjavax.media.j3d.VirtualUniverse
      extended bynet.jbeans.j3d.universe.Universe
Direct Known Subclasses:
SelectableUniverse

public class Universe
extends javax.media.j3d.VirtualUniverse

This class is basically the same as the SimpleUniverse. It, however, uses Locale to view and edit the SceneGraph nodes.

Version:
$Revision: 1.3 $
Author:
Masahiro Takatsuka (masa@jbeans.net)
See Also:
VirtualUniverse

Field Summary
 
Fields inherited from class javax.media.j3d.VirtualUniverse
 
Constructor Summary
(package private) Universe()
          Creates a locale, a single ViewingPlatform, and and a Viewer object (both with their default values).
(package private) Universe(javax.media.j3d.Canvas3D canvas)
          Creates a locale, a single ViewingPlatform (with default values), and and a Viewer object.
(package private) Universe(javax.media.j3d.HiResCoord origin, int numTransforms, javax.media.j3d.Canvas3D canvas, java.net.URL userConfig)
          Creates the "view" side of the scene graph.
(package private) Universe(ViewingPlatform viewingPlatform, com.sun.j3d.utils.universe.Viewer viewer)
          Creates the "view" side of the scene graph.
 
Method Summary
 void addBranchGraph(javax.media.j3d.BranchGroup bg)
          Used to add Nodes to the geometry side (as opposed to the view side) of the scene graph.
 void addViewer(int index, com.sun.j3d.utils.universe.Viewer viewer)
          adds a viewer to the specified viewingPlatform.
 void addViewer(com.sun.j3d.utils.universe.Viewer viewer)
           
 void addViewingPlatform(ViewingPlatform viewingPlatform)
          add a viewing platform.
protected  World createNewWorld(int numTransformGroup)
           
 javax.media.j3d.Canvas3D getCanvas()
          Returns the Canvas3D object associated with this Java 3D Universe.
 javax.media.j3d.Canvas3D getCanvas(int canvasNum)
          Returns the Canvas3D object at the specified index associated with this Java 3D Universe.
protected  int getInitialNumChild()
           
 javax.media.j3d.Locale getLocale()
          Returns the Locale object associated with this scene graph.
 int getNumOfChildren()
           
static java.awt.GraphicsConfiguration getPreferredConfiguration()
          Finds the preferred GraphicsConfiguration object for the system.
 com.sun.j3d.utils.universe.Viewer getViewer()
          Returns the Viewer object associated with this scene graph.
 com.sun.j3d.utils.universe.Viewer getViewer(int index)
          Returns the Viewer object associated with this scene graph.
 ViewingPlatform getViewingPlatform()
          Returns the ViewingPlatform object associated with this scene graph.
 ViewingPlatform getViewingPlatform(int index)
          Returns the ViewingPlatform object associated with this scene graph.
 World getWorld()
           
 void removeAllBranchGraph()
           
 void removeBranchGraph(javax.media.j3d.BranchGroup bg)
          Detaches the specified BranchGroup object.
 void removeViewer(com.sun.j3d.utils.universe.Viewer viewer)
          removes the specified viewer.
 void removeViewingPlatform(ViewingPlatform viewingPlatform)
          removes the specified viewing platform.
 void setInitialNumChildren()
           
 void setWorld(World world)
           
 
Methods inherited from class javax.media.j3d.VirtualUniverse
getAllLocales, getJ3DThreadPriority, getProperties, numLocales, removeAllLocales, removeLocale, setJ3DThreadPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Universe

Universe()
Creates a locale, a single ViewingPlatform, and and a Viewer object (both with their default values).

See Also:
Locale, Viewer, ViewingPlatform

Universe

Universe(javax.media.j3d.Canvas3D canvas)
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. Passing in null will cause this parameter to be ignored and a canvas to be created by the utility.
See Also:
Locale, Viewer, ViewingPlatform

Universe

Universe(javax.media.j3d.HiResCoord origin,
         int numTransforms,
         javax.media.j3d.Canvas3D canvas,
         java.net.URL userConfig)
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.
numTransforms - The number of transforms to be in the MultiTransformGroup object.
canvas - The canvas to draw into. If this is null, it is ignored and a canvas will be created by the utility.
userConfig - The URL to the user's configuration file, used by the Viewer object. Passing in null causes the default values to be used.
See Also:
Locale, Viewer, ViewingPlatform, MultiTransformGroup

Universe

Universe(ViewingPlatform viewingPlatform,
         com.sun.j3d.utils.universe.Viewer viewer)
Creates the "view" side of the scene graph.

Parameters:
viewingPlatform - The viewingPlatform to use to create the "view" side of the scene graph.
viewer - The viewer object to use to create the "view" side of the scene graph.
Method Detail

createNewWorld

protected World createNewWorld(int numTransformGroup)

setWorld

public final void setWorld(World world)

getNumOfChildren

public int getNumOfChildren()

setInitialNumChildren

public final void setInitialNumChildren()

getInitialNumChild

protected final int getInitialNumChild()

getLocale

public final javax.media.j3d.Locale getLocale()
Returns the Locale object associated with this scene graph.

Returns:
The Locale object used in the construction of this scene graph.

getViewer

public final com.sun.j3d.utils.universe.Viewer getViewer()
Returns the Viewer object associated with this scene graph. SimpleUniverse creates a single Viewer object for use in the scene graph.

Returns:
The Viewer object associated with this scene graph.

getViewer

public final com.sun.j3d.utils.universe.Viewer getViewer(int index)
Returns the Viewer object associated with this scene graph. SimpleUniverse creates a single Viewer object for use in the scene graph.

Returns:
The Viewer object associated with this scene graph.

addViewer

public final void addViewer(com.sun.j3d.utils.universe.Viewer viewer)

addViewer

public final void addViewer(int index,
                            com.sun.j3d.utils.universe.Viewer viewer)
adds a viewer to the specified viewingPlatform.


removeViewer

public final void removeViewer(com.sun.j3d.utils.universe.Viewer viewer)
removes the specified viewer.


getViewingPlatform

public final ViewingPlatform getViewingPlatform()
Returns the ViewingPlatform object associated with this scene graph.

Returns:
The ViewingPlatform object of this scene graph.

getViewingPlatform

public final ViewingPlatform getViewingPlatform(int index)
Returns the ViewingPlatform object associated with this scene graph.

Returns:
The ViewingPlatform object of this scene graph.

addViewingPlatform

public final void addViewingPlatform(ViewingPlatform viewingPlatform)
add a viewing platform.


removeViewingPlatform

public final void removeViewingPlatform(ViewingPlatform viewingPlatform)
removes the specified viewing platform.


getCanvas

public javax.media.j3d.Canvas3D getCanvas()
Returns the Canvas3D object associated with this Java 3D Universe.

Returns:
A reference to the Canvas3D object associated with the Viewer object. This method is equivalent to calling getCanvas(0).
See Also:
Viewer

getCanvas

public javax.media.j3d.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.
Returns:
A reference to the Canvas3D object associated with the

getWorld

public World getWorld()

addBranchGraph

public void addBranchGraph(javax.media.j3d.BranchGroup bg)
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.


removeBranchGraph

public final void removeBranchGraph(javax.media.j3d.BranchGroup bg)
Detaches the specified BranchGroup object.


removeAllBranchGraph

public final void removeAllBranchGraph()

getPreferredConfiguration

public static java.awt.GraphicsConfiguration getPreferredConfiguration()
Finds the preferred GraphicsConfiguration object for the system. This object can then be used to create the Canvas3D objet for this system.

Returns:
The best GraphicsConfiguration object for the system.


Copyright © 1995-2004 net.jbeans. All Rights Reserved.