net.jbeans.j3d.universe
Class SelectableUniverse

java.lang.Object
  extended byjavax.media.j3d.VirtualUniverse
      extended bynet.jbeans.j3d.universe.Universe
          extended bynet.jbeans.j3d.universe.SelectableUniverse
All Implemented Interfaces:
java.util.EventListener, PickMouseListener
Direct Known Subclasses:
ManipulatableUniverse

public class SelectableUniverse
extends Universe
implements PickMouseListener

This class is basically the same as the SimpleUniverse. It, however, allows a user to select an object.

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

Field Summary
protected  javax.vecmath.Point3d center
          A current center which is the target of for rot/trans/zoom
protected  javax.media.j3d.TransformGroup currentTG
          A current transform group which is the target of for rot/trans/zoom
protected  javax.media.j3d.TransformGroup viewingTG
          A transform group of viewingplatform
protected  javax.media.j3d.TransformGroup worldTG
          A transform group of world
 
Fields inherited from class javax.media.j3d.VirtualUniverse
 
Constructor Summary
(package private) SelectableUniverse()
          Creates a locale, a single ViewingPlatform, and and a Viewer object (both with their default values).
(package private) SelectableUniverse(javax.media.j3d.Canvas3D canvas)
          Creates a locale, a single ViewingPlatform (with default values), and and a Viewer object.
(package private) SelectableUniverse(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) SelectableUniverse(ViewingPlatform viewingPlatform, Viewer viewer)
          Creates the "view" side of the scene graph.
 
Method Summary
 void addPickMouseListener(PickMouseListener l)
          Adds a PickMouseListener to the slider.
protected  World createNewWorld(int numTransformGroup)
           
protected  void firePickedEvent(PickMouseEvent event)
          Send the Pick node to listeners.
protected  void fireSelectedEvent(PickMouseEvent event)
          Send the Selection node to listeners.
protected  javax.vecmath.Point3d getCenter()
           
 void picked(PickMouseEvent event)
          Invoked when an object is picked.
 void removePickMouseListener(PickMouseListener l)
          Removes a PickMouseListener from the slider.
 void selected(PickMouseEvent event)
          Invoked when an object is selected.
protected  void setCenter(javax.vecmath.Point3d center)
           
 void setPickMode(int pickMode)
           
protected  void setupPickMouse(World world)
           
protected  void setupTransformGroups(World world)
           
 
Methods inherited from class net.jbeans.j3d.universe.Universe
addBranchGraph, addViewer, addViewer, addViewingPlatform, getCanvas, getCanvas, getInitialNumChild, getLocale, getNumOfChildren, getPreferredConfiguration, getViewer, getViewer, getViewingPlatform, getViewingPlatform, getWorld, removeAllBranchGraph, removeBranchGraph, removeViewer, removeViewingPlatform, setInitialNumChildren, setWorld
 
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
 

Field Detail

viewingTG

protected javax.media.j3d.TransformGroup viewingTG
A transform group of viewingplatform


worldTG

protected javax.media.j3d.TransformGroup worldTG
A transform group of world


currentTG

protected javax.media.j3d.TransformGroup currentTG
A current transform group which is the target of for rot/trans/zoom


center

protected javax.vecmath.Point3d center
A current center which is the target of for rot/trans/zoom

Constructor Detail

SelectableUniverse

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

See Also:
Locale, Viewer, ViewingPlatform

SelectableUniverse

SelectableUniverse(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

SelectableUniverse

SelectableUniverse(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

SelectableUniverse

SelectableUniverse(ViewingPlatform viewingPlatform,
                   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

setCenter

protected void setCenter(javax.vecmath.Point3d center)

getCenter

protected javax.vecmath.Point3d getCenter()

createNewWorld

protected World createNewWorld(int numTransformGroup)
Overrides:
createNewWorld in class Universe

setPickMode

public void setPickMode(int pickMode)

setupTransformGroups

protected void setupTransformGroups(World world)

setupPickMouse

protected void setupPickMouse(World world)

picked

public void picked(PickMouseEvent event)
Invoked when an object is picked.
 

Specified by:
picked in interface PickMouseListener
Returns:
void

selected

public void selected(PickMouseEvent event)
Invoked when an object is selected.
 

Specified by:
selected in interface PickMouseListener
Returns:
void

addPickMouseListener

public void addPickMouseListener(PickMouseListener l)
Adds a PickMouseListener to the slider.

Parameters:
l - the PickMouseListener to add

removePickMouseListener

public void removePickMouseListener(PickMouseListener l)
Removes a PickMouseListener from the slider.

Parameters:
l - the PickMouseListener to remove

firePickedEvent

protected void firePickedEvent(PickMouseEvent event)
Send the Pick node to listeners.


fireSelectedEvent

protected void fireSelectedEvent(PickMouseEvent event)
Send the Selection node to listeners.



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