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
actions-
CHANGED-
component-
cursor-
cursorDirty-
DEFAULT-
dragSource-
ENTER-
image-
listener-
offset-
OVER-
peer-
transferable-
DragSourceContext(DragSource, DragSourceContextPeer, Component, int, Cursor, Image, Point, Transferable, DragSourceListener)
- construct a DragSourceContext (called from DragSource)
addDragSourceListener(DragSourceListener)
- change the DragSourceListener
cancelDrag()
- cancel the operation
checkCurrentCursor(int, int)
- check the cursor for updates and implement defaults check the cursor for updates and implement defaults
dragDropEnd(DragSourceDropEvent)
- intercept the dragDropEnd event from the peer
dragEnter(DragSourceDragEvent)
- intercept the dragEnter event from the peer
dragExit(DragSourceEvent)
- intercept the dragExit event from the peer
dragGestureChanged(DragSourceDragEvent)
- intercept the dragGestureChanged event from the peer
dragOver(DragSourceDragEvent)
- intercept the dragOver event from the peer
getComponent()
-
getCursor()
-
getDragImage()
-
getDragImageOffset()
-
getDragSource()
-
getSourceActions()
-
getTransferable()
-
getTrigger()
-
removeDragSourceListener(DragSourceListener)
- change the DragSourceListener
setCursor(Cursor)
- change the drag cursor
DEFAULT
protected static final int DEFAULT
ENTER
protected static final int ENTER
OVER
protected static final int OVER
CHANGED
protected static final int CHANGED
dragSource
protected DragSource dragSource
peer
protected DragSourceContextPeer peer
cursor
protected Cursor cursor
component
protected Component component
actions
protected int actions
image
protected Image image
offset
protected Point offset
transferable
protected Transferable transferable
listener
protected DragSourceListener listener
cursorDirty
protected boolean cursorDirty
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
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
dragOver
public void dragOver(DragSourceDragEvent dsde)
- intercept the dragOver event from the peer
dragExit
public void dragExit(DragSourceEvent dse)
- intercept the dragExit event from the peer
dragGestureChanged
public void dragGestureChanged(DragSourceDragEvent dsde)
- intercept the dragGestureChanged event from the peer
dragDropEnd
public void dragDropEnd(DragSourceDropEvent dsde)
- intercept the dragDropEnd event from the peer
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
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature