APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.awt.dnd

public abstract Class SunDragSourceContextPeer

extends Object
implements DragSourceContextPeer
Class Inheritance
All Implemented Interfaces
java.awt.dnd.peer.DragSourceContextPeer
Known Direct Subclasses
sun.awt.X11.XDragSourceContextPeer
Imports
java.awt.AWTEvent, .Component, .Cursor, .EventQueue, .Image, .Point, java.awt.datatransfer.Transferable, .DataFlavor, java.awt.dnd.DnDConstants, .DragSourceContext, .DragSourceEvent, .DragSourceDropEvent, .DragSourceDragEvent, .DragGestureEvent, .InvalidDnDOperationException, java.awt.dnd.peer.DragSourceContextPeer, java.awt.event.InputEvent, .MouseEvent, java.util.Map, .SortedMap, sun.awt.SunToolkit, sun.awt.datatransfer.DataTransferer

TBC

Since
1.3.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private Component
private Cursor
private static volatile boolean
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
private static volatile boolean
private Image
private Point
private DragSourceContext
private long
private int
private DragGestureEvent

Constructor Summary

AccessConstructor and Description
public
SunDragSourceContextPeer(DragGestureEvent dge)

construct a new SunDragSourceContextPeer

Method Summary

Modifier and TypeMethod and Description
public static void
public static boolean
checkEvent(AWTEvent event)

Filters out all mouse events that were on the java event queue when startDrag was called.

private void
public static int
convertModifiersToDropAction(final int modifiers, final int supportedActions)

protected final void
dragDropFinished(final boolean success, final int operations, final int x, final int y)

upcall from native code via implemented class (do)

protected void
dragEnter(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

protected final void
dragExit(final int x, final int y)

upcall from native code

private void
dragMotion(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

private void
dragMouseMoved(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

protected Component
public Cursor
public Image

Returns:

the reference to the drag image
getDragImage
()

Returns the drag image.

public Point

Returns:

a Point object that corresponds to coordinates of an anchor offset of the image relative to the upper left corner of the image. The point (0,0) returns by default.
getDragImageOffset
()

Returns an anchor offset for the image to drag.

protected DragSourceContext
private static String
protected synchronized long
protected DragGestureEvent
public static boolean
private void
operationChanged(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

protected final void
postDragSourceDragEvent(final int targetAction, final int modifiers, final int x, final int y, final int dispatchType)

public void
public void
public static void
protected synchronized void
setNativeContext(long ctxt)

protected abstract void
setNativeCursor(long nativeCtxt, Cursor c, int cType)

downcall into native code

protected synchronized void
public void
startDrag(DragSourceContext dsc, Cursor c, Image di, Point p)

Implements java.awt.dnd.peer.DragSourceContextPeer.startDrag.

initiate a DnD operation ...

protected abstract void
startDrag(Transferable trans, long[] formats, Map<Long, DataFlavor> formatMap)

public void
startSecondaryEventLoop()

Synchro messages in AWT

public void
transferablesFlavorsChanged()

Implements java.awt.dnd.peer.DragSourceContextPeer.transferablesFlavorsChanged.

Notify the peer that the transferables' DataFlavors have changed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

componentback to summary
private Component component
cursorback to summary
private Cursor cursor
discardingMouseEventsback to summary
private static volatile boolean discardingMouseEvents
DISPATCH_CHANGEDback to summary
protected static final int DISPATCH_CHANGED
DISPATCH_ENTERback to summary
protected static final int DISPATCH_ENTER
DISPATCH_EXITback to summary
protected static final int DISPATCH_EXIT
DISPATCH_FINISHback to summary
protected static final int DISPATCH_FINISH
DISPATCH_MOTIONback to summary
protected static final int DISPATCH_MOTION
DISPATCH_MOUSE_MOVEDback to summary
protected static final int DISPATCH_MOUSE_MOVED
dragDropInProgressback to summary
private static volatile boolean dragDropInProgress
dragImageback to summary
private Image dragImage
dragImageOffsetback to summary
private Point dragImageOffset
dragSourceContextback to summary
private DragSourceContext dragSourceContext
nativeCtxtback to summary
private long nativeCtxt
sourceActionsback to summary
private int sourceActions
triggerback to summary
private DragGestureEvent trigger

Constructor Detail

SunDragSourceContextPeerback to summary
public SunDragSourceContextPeer(DragGestureEvent dge)

construct a new SunDragSourceContextPeer

Method Detail

checkDragDropInProgressback to summary
public static void checkDragDropInProgress() throws InvalidDnDOperationException
checkEventback to summary
public static boolean checkEvent(AWTEvent event)

Filters out all mouse events that were on the java event queue when startDrag was called.

cleanupback to summary
private void cleanup()
convertModifiersToDropActionback to summary
public static int convertModifiersToDropAction(final int modifiers, final int supportedActions)
dragDropFinishedback to summary
protected final void dragDropFinished(final boolean success, final int operations, final int x, final int y)

upcall from native code via implemented class (do)

dragEnterback to summary
protected void dragEnter(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

dragExitback to summary
protected final void dragExit(final int x, final int y)

upcall from native code

dragMotionback to summary
private void dragMotion(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

dragMouseMovedback to summary
private void dragMouseMoved(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

getComponentback to summary
protected Component getComponent()
getCursorback to summary
public Cursor getCursor()

Implements java.awt.dnd.peer.DragSourceContextPeer.getCursor.

return cursor

getDragImageback to summary
public Image getDragImage()

Returns the drag image. If there is no image to drag, the returned value is null

Returns:Image

the reference to the drag image

getDragImageOffsetback to summary
public Point getDragImageOffset()

Returns an anchor offset for the image to drag.

Returns:Point

a Point object that corresponds to coordinates of an anchor offset of the image relative to the upper left corner of the image. The point (0,0) returns by default.

getDragSourceContextback to summary
protected DragSourceContext getDragSourceContext()
getExceptionMessageback to summary
private static String getExceptionMessage(boolean b)
getNativeContextback to summary
protected synchronized long getNativeContext()
getTriggerback to summary
protected DragGestureEvent getTrigger()
isDragDropInProgressback to summary
public static boolean isDragDropInProgress()
operationChangedback to summary
private void operationChanged(final int targetActions, final int modifiers, final int x, final int y)

upcall from native code

postDragSourceDragEventback to summary
protected final void postDragSourceDragEvent(final int targetAction, final int modifiers, final int x, final int y, final int dispatchType)
quitSecondaryEventLoopback to summary
public void quitSecondaryEventLoop()
setCursorback to summary
public void setCursor(Cursor c) throws InvalidDnDOperationException

Implements java.awt.dnd.peer.DragSourceContextPeer.setCursor.

set cursor

setDragDropInProgressback to summary
public static void setDragDropInProgress(boolean b) throws InvalidDnDOperationException
setNativeContextback to summary
protected synchronized void setNativeContext(long ctxt)
setNativeCursorback to summary
protected abstract void setNativeCursor(long nativeCtxt, Cursor c, int cType)

downcall into native code

setTriggerback to summary
protected synchronized void setTrigger(DragGestureEvent dge)
startDragback to summary
public void startDrag(DragSourceContext dsc, Cursor c, Image di, Point p) throws InvalidDnDOperationException

Implements java.awt.dnd.peer.DragSourceContextPeer.startDrag.

initiate a DnD operation ...

startDragback to summary
protected abstract void startDrag(Transferable trans, long[] formats, Map<Long, DataFlavor> formatMap)
startSecondaryEventLoopback to summary
public void startSecondaryEventLoop()

Synchro messages in AWT

transferablesFlavorsChangedback to summary
public void transferablesFlavorsChanged()

Implements java.awt.dnd.peer.DragSourceContextPeer.transferablesFlavorsChanged.

Notify the peer that the transferables' DataFlavors have changed. No longer useful as the transferables are determined at the time of the drag.

sun.awt.dnd back to summary

private Class SunDragSourceContextPeer.EventDispatcher

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final int
private final DragSourceEvent

Constructor Summary

AccessConstructor and Description
pack-priv
EventDispatcher(int dispatchType, DragSourceEvent event)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dispatchTypeback to summary
private final int dispatchType
eventback to summary
private final DragSourceEvent event

Constructor Detail

EventDispatcherback to summary
pack-priv EventDispatcher(int dispatchType, DragSourceEvent event)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.