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 |
|
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
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.awt.datatransfer.Transferable
|
From interface
java.awt.dnd.peer.DropTargetContextPeer
|
Constants
public
static
final
boolean
DISPATCH_SYNC
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
Public Constructors
public
SunDropTargetContextPeer
()
Public Methods
public
synchronized
void
acceptDrag
(int dragOperation)
public
synchronized
void
acceptDrop
(int dropOperation)
public
synchronized
void
dropComplete
(boolean success)
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
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 |
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
()
public
synchronized
void
rejectDrop
()
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
eventProcessed
(SunDropTargetEvent e, int returnValue, boolean dispatcherDone)
protected
abstract
Object
getNativeData
(long format)
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
processEnterMessage
(SunDropTargetEvent event)
actual processing on EventQueue Thread