|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.MouseTask vmm.core.TwoPointInput
public abstract class TwoPointInput
Meant for use as a "one-shot" mouse task that lets the user specify two points by clicking and dragging. The first point is where the mouse is pressed, the second is where the mouse is released.
Field Summary | |
---|---|
static int |
DRAW_CIRCLE_FROM_DIAMETER
|
static int |
DRAW_CIRCLE_FROM_RADIUS
|
static int |
DRAW_LINE
|
static int |
DRAW_NOTHING
|
static int |
DRAW_RECT
|
Constructor Summary | |
---|---|
TwoPointInput()
|
Method Summary | |
---|---|
boolean |
doMouseDown(java.awt.event.MouseEvent evt,
Display display,
View view,
int width,
int height)
Called when the user presses the mouse in the Display in which this MouseTask is installed. |
void |
doMouseDrag(java.awt.event.MouseEvent evt,
Display display,
View view,
int width,
int height)
Continue processing a mouse gesture for which doMouseDown
returned a value of true. |
void |
doMouseUp(java.awt.event.MouseEvent evt,
Display display,
View view,
int width,
int height)
Finish processing a mouse gesture for which doMouseDown
returned a value of true. |
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. |
boolean |
getAllowOutOfBoundsDrag()
|
java.awt.Cursor |
getCursor(Display display,
View view)
Return a cursor to be used in the display when this MouseTask is installed and waiting for a mouse-down event. |
java.awt.Color |
getDrawColor()
|
int |
getFigureToDraw()
|
int |
getMaximumDrag()
|
int |
getMinimumDrag()
|
protected abstract void |
gotPoints(Display display,
View view,
int startX,
int startY,
int endX,
int endY)
|
void |
setAllowOutOfBoundsDrag(boolean allowOutOfBoundsDrag)
|
void |
setDrawColor(java.awt.Color drawColor)
|
void |
setFigureToDraw(int figureToDraw)
|
void |
setMaximumDrag(int maximumDrag)
|
void |
setMinimumDrag(int minimumDrag)
|
Methods inherited from class vmm.core.MouseTask |
---|
finish, getCursorForDragging, getStatusText, start, wantsMoreClicks |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DRAW_NOTHING
public static final int DRAW_LINE
public static final int DRAW_CIRCLE_FROM_RADIUS
public static final int DRAW_CIRCLE_FROM_DIAMETER
public static final int DRAW_RECT
Constructor Detail |
---|
public TwoPointInput()
Method Detail |
---|
protected abstract void gotPoints(Display display, View view, int startX, int startY, int endX, int endY)
public boolean getAllowOutOfBoundsDrag()
public void setAllowOutOfBoundsDrag(boolean allowOutOfBoundsDrag)
public java.awt.Color getDrawColor()
public void setDrawColor(java.awt.Color drawColor)
public int getFigureToDraw()
public void setFigureToDraw(int figureToDraw)
public int getMaximumDrag()
public void setMaximumDrag(int maximumDrag)
public int getMinimumDrag()
public void setMinimumDrag(int minimumDrag)
public boolean doMouseDown(java.awt.event.MouseEvent evt, Display display, View view, int width, int height)
MouseTask
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)
MouseTask
doMouseDown
returned a value of true. If not redefined in a subclass, this method
does nothing.
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)
MouseTask
doMouseDown
returned a value of true. If not redefined in a subclass,
does nothing.
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 void drawWhileDragging(java.awt.Graphics2D g, Display display, View view, int width, int height)
MouseTask
drawWhileDragging
in class MouseTask
public java.awt.Cursor getCursor(Display display, View view)
MouseTask
getCursor
in class MouseTask
MouseTask.getCursorForDragging(MouseEvent, Display, View)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |