vmm3d.core3D
Class BasicMouseTask3D
- java.lang.Object
-
- vmm3d.core.MouseTask
-
- vmm3d.core3D.BasicMouseTask3D
-
public class BasicMouseTask3D extends MouseTask
A MouseTask that is designed to handle the most common cases of interaction with a three-dimensional Exhibit. Clicking and dragging with the left mouse button on a 3D Exhibit will do trackball-style rotation of the Exhibit. Using the middle mouse button, or the left mouse button with the Shift or ALT/Option key, will zoom the Exhibit as the mouse is dragged up and down. Using the right mouse button, or the left mouse button with the Control or Meta/Command key, will drag the Exhibit."Dragging" the exhibit has a special meaning when the exhibit is displayed in dual, sterographic mode. In that case, dragging the mouse horizontally will slide the two views of the exhibit closer together and farther apart. This is to allow the user to adjust the distance to make it easier to fuse the two views into one 3D view.
-
-
Constructor Summary
Constructors Constructor and Description BasicMouseTask3D()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleandoMouseDown(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)Decides which operation to perform, if any.voiddoMouseDrag(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)Continue an operation that was begun in thedoMouseDownmethod.voiddoMouseUp(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)Finish an operation that was begun in thedoMouseDownmethod.java.awt.CursorgetCursorForDragging(java.awt.event.MouseEvent mouseDownEvent, Display display, View view)Returns the cursor that the Display should use during a drag operation.-
Methods inherited from class vmm3d.core.MouseTask
drawWhileDragging, finish, getCursor, getStatusText, start, wantsMoreClicks
-
-
-
-
Method Detail
-
doMouseDown
public boolean doMouseDown(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)Decides which operation to perform, if any. For stereographic views, a ZOOM or ROTATE operation is begun only if the mouse click is actually inside one of the two view rectangles.- Specified by:
doMouseDownin classMouseTask- Parameters:
evt- The mouse-down event, except that the x and y coordinates have been translated so that the top left corner of the View is at coordinates (0,0).width- The width the drawing area (not including any insets).height- The height the drawing area (not including any insets).
-
doMouseDrag
public void doMouseDrag(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)Continue an operation that was begun in thedoMouseDownmethod. The user can change the operation in the middle of a mouse drag by pressing and releasing modifier keys.- Overrides:
doMouseDragin classMouseTask- Parameters:
evt- The mouse-dragged event, except that the x and y coordinates have been translated by display.getInsets().left and display.getInsets().top to account for any border that has been applied to the display.width- The width the drawing area (not including any insets).height- The height the drawing area (not including any insets).
-
doMouseUp
public void doMouseUp(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)Finish an operation that was begun in thedoMouseDownmethod. If the operation is ROTATE and the user was still moving the mouse when the mouse button was released, then an animation is installed in the Display that will continue the rotation indefinitely.- Overrides:
doMouseUpin classMouseTask- Parameters:
evt- The mouse-up event, except that the x and y coordinates have been translated by display.getInsets().left and display.getInsets().top to account for any border that has been applied to the display.width- The width the drawing area (not including any insets).height- The height the drawing area (not including any insets).
-
getCursorForDragging
public java.awt.Cursor getCursorForDragging(java.awt.event.MouseEvent mouseDownEvent, Display display, View view)Returns the cursor that the Display should use during a drag operation. The cursor that is returned depends on which operation is being performed with the mouse. TODO: Use a better cursor for ZOOMing.- Overrides:
getCursorForDraggingin classMouseTask- See Also:
MouseTask.doMouseDown(MouseEvent, Display, View, int, int),MouseTask.getCursor(Display, View)
-
-
DMelt 3.0 © DataMelt by jWork.ORG