|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.MouseTask vmm.core.BasicMouseTask2D
public class BasicMouseTask2D
A BasicMouseTask2D is a MouseTask that allows the user to drag and zoom the 2D window that is used to draw the Exhibit in a display. Dragging is done with the left mouse button. Zooming is done by dragging up/down with the middle mouse button (or holding down a shift or alt or option key). When draggin with the left mouse button, the user can switch between dragging the exhibit and zooming it by pressing and releasing the shift key.
The user can also use the right mouse key (or hold down the control or command key) to draw a rectangle; the rectangle can be moved while dragging by holding down the shift key. The View is then zoomed into that rectangle. The shape of the rectangle is contrained to have the same aspect ration as the display.
All the methods in this class are called by a Display in response to user actions. None of them are meant to be called directly.
Constructor Summary | |
---|---|
BasicMouseTask2D()
|
Method Summary | |
---|---|
boolean |
doMouseDown(java.awt.event.MouseEvent evt,
Display display,
View view,
int width,
int height)
Decides what type of operation to perform in response to a user's mouse click, and initiates that operation. |
void |
doMouseDrag(java.awt.event.MouseEvent evt,
Display display,
View view,
int width,
int height)
Continue processing a drag operation. |
void |
doMouseUp(java.awt.event.MouseEvent evt,
Display display,
View view,
int width,
int height)
Finish processing a drag operation. |
void |
drawWhileDragging(java.awt.Graphics2D g,
Display display,
View view,
int width,
int height)
When the Display is repainted during a drag operation, this method will be called after the Exhibit is drawn, to give the MouseTask a chance to draw some extra stuff on top of the Exhibit. |
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. |
Methods inherited from class vmm.core.MouseTask |
---|
finish, getCursor, getStatusText, start, wantsMoreClicks |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicMouseTask2D()
Method Detail |
---|
public boolean doMouseDown(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)
doMouseDown
in class MouseTask
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).
public void doMouseDrag(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)
doMouseDrag
in class MouseTask
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).public void doMouseUp(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)
doMouseUp
in class MouseTask
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).public java.awt.Cursor getCursorForDragging(java.awt.event.MouseEvent mouseDownEvent, Display display, View view)
getCursorForDragging
in class MouseTask
MouseTask.doMouseDown(MouseEvent, Display, View, int, int)
,
MouseTask.getCursor(Display, View)
public void drawWhileDragging(java.awt.Graphics2D g, Display display, View view, int width, int height)
drawWhileDragging
in class MouseTask
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |