public abstract class

SunDropTargetContextPeer

extends Object
implements Transferable DropTargetContextPeer
java.lang.Object
   ↳ sun.awt.dnd.SunDropTargetContextPeer

Class Overview

The SunDropTargetContextPeer class is the generic class responsible for handling the interaction between a windowing systems DnD system and Java.

Summary

Nested Classes
class SunDropTargetContextPeer.EventDispatcher  
Constants
boolean DISPATCH_SYNC
int STATUS_ACCEPT
int STATUS_NONE
int STATUS_REJECT
int STATUS_WAIT
Fields
protected static final Object _globalLock
protected static Transferable currentJVMLocalSourceTransferable
protected boolean dropComplete
protected int dropStatus
Public Constructors
SunDropTargetContextPeer()
create the peer
Public Methods
synchronized void acceptDrag(int dragOperation)
acceptDrag
synchronized void acceptDrop(int dropOperation)
acceptDrop
synchronized void dropComplete(boolean success)
signal drop complete
DropTarget getDropTarget()
get the DropTarget associated with this peer
int getTargetActions()
get the current Target actions
Object getTransferData(DataFlavor df)
Returns an object which represents the data to be transferred.
DataFlavor[] getTransferDataFlavors()
Returns an array of DataFlavor objects indicating the flavors the data can be provided in.
Transferable getTransferable()
get the Transferable associated with the drop
boolean isDataFlavorSupported(DataFlavor df)
Returns whether or not the specified data flavor is supported for this object.
boolean isTransferableJVMLocal()
synchronized void rejectDrag()
rejectDrag
synchronized void rejectDrop()
reject Drop
static void setCurrentJVMLocalSourceTransferable(Transferable t)
synchronized void setTargetActions(int actions)
update the peer's notion of the Target's actions
Protected Methods
abstract void doDropDone(boolean success, int dropAction, boolean isLocal)
void eventPosted(SunDropTargetEvent e)
void eventProcessed(SunDropTargetEvent e, int returnValue, boolean dispatcherDone)
abstract Object getNativeData(long format)
synchronized long getNativeDragContext()
int postDropTargetEvent(Component component, int x, int y, int dropAction, int actions, long[] formats, long nativeCtxt, int eventID, boolean dispatchType)
void processDropMessage(SunDropTargetEvent event)
void processEnterMessage(SunDropTargetEvent event)
actual processing on EventQueue Thread
void processExitMessage(SunDropTargetEvent event)
void processMotionMessage(SunDropTargetEvent event, boolean operationChanged)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.awt.datatransfer.Transferable
From interface java.awt.dnd.peer.DropTargetContextPeer

Constants

public static final boolean DISPATCH_SYNC

Constant Value: true

protected static final int STATUS_ACCEPT

Constant Value: 2 (0x00000002)

protected static final int STATUS_NONE

Constant Value: 0 (0x00000000)

protected static final int STATUS_REJECT

Constant Value: -1 (0xffffffff)

protected static final int STATUS_WAIT

Constant Value: 1 (0x00000001)

Fields

protected static final Object _globalLock

protected static Transferable currentJVMLocalSourceTransferable

protected boolean dropComplete

protected int dropStatus

Public Constructors

public SunDropTargetContextPeer ()

create the peer

Public Methods

public synchronized void acceptDrag (int dragOperation)

acceptDrag

public synchronized void acceptDrop (int dropOperation)

acceptDrop

public synchronized void dropComplete (boolean success)

signal drop complete

public DropTarget getDropTarget ()

get the DropTarget associated with this peer

Returns
  • the DropTarget associated with this peer

public int getTargetActions ()

get the current Target actions

Returns
  • the current target actions

public Object getTransferData (DataFlavor df)

Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.

Parameters
df the requested flavor for the data
Returns
  • the data

public DataFlavor[] getTransferDataFlavors ()

Returns an array of DataFlavor objects indicating the flavors the data can be provided in. The array should be ordered according to preference for providing the data (from most richly descriptive to least descriptive).

Returns
  • current DataFlavors available

public Transferable getTransferable ()

get the Transferable associated with the drop

public boolean isDataFlavorSupported (DataFlavor df)

Returns whether or not the specified data flavor is supported for this object.

Parameters
df the requested flavor for the data
Returns
  • if the flavor is supported

public boolean isTransferableJVMLocal ()

Returns
  • if the transfer is a local one

public synchronized void rejectDrag ()

rejectDrag

public synchronized void rejectDrop ()

reject Drop

public static void setCurrentJVMLocalSourceTransferable (Transferable t)

public synchronized void setTargetActions (int actions)

update the peer's notion of the Target's actions

Parameters
actions set the current actions

Protected Methods

protected abstract void doDropDone (boolean success, int dropAction, boolean isLocal)

protected void eventPosted (SunDropTargetEvent e)

protected void eventProcessed (SunDropTargetEvent e, int returnValue, boolean dispatcherDone)

protected abstract Object getNativeData (long format)

Throws
IOException

protected synchronized long getNativeDragContext ()

protected int postDropTargetEvent (Component component, int x, int y, int dropAction, int actions, long[] formats, long nativeCtxt, int eventID, boolean dispatchType)

protected void processDropMessage (SunDropTargetEvent event)

protected void processEnterMessage (SunDropTargetEvent event)

actual processing on EventQueue Thread

protected void processExitMessage (SunDropTargetEvent event)

protected void processMotionMessage (SunDropTargetEvent event, boolean operationChanged)