|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.dnd.DragGestureRecognizer
java.awt.dnd.MouseDragGestureRecognizer
com.bbn.openmap.tools.dnd.DnDListener
public class DnDListener
DnDListener acts as the base DnD and MouseListener class. Some of its methods should be overriden by extending classes.
DefaultDnDCatcher,
Serialized Form| Field Summary | |
|---|---|
protected int |
default_action
|
protected boolean |
startDrag
|
| Fields inherited from class java.awt.dnd.DragGestureRecognizer |
|---|
component, dragGestureListener, dragSource, events, sourceActions |
| Constructor Summary | |
|---|---|
protected |
DnDListener(java.awt.dnd.DragSource ds)
Constructs a new DnDListener given the DragSource for the Component. |
protected |
DnDListener(java.awt.dnd.DragSource ds,
java.awt.Component c)
Construct a new DnDListener given the DragSource for the Component c, and the Component to observe. |
protected |
DnDListener(java.awt.dnd.DragSource ds,
java.awt.Component c,
int act)
|
protected |
DnDListener(java.awt.dnd.DragSource ds,
java.awt.Component c,
int act,
java.awt.dnd.DragGestureListener dgl)
|
| Method Summary | |
|---|---|
void |
dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
This method is invoked to signify that the Drag and Drop operation is complete. |
void |
dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
Called as the hotspot enters a platform dependent drop site. |
void |
dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
Called when a drag operation has encountered the DropTarget. |
void |
dragExit(java.awt.dnd.DragSourceEvent dse)
Called as the hotspot exits a platform dependent drop site. |
void |
dragExit(java.awt.dnd.DropTargetEvent dte)
The drag operation has departed the DropTarget
without dropping. |
void |
dragOver(java.awt.dnd.DragSourceDragEvent dsde)
Called as the hotspot moves over a platform dependent drop site. |
void |
dragOver(java.awt.dnd.DropTargetDragEvent dtde)
Called when a drag operation is ongoing on the DropTarget. |
void |
drop(java.awt.dnd.DropTargetDropEvent dtde)
The drag operation has terminated with a drop on this DropTarget. |
void |
dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
Called when the user has modified the drop gesture. |
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
Called if the user has modified the current drop gesture. |
java.awt.Cursor |
getCursor(java.awt.Cursor default_cursor)
Get the Cursor object associated with the default_cursor. |
int |
getDefaultAction()
Returns the default DnD action. |
void |
setCursor(java.awt.Image img,
java.awt.Cursor default_cursor)
Sets a custom Cursor object associated with the default_cursor. |
void |
setDefaultAction(int newAction)
Sets the default DnD action. |
| Methods inherited from class java.awt.dnd.MouseDragGestureRecognizer |
|---|
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, registerListeners, unregisterListeners |
| Methods inherited from class java.awt.dnd.DragGestureRecognizer |
|---|
addDragGestureListener, appendEvent, fireDragGestureRecognized, getComponent, getDragSource, getSourceActions, getTriggerEvent, removeDragGestureListener, resetRecognizer, setComponent, setSourceActions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean startDrag
protected int default_action
| Constructor Detail |
|---|
protected DnDListener(java.awt.dnd.DragSource ds)
ds - the DragSource for the Component
protected DnDListener(java.awt.dnd.DragSource ds,
java.awt.Component c)
ds - the DragSource for the Component cc - the Component to observe
protected DnDListener(java.awt.dnd.DragSource ds,
java.awt.Component c,
int act)
protected DnDListener(java.awt.dnd.DragSource ds,
java.awt.Component c,
int act,
java.awt.dnd.DragGestureListener dgl)
| Method Detail |
|---|
public void dragDropEnd(java.awt.dnd.DragSourceDropEvent dsde)
DragSourceDropEvent can be used to determine the
termination state. The getDropAction() method returns the
operation that the DropTarget selected (via the
DropTargetDropEvent acceptDrop() parameter) to apply to the
Drop operation. Once this method is complete, the current
DragSourceContext and associated resources
become invalid.
dragDropEnd in interface java.awt.dnd.DragSourceListenerdsde - the DragSourceDropEventpublic void dragEnter(java.awt.dnd.DragSourceDragEvent dsde)
Component's visible geometry.
Component has an active
DropTarget associated with it.
DropTarget's registered
DropTargetListener dragEnter() method is invoked
and returns successfully.
DropTargetListener invokes
the DropTargetDragEvent's acceptDrag() method
to accept the drag based upon interrogation of the source's
potential drop action(s) and available data types (
DataFlavor s).
dragEnter in interface java.awt.dnd.DragSourceListenerdsde - the DragSourceDragEventpublic void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
DropTarget.
dragEnter in interface java.awt.dnd.DropTargetListenerdtde - the DropTargetDragEventpublic void dragExit(java.awt.dnd.DragSourceEvent dse)
Component associated
with the previous dragEnter() invocation.
Component that the logical cursor's
hotspot intersected that resulted in the previous dragEnter()
invocation no longer has an active DropTarget or
DropTargetListener associated with it.
DropTarget's
DropTargetListener has invoked rejectDrag()
since the last dragEnter() or dragOver() invocation.
dragExit in interface java.awt.dnd.DragSourceListenerdse - the DragSourceEventpublic void dragExit(java.awt.dnd.DropTargetEvent dte)
DropTarget
without dropping.
dragExit in interface java.awt.dnd.DropTargetListenerdte - the DropTargetEventpublic void dragOver(java.awt.dnd.DragSourceDragEvent dsde)
Component
associated with the previous dragEnter() invocation.
Component still has a
DropTarget associated with it.
DropTarget is still active.
DropTarget's registered
DropTargetListener dragOver() method is invoked
and returns successfully.
DropTarget does not reject the drag via
rejectDrag()
dragOver in interface java.awt.dnd.DragSourceListenerdsde - the DragSourceDragEventpublic void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
DropTarget.
dragOver in interface java.awt.dnd.DropTargetListenerdtde - the DropTargetDragEventpublic void drop(java.awt.dnd.DropTargetDropEvent dtde)
DropTarget. This method is responsible for
undertaking the transfer of the data associated with the
gesture. The DropTargetDropEvent provides a
means to obtain a Transferable object that
represents the data object(s) to be transfered.
From this method, the DropTargetListener shall
accept or reject the drop via the acceptDrop(int dropAction) or
rejectDrop() methods of the DropTargetDropEvent
parameter.
Subsequent to acceptDrop(), but not before,
DropTargetDropEvent's getTransferable() method
may be invoked, and data transfer may be performed via the
returned Transferable's getTransferData()
method.
At the completion of a drop, an implementation of this method
is required to signal the success/failure of the drop by
passing an appropriate boolean to the
DropTargetDropEvent's dropComplete(boolean
success) method.
Note: The actual processing of the data transfer is not required to finish before this method returns. It may be deferred until later.
drop in interface java.awt.dnd.DropTargetListenerdtde - the DropTargetDropEventpublic void dropActionChanged(java.awt.dnd.DragSourceDragEvent dsde)
dropActionChanged in interface java.awt.dnd.DragSourceListenerdsde - the DragSourceDragEventpublic void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
dropActionChanged in interface java.awt.dnd.DropTargetListenerdtde - the DropTargetDragEventpublic java.awt.Cursor getCursor(java.awt.Cursor default_cursor)
public int getDefaultAction()
public void setCursor(java.awt.Image img,
java.awt.Cursor default_cursor)
public void setDefaultAction(int newAction)
newAction - int
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||