當前位置: 首頁>>代碼示例>>Java>>正文


Java DragSourceEvent類代碼示例

本文整理匯總了Java中java.awt.dnd.DragSourceEvent的典型用法代碼示例。如果您正苦於以下問題:Java DragSourceEvent類的具體用法?Java DragSourceEvent怎麽用?Java DragSourceEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DragSourceEvent類屬於java.awt.dnd包,在下文中一共展示了DragSourceEvent類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dragDropFinished

import java.awt.dnd.DragSourceEvent; //導入依賴的package包/類
/**
 * upcall from native code via implemented class (do)
 */

protected final void dragDropFinished(final boolean success,
                                      final int operations,
                                      final int x, final int y) {
    DragSourceEvent event =
        new DragSourceDropEvent(getDragSourceContext(),
                                operations & sourceActions,
                                success, x, y);
    EventDispatcher dispatcher =
        new EventDispatcher(DISPATCH_FINISH, event);

    SunToolkit.invokeLaterOnAppContext(
        SunToolkit.targetToAppContext(getComponent()), dispatcher);

    startSecondaryEventLoop();
    setNativeContext(0);
    dragImage = null;
    dragImageOffset = null;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:23,代碼來源:SunDragSourceContextPeer.java

示例2: EventDispatcher

import java.awt.dnd.DragSourceEvent; //導入依賴的package包/類
EventDispatcher(int dispatchType, DragSourceEvent event) {
    switch (dispatchType) {
    case DISPATCH_ENTER:
    case DISPATCH_MOTION:
    case DISPATCH_CHANGED:
    case DISPATCH_MOUSE_MOVED:
        if (!(event instanceof DragSourceDragEvent)) {
            throw new IllegalArgumentException("Event: " + event);
        }
        break;
    case DISPATCH_EXIT:
        break;
    case DISPATCH_FINISH:
        if (!(event instanceof DragSourceDropEvent)) {
            throw new IllegalArgumentException("Event: " + event);
        }
        break;
    default:
        throw new IllegalArgumentException("Dispatch type: " +
                                           dispatchType);
    }

    this.dispatchType  = dispatchType;
    this.event         = event;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:26,代碼來源:SunDragSourceContextPeer.java

示例3: run

import java.awt.dnd.DragSourceEvent; //導入依賴的package包/類
public void run() {
    switch (type) {
    case DRAG_ENTER:
        context.dragEnter(newDragSourceDragEvent());
        break;
    case DRAG_OVER:
        context.dragOver(newDragSourceDragEvent());
        break;
    case DRAG_ACTION_CHANGED:
        context.dropActionChanged(newDragSourceDragEvent());
        break;
    case DRAG_MOUSE_MOVED:
        context.dragMouseMoved(newDragSourceDragEvent());
        break;
    case DRAG_EXIT:
        context.dragExit(new DragSourceEvent(context, x, y));
        break;
    case DRAG_DROP_END:
        context.dragExit(new DragSourceDropEvent(
                context, userAction, success, x, y));
        break;
    }
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:24,代碼來源:DragSourceEventProxy.java

示例4: dragExit

import java.awt.dnd.DragSourceEvent; //導入依賴的package包/類
/**
 * upcall from native code
 */

protected final void dragExit(final int x, final int y) {
    DragSourceEvent event =
        new DragSourceEvent(getDragSourceContext(), x, y);
    EventDispatcher dispatcher =
        new EventDispatcher(DISPATCH_EXIT, event);

    SunToolkit.invokeLaterOnAppContext(
        SunToolkit.targetToAppContext(getComponent()), dispatcher);

    startSecondaryEventLoop();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:16,代碼來源:SunDragSourceContextPeer.java


注:本文中的java.awt.dnd.DragSourceEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。