Search in sources :

Example 1 with DragSourceDragEvent

use of java.awt.dnd.DragSourceDragEvent in project jdk8u_jdk by JetBrains.

the class SunDragSourceContextPeer method postDragSourceDragEvent.

protected final void postDragSourceDragEvent(final int targetAction, final int modifiers, final int x, final int y, final int dispatchType) {
    final int dropAction = SunDragSourceContextPeer.convertModifiersToDropAction(modifiers, sourceActions);
    DragSourceDragEvent event = new DragSourceDragEvent(getDragSourceContext(), dropAction, targetAction & sourceActions, modifiers, x, y);
    EventDispatcher dispatcher = new EventDispatcher(dispatchType, event);
    SunToolkit.invokeLaterOnAppContext(SunToolkit.targetToAppContext(getComponent()), dispatcher);
    startSecondaryEventLoop();
}
Also used : DragSourceDragEvent(java.awt.dnd.DragSourceDragEvent) Point(java.awt.Point)

Example 2 with DragSourceDragEvent

use of java.awt.dnd.DragSourceDragEvent in project jna by java-native-access.

the class DragHandler method describe.

private void describe(String type, DragSourceEvent e) {
    if (false) {
        DragSourceContext ds = e.getDragSourceContext();
        String msg = "drag: " + type;
        if (e instanceof DragSourceDragEvent) {
            DragSourceDragEvent ev = (DragSourceDragEvent) e;
            msg += ": src=" + actionString(ds.getSourceActions()) + " usr=" + actionString(ev.getUserAction()) + " tgt=" + actionString(ev.getTargetActions()) + " act=" + actionString(ev.getDropAction()) + " mods=" + ev.getGestureModifiersEx();
        } else {
            msg += ": e=" + e;
        }
        if (!msg.equals(lastAction)) {
            System.out.println(lastAction = msg);
        }
    }
}
Also used : DragSourceDragEvent(java.awt.dnd.DragSourceDragEvent) DragSourceContext(java.awt.dnd.DragSourceContext)

Aggregations

DragSourceDragEvent (java.awt.dnd.DragSourceDragEvent)2 Point (java.awt.Point)1 DragSourceContext (java.awt.dnd.DragSourceContext)1