|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.Node | +--javax.media.j3d.Leaf | +--javax.media.j3d.Behavior | +--com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior | +--com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior | +--com.sun.j3d.utils.behaviors.vp.OrbitBehavior
Moves the View around a point of interest. Includes rotation, translation and zoom actions. This behavior must be added to the ViewingPlatform using the addViewPlatformBehavior method. The view can be manipulated either by the Mouse.
Field Summary | |
static int |
DISABLE_ROTATE
Constructor flag to disable rotate |
static int |
DISABLE_TRANSLATE
Constructor flag to disable translate |
static int |
DISABLE_ZOOM
Constructor flag to disable zoom |
static int |
PROPORTIONAL_ZOOM
Constructor flag to use proportional zoom, which determines how much you zoom based on view's distance from the center of rotation. |
static int |
REVERSE_ALL
Constructor flag to reverse all the behaviors |
static int |
REVERSE_ROTATE
Constructor flag to reverse the rotate behavior |
static int |
REVERSE_TRANSLATE
Constructor flag to reverse the translate behavior |
static int |
REVERSE_ZOOM
Constructor flag to reverse the zoom behavior |
static int |
STOP_ZOOM
Constructor flag that indicates zoom should stop when it reaches the minimum orbit radius set by setMinRadius(). |
Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior |
frameWakeup, KEY_LISTENER, motion, MOUSE_LISTENER, MOUSE_MOTION_LISTENER, POST_ID, postWakeup, targetTransform |
Fields inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
targetTG, vp |
Fields inherited from class javax.media.j3d.Node |
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
Constructor Summary | |
OrbitBehavior(Canvas3D c)
Creates a new OrbitBehavior |
|
OrbitBehavior(Canvas3D c,
int flags)
Creates a new OrbitBehavior |
Method Summary | |
double |
getMinRadius()
Returns the minimum orbit radius. |
boolean |
getRotateEnable()
Retrieves the state of rotate enabled |
void |
getRotationCenter(Point3d center)
Places the value of the center around which the View rotates into the Point3d. |
double |
getRotXFactor()
Returns the x rotation movement multiplier |
double |
getRotYFactor()
Returns the y rotation movement multiplier |
boolean |
getTranslateEnable()
Retrieves the state of translate enabled |
double |
getTransXFactor()
Returns the x translation movement multiplier |
double |
getTransYFactor()
Returns the y translation movement multiplier |
boolean |
getZoomEnable()
Retrieves the state of zoom enabled |
double |
getZoomFactor()
Returns the zoom movement multiplier |
protected void |
integrateTransforms()
Called once per frame (if the view is moving) to calculate the new view platform transform |
protected void |
processAWTEvents(java.awt.AWTEvent[] events)
This is called once per frame if there are any AWT events to process. |
protected void |
processMouseEvent(java.awt.event.MouseEvent evt)
|
void |
setMinRadius(double r)
Sets the minimum radius for the OrbitBehavior. |
void |
setRotateEnable(boolean enabled)
Enables or disables rotation. |
void |
setRotationCenter(Point3d center)
Sets the center around which the View rotates. |
void |
setRotFactors(double xfactor,
double yfactor)
Sets the rotation x and y factors. |
void |
setRotXFactor(double xfactor)
Sets the rotation x factor. |
void |
setRotYFactor(double yfactor)
Sets the rotation y factor. |
void |
setTransFactors(double xfactor,
double yfactor)
Sets the translation x and y factors. |
void |
setTranslateEnable(boolean enabled)
Enables or disables translate. |
void |
setTransXFactor(double xfactor)
Sets the translation x factor. |
void |
setTransYFactor(double yfactor)
Sets the translation y factor. |
void |
setViewingPlatform(ViewingPlatform vp)
Sets the ViewingPlatform for this behavior. |
void |
setZoomEnable(boolean enabled)
Enables or disables zoom. |
void |
setZoomFactor(double zfactor)
Sets the zoom factor. |
Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformAWTBehavior |
initialize, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, processStimulus, queueAWTEvent, setEnable |
Methods inherited from class com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior |
getViewingPlatform |
Methods inherited from class javax.media.j3d.Behavior |
getEnable, getSchedulingBoundingLeaf, getSchedulingBounds, getView, postId, setSchedulingBoundingLeaf, setSchedulingBounds, updateNodeReferences, wakeupOn |
Methods inherited from class javax.media.j3d.Node |
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int REVERSE_ROTATE
public static final int REVERSE_TRANSLATE
public static final int REVERSE_ZOOM
public static final int REVERSE_ALL
public static final int STOP_ZOOM
public static final int DISABLE_ROTATE
public static final int DISABLE_TRANSLATE
public static final int DISABLE_ZOOM
public static final int PROPORTIONAL_ZOOM
Constructor Detail |
public OrbitBehavior(Canvas3D c)
c
- The Canvas3D to add the behavior topublic OrbitBehavior(Canvas3D c, int flags)
c
- The Canvas3D to add the behavior toflags
- The option flagsMethod Detail |
protected void processAWTEvents(java.awt.AWTEvent[] events)
ViewPlatformAWTBehavior
motion
variable will be true when the method
is called. If it is true when the method returns integrateTransforms
will be called immediately.
The AWTEvents are presented in the array in the order in which they
arrived from AWT.processAWTEvents
in class ViewPlatformAWTBehavior
protected void processMouseEvent(java.awt.event.MouseEvent evt)
public void setViewingPlatform(ViewingPlatform vp)
setViewingPlatform
in class ViewPlatformAWTBehavior
protected void integrateTransforms()
ViewPlatformAWTBehavior
integrateTransforms
in class ViewPlatformAWTBehavior
public void setRotationCenter(Point3d center)
center
- The Point3d to set the center of rotation topublic void getRotationCenter(Point3d center)
center
- The Point3dpublic void setRotFactors(double xfactor, double yfactor)
xfactor
- The x movement multiplieryfactor
- The y movement multiplierpublic void setRotXFactor(double xfactor)
xfactor
- The x movement multiplierpublic void setRotYFactor(double yfactor)
yfactor
- The y movement multiplierpublic void setTransFactors(double xfactor, double yfactor)
xfactor
- The x movement multiplieryfactor
- The y movement multiplierpublic void setTransXFactor(double xfactor)
xfactor
- The x movement multiplierpublic void setTransYFactor(double yfactor)
yfactor
- The y movement multiplierpublic void setZoomFactor(double zfactor)
zfactor
- The movement multiplierpublic double getRotXFactor()
public double getRotYFactor()
public double getTransXFactor()
public double getTransYFactor()
public double getZoomFactor()
public void setRotateEnable(boolean enabled)
enabled
- true or false to enable or disable rotatepublic void setZoomEnable(boolean enabled)
enabled
- true or false to enable or disable zoompublic void setTranslateEnable(boolean enabled)
enabled
- true or false to enable or disable translatepublic boolean getRotateEnable()
public boolean getZoomEnable()
public boolean getTranslateEnable()
public void setMinRadius(double r)
r
- the minimum radiusjava.lang.IllegalArgumentException
- if the radius is less than 0.0public double getMinRadius()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |