Class java.awt.dnd.DragSourceContext
java.lang.Object
|
+----java.awt.dnd.DragSourceContext
- public class DragSourceContext
- extends Object
- implements DragSourceListener
The DragSourceContext class is responsible for managing the initiator side
of the Drag and Drop protocol. In particular it is responsible for managing
event notifications to the DragSourceListener, and providing the
Transferable state to enable the data transfer.
- Since:
- JDK1.2
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT
protected static final int DEFAULT
ENTER
protected static final int ENTER
OVER
protected static final int OVER
CHANGED
protected static final int CHANGED
DragSourceContext
public DragSourceContext(DragSource ds,
java.awt.dnd.peer.DragSourceContextPeer dscp,
Component c,
int a,
Cursor dragCursor,
Image dragImage,
Point offset,
Transferable t,
DragSourceListener dsl)
- construct a DragSourceContext (called from DragSource)
- Parameters:
ds
- The DragSource that originated this operation
dscp
- The DragSourceContextPeer for this operation
a
- The operation(s)
dragCursor
- The initial Cursor
dragImage
- The image to drag (or null)
offset
- The offset of the image origin from the hotspot
at the instant of the triggering event
t
- The Transferable
dsl
- The DragSourceListener
getDragSource
public DragSource getDragSource()
- Returns:
- the DragSource that instantiated this DragSourceContext
getComponent
public Component getComponent()
- Returns:
- the Component that started the Drag
getTrigger
public AWTEvent getTrigger()
- Returns:
- the Event that triggered the Drag
cancelDrag
public void cancelDrag() throws InvalidDnDOperationException
- cancel the operation
getSourceActions
public int getSourceActions()
- Returns:
- the current actions
setCursor
public void setCursor(Cursor c)
- change the drag cursor
getCursor
public Cursor getCursor()
- Returns:
- the current drag cursor
getDragImage
public Image getDragImage()
- Returns:
- the drag image
getDragImageOffset
public Point getDragImageOffset()
- Returns:
- the image offset
addDragSourceListener
public void addDragSourceListener(DragSourceListener dsl) throws TooManyListenersException
- change the DragSourceListener
removeDragSourceListener
public void removeDragSourceListener(DragSourceListener dsl)
- change the DragSourceListener
dragEnter
public void dragEnter(DragSourceDragEvent dsde)
- intercept the dragEnter event from the peer
- Implements:
- dragEnter in interface DragSourceListener
dragOver
public void dragOver(DragSourceDragEvent dsde)
- intercept the dragOver event from the peer
- Implements:
- dragOver in interface DragSourceListener
dragExit
public void dragExit(DragSourceEvent dse)
- intercept the dragExit event from the peer
- Implements:
- dragExit in interface DragSourceListener
dropActionChanged
public void dropActionChanged(DragSourceDragEvent dsde)
- intercept the dragGestureChanged event from the peer
- Implements:
- dropActionChanged in interface DragSourceListener
dragDropEnd
public void dragDropEnd(DragSourceDropEvent dsde)
- intercept the dragDropEnd event from the peer
- Implements:
- dragDropEnd in interface DragSourceListener
getTransferable
public Transferable getTransferable()
checkCurrentCursor
protected void checkCurrentCursor(int target,
int status)
- check the cursor for updates and implement defaults check the cursor for updates and implement defaults
Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.