public class DragContext extends Object implements IEventModifiers
Modifier and Type | Class and Description |
---|---|
static class |
DragContext.ImageDragInWindow |
Modifier and Type | Field and Description |
---|---|
boolean |
cancelled |
boolean |
convertToMove |
Point |
curPoint |
Object |
dataToDrag
Used for Drag and Drop - this is any data to be dragged.
|
boolean |
didDrag |
int |
dragCursor
Used for Drag and Drop - if this is not 0 then it will be used as the special drag and drop mouse pointer.
|
Object |
dragData
You can use this for attaching custom data to your drag.
|
String |
dropAction |
MenuItem[] |
dropOptions
Used for Drag and Drop - these are options to display when the data is dropped.
|
boolean |
isCopy
Used for Drag and Drop - this indicates that a copy of the data should be dragged.
|
boolean |
isMultiple
Used for Drag and Drop - this indicates that any data being dragged should be considered multiple data.
|
long |
lastDragTime |
int |
modifiers |
static MenuItem[] |
moveOrCopyOptions |
static int |
NoDragOver
This is a possible modifier.
|
PenEvent |
penEvent |
Point |
point1 |
Point |
point2 |
Point |
prevPoint |
int |
rate |
int |
resolution |
Point |
start |
ALT, CONDITIONAL, CONTROL, DOUBLE_PRESS, FROM_INPUT_METHOD, FROM_OTHER_WINDOW, INVISIBLE, MIDDLE_BUTTON, MULTICHARACTER, ONLY, POST_TO_BACK, REPEATED, REPLACEMENT, RIGHT_BUTTON, SHIFT, SPECIAL, TRANSFERRED_PRESS
Constructor and Description |
---|
DragContext() |
DragContext(PenEvent ev) |
Modifier and Type | Method and Description |
---|---|
void |
clearPendingDrags()
This clears all pending drag messages to this window.
|
DragContext.ImageDragInWindow |
getImageDrag()
Get the current ImageDragInWindow if there is one.
|
boolean |
hasDragged(Point newPoint) |
void |
imageDrag()
Call this within the dragged(DragContext dc) to continue dragging the same
image.
|
void |
imageDrag(IImage newImage,
Point cursorInImage)
Call this within the dragged(DragContext dc) to drag a new Image.
|
void |
set(PenEvent ev) |
void |
set(PenEvent ev,
int x,
int y) |
void |
set(PenEvent ev,
Point where) |
void |
setDropOptions(boolean alwaysShow,
boolean showIfNoMouse)
Sets up the standard Copy, Move, Cancel DragAndDrop popup menu.
|
void |
setDropOptions(MenuItem[] options,
boolean alwaysShow,
boolean showIfNoMouse)
Sets up the drag and drop menu options.
|
DragContext.ImageDragInWindow |
startImageDrag(DragContext.ImageDragInWindow dw)
Start dragging an Image around the window.
|
DragContext.ImageDragInWindow |
startImageDrag(IImage drag,
Point cursorInImage,
Control c)
Start dragging an Image around the window.
|
DragContext.ImageDragInWindow |
startImageDrag(IImage drag,
Point cursorInImage,
Control c,
Rect limitTo)
Start dragging an Image around the window.
|
void |
stopImageDrag()
Stop dragging the image.
|
void |
stopImageDrag(boolean freeImage) |
void |
updateDragFromOtherControl(Control dragSource,
Control dragNowIn,
int xInNewControl,
int yInNewControl,
PenEvent pe,
boolean stopImageDrag)
This is used by a Control during a Drag and Drop operation.
|
void |
windowChanged()
Call this during dragging if the underlying window data has changed while dragging.
|
public static final int NoDragOver
public Object dataToDrag
public boolean isMultiple
public boolean isCopy
public MenuItem[] dropOptions
public int dragCursor
public Object dragData
public int modifiers
public Point start
public Point prevPoint
public Point curPoint
public Point point1
public Point point2
public boolean didDrag
public int resolution
public int rate
public long lastDragTime
public PenEvent penEvent
public boolean cancelled
public static MenuItem[] moveOrCopyOptions
public String dropAction
public boolean convertToMove
public DragContext()
public DragContext(PenEvent ev)
public void setDropOptions(MenuItem[] options, boolean alwaysShow, boolean showIfNoMouse)
alwaysShow
- true if you want the menu to show unconditionally. If it is false the menu
will only show if the right mouse button is used to drag the data.showIfNoMouse
- true if you want the menu to show if the system is pen based.public void setDropOptions(boolean alwaysShow, boolean showIfNoMouse)
alwaysShow
- true if you want the menu to show unconditionally. If it is false the menu
will only show if the right mouse button is used to drag the data.showIfNoMouse
- true if you want the menu to show if the system is pen based.public void set(PenEvent ev, int x, int y)
public void set(PenEvent ev)
public boolean hasDragged(Point newPoint)
public DragContext.ImageDragInWindow getImageDrag()
public DragContext.ImageDragInWindow startImageDrag(IImage drag, Point cursorInImage, Control c)
drag
- The image to drag.cursorInImage
- The location in pixels of the cursor point within the image.c
- The control from which the image is being dragged.public DragContext.ImageDragInWindow startImageDrag(IImage drag, Point cursorInImage, Control c, Rect limitTo)
drag
- The image to drag.cursorInImage
- The location in pixels of the cursor point within the image.c
- The control from which the image is being dragged.public DragContext.ImageDragInWindow startImageDrag(DragContext.ImageDragInWindow dw)
dw
- The ImageDragInWindow object used for dragging the image.public void imageDrag()
public void windowChanged()
public void imageDrag(IImage newImage, Point cursorInImage)
newImage
- The new image to drag.cursorInImage
- The position of the mouse pointer within the new image.public void stopImageDrag()
public void stopImageDrag(boolean freeImage)
public void clearPendingDrags()