net.jbeans.j3d.universe
Class ManipulatableUniverse

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

public class ManipulatableUniverse
extends SelectableUniverse
implements PickMouseListener

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:
SelectableUniverse, PickMouseListener

Field Summary
static int MOUSE_DEFAULT
           
static int MOUSE_ROLL
           
static int MOUSE_ROTATE
           
static int MOUSE_SCALE
           
static int MOUSE_TRANSLATE
           
static int MOUSE_ZOOM
           
protected  MouseManipulatorBehavior mouseBehavior
           
protected  int mouseButton1Mode
           
static int TARGET_OBJECT
           
static int TARGET_VIEWER
           
static int TARGET_WORLD
           
 
Fields inherited from class net.jbeans.j3d.universe.SelectableUniverse
center, currentTG, viewingTG, worldTG
 
Fields inherited from class javax.media.j3d.VirtualUniverse
 
Constructor Summary
(package private) ManipulatableUniverse()
          Creates a locale, a single ViewingPlatform, and and a Viewer object (both with their default values).
(package private) ManipulatableUniverse(javax.media.j3d.Canvas3D canvas)
          Creates a locale, a single ViewingPlatform (with default values), and and a Viewer object.
(package private) ManipulatableUniverse(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) ManipulatableUniverse(ViewingPlatform viewingPlatform, Viewer viewer)
          Creates the "view" side of the scene graph.
 
Method Summary
protected  World createNewWorld(int numTransformGroup)
           
 int getMouseButton1Mode()
           
protected  int getMouseMode()
           
 void manipulate(int mode, Stimulus stimulus)
           
 void picked(PickMouseEvent event)
          Invoked when an object is picked.
 void resetCurrentTransformGroup()
           
 void saveCurrentTransformGroup()
           
 void setMouseButton1Mode(int mouseMode)
           
protected  void setMouseMode(int mouseMode)
          sets mouse behaviors
protected  void setupMouseBehaviors(World world)
           
protected  void updateCenter(javax.vecmath.Point3d center)
           
 
Methods inherited from class net.jbeans.j3d.universe.SelectableUniverse
addPickMouseListener, firePickedEvent, fireSelectedEvent, getCenter, removePickMouseListener, selected, setCenter, setPickMode, setupPickMouse, setupTransformGroups
 
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
 
Methods inherited from interface net.jbeans.j3d.util.picking.behavior.PickMouseListener
selected
 

Field Detail

MOUSE_DEFAULT

public static final int MOUSE_DEFAULT
See Also:
Constant Field Values

MOUSE_ROTATE

public static final int MOUSE_ROTATE
See Also:
Constant Field Values

MOUSE_TRANSLATE

public static final int MOUSE_TRANSLATE
See Also:
Constant Field Values

MOUSE_ZOOM

public static final int MOUSE_ZOOM
See Also:
Constant Field Values

MOUSE_ROLL

public static final int MOUSE_ROLL
See Also:
Constant Field Values

MOUSE_SCALE

public static final int MOUSE_SCALE
See Also:
Constant Field Values

TARGET_WORLD

public static final int TARGET_WORLD
See Also:
Constant Field Values

TARGET_VIEWER

public static final int TARGET_VIEWER
See Also:
Constant Field Values

TARGET_OBJECT

public static final int TARGET_OBJECT
See Also:
Constant Field Values

mouseBehavior

protected MouseManipulatorBehavior mouseBehavior

mouseButton1Mode

protected int mouseButton1Mode
Constructor Detail

ManipulatableUniverse

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

See Also:
Locale, Viewer, ViewingPlatform

ManipulatableUniverse

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

ManipulatableUniverse

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

ManipulatableUniverse

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

createNewWorld

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

setMouseButton1Mode

public void setMouseButton1Mode(int mouseMode)

getMouseButton1Mode

public int getMouseButton1Mode()

getMouseMode

protected int getMouseMode()

setMouseMode

protected void setMouseMode(int mouseMode)
sets mouse behaviors

Parameters:
mouseMode - OR of MOUSE_ROTATE, MOUSE_TRANSLATE, MOUSE_ZOOM or MOUSE_SCALE.

manipulate

public void manipulate(int mode,
                       Stimulus stimulus)

setupMouseBehaviors

protected void setupMouseBehaviors(World world)

updateCenter

protected void updateCenter(javax.vecmath.Point3d center)

picked

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

Specified by:
picked in interface PickMouseListener
Overrides:
picked in class SelectableUniverse
Returns:
void

saveCurrentTransformGroup

public void saveCurrentTransformGroup()

resetCurrentTransformGroup

public void resetCurrentTransformGroup()


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