All Packages  Class Hierarchy  This Package  Previous  Next  Index  

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

Variable Index

 o actions
 o CHANGED
 o component
 o cursor
 o cursorDirty
 o DEFAULT
 o dragSource
 o ENTER
 o image
 o listener
 o offset
 o OVER
 o peer
 o transferable

Constructor Index

 o DragSourceContext(DragSource, DragSourceContextPeer, Component, int, Cursor, Image, Point, Transferable, DragSourceListener)
construct a DragSourceContext (called from DragSource)

Method Index

 o addDragSourceListener(DragSourceListener)
change the DragSourceListener
 o cancelDrag()
cancel the operation
 o checkCurrentCursor(int, int)
check the cursor for updates and implement defaults check the cursor for updates and implement defaults
 o dragDropEnd(DragSourceDropEvent)
intercept the dragDropEnd event from the peer
 o dragEnter(DragSourceDragEvent)
intercept the dragEnter event from the peer
 o dragExit(DragSourceEvent)
intercept the dragExit event from the peer
 o dragGestureChanged(DragSourceDragEvent)
intercept the dragGestureChanged event from the peer
 o dragOver(DragSourceDragEvent)
intercept the dragOver event from the peer
 o getComponent()
 o getCursor()
 o getDragImage()
 o getDragImageOffset()
 o getDragSource()
 o getSourceActions()
 o getTransferable()
 o getTrigger()
 o removeDragSourceListener(DragSourceListener)
change the DragSourceListener
 o setCursor(Cursor)
change the drag cursor

Variables

 o DEFAULT
protected static final int DEFAULT
 o ENTER
protected static final int ENTER
 o OVER
protected static final int OVER
 o CHANGED
protected static final int CHANGED
 o dragSource
protected DragSource dragSource
 o peer
protected DragSourceContextPeer peer
 o cursor
protected Cursor cursor
 o component
protected Component component
 o actions
protected int actions
 o image
protected Image image
 o offset
protected Point offset
 o transferable
protected Transferable transferable
 o listener
protected DragSourceListener listener
 o cursorDirty
protected boolean cursorDirty

Constructors

 o DragSourceContext
public DragSourceContext(DragSource ds,
                         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

Methods

 o getDragSource
public DragSource getDragSource()
Returns:
the DragSource that instantiated this DragSourceContext
 o getComponent
public Component getComponent()
Returns:
the Component that started the Drag
 o getTrigger
public AWTEvent getTrigger()
Returns:
the Event that triggered the Drag
 o cancelDrag
public void cancelDrag() throws InvalidDnDOperationException
cancel the operation

 o getSourceActions
public int getSourceActions()
Returns:
the current actions
 o setCursor
public void setCursor(Cursor c)
change the drag cursor

 o getCursor
public Cursor getCursor()
Returns:
the current drag cursor
 o getDragImage
public Image getDragImage()
Returns:
the drag image
 o getDragImageOffset
public Point getDragImageOffset()
Returns:
the image offset
 o addDragSourceListener
public void addDragSourceListener(DragSourceListener dsl) throws TooManyListenersException
change the DragSourceListener

 o removeDragSourceListener
public void removeDragSourceListener(DragSourceListener dsl)
change the DragSourceListener

 o dragEnter
public void dragEnter(DragSourceDragEvent dsde)
intercept the dragEnter event from the peer

 o dragOver
public void dragOver(DragSourceDragEvent dsde)
intercept the dragOver event from the peer

 o dragExit
public void dragExit(DragSourceEvent dse)
intercept the dragExit event from the peer

 o dragGestureChanged
public void dragGestureChanged(DragSourceDragEvent dsde)
intercept the dragGestureChanged event from the peer

 o dragDropEnd
public void dragDropEnd(DragSourceDropEvent dsde)
intercept the dragDropEnd event from the peer

 o getTransferable
public Transferable getTransferable()
 o checkCurrentCursor
protected void checkCurrentCursor(int target,
                                  int status)
check the cursor for updates and implement defaults check the cursor for updates and implement defaults


All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature