DragGestureRecognizer
defines a DragGestureRecognizer
for mouse-based gestures.
Each platform implements its own concrete subclass of this class,
available via the Toolkit.createDragGestureRecognizer() method,
to encapsulate
the recognition of the platform dependent mouse gesture(s) that initiate
a Drag and Drop operation.
Mouse drag gesture recognizers should honor the
drag gesture motion threshold, available through
DragSource#getDragThreshold.
A drag gesture should be recognized only when the distance
in either the horizontal or vertical direction between
the location of the latest mouse dragged event and the
location of the corresponding mouse button pressed event
is greater than the drag gesture motion threshold.
Drag gesture recognizers created with
DragSource#createDefaultDragGestureRecognizer
follow this convention.
java.awt.dnd.DragGestureListener , java.awt.dnd.DragGestureEvent , java.awt.dnd.DragSource
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.4 for interoperability.
|
| Access | Constructor and Description |
|---|---|
| protected | MouseDragGestureRecognizer(DragSource
The DragSource for the Component c ds, Component The Component to observe c, int The actions permitted for this Drag act, DragGestureListener The DragGestureListener to notify when a gesture is detected dgl)Construct a new |
| protected | MouseDragGestureRecognizer(DragSource
The DragSource for the Component c ds, Component The Component to observe c, int The actions permitted for this drag act)Construct a new |
| protected | MouseDragGestureRecognizer(DragSource
The DragSource for the Component c ds, Component The Component to observe c)Construct a new |
| protected | MouseDragGestureRecognizer(DragSource
The DragSource for the Component ds)Construct a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | mouseClicked(MouseEvent
the e)MouseEventImplements java. Invoked when the mouse has been clicked on a component. |
| public void | mouseDragged(MouseEvent
the e)MouseEventImplements java. Invoked when a mouse button is pressed on a component. |
| public void | mouseEntered(MouseEvent
the e)MouseEventImplements java. Invoked when the mouse enters a component. |
| public void | mouseExited(MouseEvent
the e)MouseEventImplements java. Invoked when the mouse exits a component. |
| public void | mouseMoved(MouseEvent
the e)MouseEventImplements java. Invoked when the mouse button has been moved on a component (with no buttons no down). |
| public void | mousePressed(MouseEvent
the e)MouseEventImplements java. Invoked when a mouse button has been
pressed on a |
| public void | mouseReleased(MouseEvent
the e)MouseEventImplements java. Invoked when a mouse button has been released on a component. |
| protected void | registerListeners()
Implements abstract java. register this DragGestureRecognizer's Listeners with the Component |
| protected void | unregisterListeners()
Implements abstract java. unregister this DragGestureRecognizer's Listeners with the Component subclasses must override this method |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.4 for interoperability. | |
| MouseDragGestureRecognizer | back to summary |
|---|---|
| protected MouseDragGestureRecognizer(DragSource ds, Component c, int act, DragGestureListener dgl) Construct a new
| |
| MouseDragGestureRecognizer | back to summary |
|---|---|
| protected MouseDragGestureRecognizer(DragSource ds, Component c, int act) Construct a new
| |
| MouseDragGestureRecognizer | back to summary |
|---|---|
| protected MouseDragGestureRecognizer(DragSource ds, Component c) Construct a new
| |
| MouseDragGestureRecognizer | back to summary |
|---|---|
| protected MouseDragGestureRecognizer(DragSource ds) Construct a new
| |
| mouseClicked | back to summary |
|---|---|
| public void mouseClicked(MouseEvent e) Implements java. Invoked when the mouse has been clicked on a component.
| |
| mouseDragged | back to summary |
|---|---|
| public void mouseDragged(MouseEvent e) Implements java. Invoked when a mouse button is pressed on a component.
| |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Implements java. Invoked when the mouse enters a component.
| |
| mouseExited | back to summary |
|---|---|
| public void mouseExited(MouseEvent e) Implements java. Invoked when the mouse exits a component.
| |
| mouseMoved | back to summary |
|---|---|
| public void mouseMoved(MouseEvent e) Implements java. Invoked when the mouse button has been moved on a component (with no buttons no down).
| |
| mousePressed | back to summary |
|---|---|
| public void mousePressed(MouseEvent e) Implements java. Invoked when a mouse button has been
pressed on a
| |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Implements java. Invoked when a mouse button has been released on a component.
| |
| registerListeners | back to summary |
|---|---|
| protected void registerListeners() Implements abstract java. register this DragGestureRecognizer's Listeners with the Component | |
| unregisterListeners | back to summary |
|---|---|
| protected void unregisterListeners() Implements abstract java. unregister this DragGestureRecognizer's Listeners with the Component subclasses must override this method | |