APIdia Launch Partner
Top Description Fields Constructors Methods
sun.awt.X11

public final Class XDragSourceContextPeer

extends SunDragSourceContextPeer
implements XDragSourceProtocolListener
Class Inheritance
All Implemented Interfaces
sun.awt.X11.XDragSourceProtocolListener
Imports
java.awt.Component, .Cursor, .Toolkit, .Window, java.awt.datatransfer.DataFlavor, .Transferable, java.awt.dnd.DnDConstants, .DragGestureEvent, .InvalidDnDOperationException, java.util.*, sun.java2d.pipe.Region, sun.util.logging.PlatformLogger, sun.awt.dnd.SunDragSourceContextPeer, .SunDropTargetContextPeer, sun.awt.SunToolkit, .AWTAccessor

The XDragSourceContextPeer class is the class responsible for handling the interaction between the XDnD/Motif DnD subsystem and Java drag sources.
Since
1.5

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private XDragSourceProtocol
private long
private int
private static final int
private static final PlatformLogger
private long
private static final int
private long
private int
private int
private long[]
private int
private long
private static final XDragSourceContextPeer
pack-priv int
private int
private int
Inherited from sun.awt.dnd.SunDragSourceContextPeer:
DISPATCH_CHANGEDDISPATCH_ENTERDISPATCH_EXITDISPATCH_FINISHDISPATCH_MOTIONDISPATCH_MOUSE_MOVED

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
cleanup(long time)

Implements sun.awt.X11.XDragSourceProtocolListener.cleanup.

The caller must own awtLock.

private void
cleanupTargetInfo()

The caller must own awtLock.

pack-priv static XDragSourceContextPeer
private boolean

Returns:

true if the event was processed and shouldn't be passed along.
doProcessEvent
(XEvent ev)

The caller must own awtLock.

private void
doUpdateTargetWindow(long subwindow, long time)

private static long
findClientWindow(long window)

Returns the client window under the specified root subwindow.

public long
pack-priv static XDragSourceProtocolListener
public void
handleDragFinished()

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

public void
handleDragFinished(boolean success)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

public void
handleDragFinished(boolean success, int action)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

public void
handleDragFinished(boolean success, int action, int x, int y)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

public void
handleDragReply(int action)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Called when a reply from the current drop target is received.

public void
handleDragReply(int action, int x, int y)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Called when a reply from the current drop target is received.

public void
handleDragReply(int action, int x, int y, int modifiers)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Called when a reply from the current drop target is received.

private static boolean

Returns:

true if window has XdndAware property when running under Wayland
isXWaylandDndAwareWindow
(long
to test
window
)

Our X11 code expects the drop target window to be a top level window and to have the XA_WM_STATE property.

protected boolean
private boolean
private void
pack-priv static boolean
private void
private boolean
private void
removeDnDGrab(long time)

public int
scaleDown(int x)

public int
scaleUp(int x)

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

Implements abstract sun.awt.dnd.SunDragSourceContextPeer.setNativeCursor.

downcall into native code

public static void
private void
protected void
startDrag(Transferable transferable, long[] formats, Map<Long, DataFlavor> formatMap)

Implements abstract sun.awt.dnd.SunDragSourceContextPeer.startDrag.

private void
throwGrabFailureException(String msg, int grabStatus)

private boolean

Returns:

true if the source
updateSourceAction
(int state)

Updates the source action according to the specified state.

private void
Inherited from sun.awt.dnd.SunDragSourceContextPeer:
checkDragDropInProgresscheckEventconvertModifiersToDropActiondragDropFinisheddragEnterdragExitgetComponentgetCursorgetDragImagegetDragImageOffsetgetDragSourceContextgetNativeContextgetTriggerisDragDropInProgresspostDragSourceDragEventquitSecondaryEventLoopsetDragDropInProgresssetNativeContextsetTriggerstartDragstartSecondaryEventLooptransferablesFlavorsChanged

Field Detail

dndInProgressback to summary
private boolean dndInProgress
dragInProgressback to summary
private boolean dragInProgress
dragProtocolback to summary
private XDragSourceProtocol dragProtocol
dragRootWindowback to summary
private long dragRootWindow
eventStateback to summary
private int eventState
GRAB_EVENT_MASKback to summary
private static final int GRAB_EVENT_MASK
loggerback to summary
private static final PlatformLogger logger
proxyModeSourceWindowback to summary
private long proxyModeSourceWindow
ROOT_EVENT_MASKback to summary
private static final int ROOT_EVENT_MASK
rootEventMaskback to summary
private long rootEventMask
sourceActionback to summary
private int sourceAction
sourceActionsback to summary
private int sourceActions

Hides sun.awt.dnd.SunDragSourceContextPeer.sourceActions.

sourceFormatsback to summary
private long[] sourceFormats
targetActionback to summary
private int targetAction
targetRootSubwindowback to summary
private long targetRootSubwindow
theInstanceback to summary
private static final XDragSourceContextPeer theInstance
windowScaleback to summary
pack-priv int windowScale
xRootback to summary
private int xRoot
yRootback to summary
private int yRoot

Constructor Detail

XDragSourceContextPeerback to summary
private XDragSourceContextPeer(DragGestureEvent dge)

Method Detail

cleanupback to summary
public void cleanup(long time)

Implements sun.awt.X11.XDragSourceProtocolListener.cleanup.

The caller must own awtLock.

Annotations
@Override
cleanupTargetInfoback to summary
private void cleanupTargetInfo()

The caller must own awtLock.

createDragSourceContextPeerback to summary
pack-priv static XDragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException
doProcessEventback to summary
private boolean doProcessEvent(XEvent ev)

The caller must own awtLock.

Returns:boolean

true if the event was processed and shouldn't be passed along.

doUpdateTargetWindowback to summary
private void doUpdateTargetWindow(long subwindow, long time)
findClientWindowback to summary
private static long findClientWindow(long window)

Returns the client window under the specified root subwindow.

getProxyModeSourceWindowback to summary
public long getProxyModeSourceWindow()
getXDragSourceProtocolListenerback to summary
pack-priv static XDragSourceProtocolListener getXDragSourceProtocolListener()
handleDragFinishedback to summary
public void handleDragFinished()

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Doc from sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

Annotations
@Override
handleDragFinishedback to summary
public void handleDragFinished(boolean success)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Doc from sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

Annotations
@Override
handleDragFinishedback to summary
public void handleDragFinished(boolean success, int action)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Doc from sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

Annotations
@Override
handleDragFinishedback to summary
public void handleDragFinished(boolean success, int action, int x, int y)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Doc from sun.awt.X11.XDragSourceProtocolListener.handleDragFinished.

Called when the current drop target signals that the drag-and-drop operation is finished.

Annotations
@Override
handleDragReplyback to summary
public void handleDragReply(int action)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Doc from sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Called when a reply from the current drop target is received.

Annotations
@Override
handleDragReplyback to summary
public void handleDragReply(int action, int x, int y)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Doc from sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Called when a reply from the current drop target is received.

Annotations
@Override
handleDragReplyback to summary
public void handleDragReply(int action, int x, int y, int modifiers)

Implements sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Doc from sun.awt.X11.XDragSourceProtocolListener.handleDragReply.

Called when a reply from the current drop target is received.

Annotations
@Override
isXWaylandDndAwareWindowback to summary
private static boolean isXWaylandDndAwareWindow(long window)

Our X11 code expects the drop target window to be a top level window and to have the XA_WM_STATE property. This is not true when performing drag and drop from XWayland to a native Wayland application. In this case XWayland creates a dummy window with only one property, XdndAware.

Parameters
window:long

to test

Returns:boolean

true if window has XdndAware property when running under Wayland

needsBogusExitBeforeDropback to summary
protected boolean needsBogusExitBeforeDrop()
processClientMessageback to summary
private boolean processClientMessage(XClientMessageEvent xclient)
processDropback to summary
private void processDrop(XButtonEvent xbutton)
processEventback to summary
pack-priv static boolean processEvent(XEvent ev)
processMouseMoveback to summary
private void processMouseMove(XMotionEvent xmotion)
processProxyModeEventback to summary
private boolean processProxyModeEvent(XEvent ev)
removeDnDGrabback to summary
private void removeDnDGrab(long time)
scaleDownback to summary
public int scaleDown(int x)
scaleUpback to summary
public int scaleUp(int x)
setCursorback to summary
public void setCursor(Cursor c) throws InvalidDnDOperationException

Overrides sun.awt.dnd.SunDragSourceContextPeer.setCursor.

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

set cursor

Annotations
@Override
setNativeCursorback to summary
protected void setNativeCursor(long nativeCtxt, Cursor c, int cType)

Implements abstract sun.awt.dnd.SunDragSourceContextPeer.setNativeCursor.

Doc from sun.awt.dnd.SunDragSourceContextPeer.setNativeCursor.

downcall into native code

Annotations
@Override
setProxyModeSourceWindowback to summary
public static void setProxyModeSourceWindow(long window)
setProxyModeSourceWindowImplback to summary
private void setProxyModeSourceWindowImpl(long window)
startDragback to summary
protected void startDrag(Transferable transferable, long[] formats, Map<Long, DataFlavor> formatMap)

Implements abstract sun.awt.dnd.SunDragSourceContextPeer.startDrag.

Annotations
@Override
throwGrabFailureExceptionback to summary
private void throwGrabFailureException(String msg, int grabStatus) throws InvalidDnDOperationException
updateSourceActionback to summary
private boolean updateSourceAction(int state)

Updates the source action according to the specified state.

Returns:boolean

true if the source

updateTargetWindowback to summary
private void updateTargetWindow(XMotionEvent xmotion)