当前位置: 首页>>代码示例>>Java>>正文


Java SunDropTargetEvent类代码示例

本文整理汇总了Java中sun.awt.dnd.SunDropTargetEvent的典型用法代码示例。如果您正苦于以下问题:Java SunDropTargetEvent类的具体用法?Java SunDropTargetEvent怎么用?Java SunDropTargetEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SunDropTargetEvent类属于sun.awt.dnd包,在下文中一共展示了SunDropTargetEvent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: trackMouseEnterExit

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
private void trackMouseEnterExit(Component targetOver, MouseEvent e) {
    if (e instanceof SunDropTargetEvent) {
        trackDropTargetEnterExit(targetOver, e);
        return;
    }
    int id = e.getID();

    if ( id != MouseEvent.MOUSE_EXITED &&
         id != MouseEvent.MOUSE_DRAGGED &&
         id != LWD_MOUSE_DRAGGED_OVER &&
            !isMouseInNativeContainer) {
        // any event but an exit or drag means we're in the native container
        isMouseInNativeContainer = true;
        startListeningForOtherDrags();
    } else if (id == MouseEvent.MOUSE_EXITED) {
        isMouseInNativeContainer = false;
        stopListeningForOtherDrags();
    }
    targetLastEntered = retargetMouseEnterExit(targetOver, e,
                                               targetLastEntered,
                                               isMouseInNativeContainer);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:Container.java

示例2: eventToCacheIndex

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
private static int eventToCacheIndex(AWTEvent e) {
    switch(e.getID()) {
    case PaintEvent.PAINT:
        return PAINT;
    case PaintEvent.UPDATE:
        return UPDATE;
    case MouseEvent.MOUSE_MOVED:
        return MOVE;
    case MouseEvent.MOUSE_DRAGGED:
        // Return -1 for SunDropTargetEvent since they are usually synchronous
        // and we don't want to skip them by coalescing with MouseEvent or other drag events
        return e instanceof SunDropTargetEvent ? -1 : DRAG;
    default:
        return e instanceof PeerEvent ? PEER : -1;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:EventQueue.java

示例3: processMotionMessage

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
@Override
protected void processMotionMessage(SunDropTargetEvent event, boolean operationChanged) {
    boolean eventInsideTarget = isEventInsideTarget(event);
    if (event.getComponent().getDropTarget() == insideTarget) {
        if (!eventInsideTarget) {
            processExitMessage(event);
            return;
        }
    } else {
        if (eventInsideTarget) {
            processEnterMessage(event);
        } else {
            return;
        }
    }
    super.processMotionMessage(event, operationChanged);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:CDropTargetContextPeer.java

示例4: eventPosted

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
@Override
protected void eventPosted(final SunDropTargetEvent e) {
    if (e.getID() != SunDropTargetEvent.MOUSE_DROPPED) {
        Runnable runnable = new Runnable() {
                @Override
                public void run() {
                    e.getDispatcher().unregisterAllEvents();
                }
            };
        // NOTE: this PeerEvent must be a NORM_PRIORITY event to be
        // dispatched after this SunDropTargetEvent, but before the next
        // one, so we should pass zero flags.
        PeerEvent peerEvent = new PeerEvent(e.getSource(), runnable, 0);
        SunToolkit.executeOnEventHandlerThread(peerEvent);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:WDropTargetContextPeer.java

示例5: eventProcessed

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
protected void eventProcessed(SunDropTargetEvent e, int returnValue,
                              boolean dispatcherDone) {
    /* The native context is the pointer to the XClientMessageEvent
       structure. */
    long ctxt = getNativeDragContext();
    /* If the event was not consumed, send a response to the source. */
    try {
        if (ctxt != 0 && !e.isConsumed()) {
            Iterator dropTargetProtocols =
                XDragAndDropProtocols.getDropTargetProtocols();

            while (dropTargetProtocols.hasNext()) {
                XDropTargetProtocol dropTargetProtocol =
                    (XDropTargetProtocol)dropTargetProtocols.next();
                if (dropTargetProtocol.sendResponse(ctxt, e.getID(),
                                                    returnValue)) {
                    break;
                }
            }
        }
    } finally {
        if (dispatcherDone && ctxt != 0) {
            unsafe.freeMemory(ctxt);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:XDropTargetContextPeer.java

示例6: trackMouseEnterExit

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
private void trackMouseEnterExit(Component targetOver, MouseEvent e) {
    if (e instanceof SunDropTargetEvent) {
        trackDropTargetEnterExit(targetOver, e);
        return;
    }
    int id = e.getID();

    if ( id != MouseEvent.MOUSE_EXITED &&
         id != MouseEvent.MOUSE_DRAGGED &&
         id != LWD_MOUSE_DRAGGED_OVER &&
            !isMouseInNativeContainer) {
        // any event but an exit or drag means we're in the native container
        isMouseInNativeContainer = true;
        startListeningForOtherDrags();
    } else if (id == MouseEvent.MOUSE_EXITED) {
        isMouseInNativeContainer = false;
        stopListeningForOtherDrags();
    }
    Component tle = retargetMouseEnterExit(targetOver, e,
                                               targetLastEntered.get(),
                                               isMouseInNativeContainer);
    targetLastEntered = new WeakReference<>(tle);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:24,代码来源:Container.java

示例7: eventProcessed

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
protected void eventProcessed(SunDropTargetEvent e, int returnValue,
                              boolean dispatcherDone) {
    /* The native context is the pointer to the XClientMessageEvent
       structure. */
    long ctxt = getNativeDragContext();
    /* If the event was not consumed, send a response to the source. */
    try {
        if (ctxt != 0 && !e.isConsumed()) {
            Iterator<XDropTargetProtocol> dropTargetProtocols =
                XDragAndDropProtocols.getDropTargetProtocols();

            while (dropTargetProtocols.hasNext()) {
                XDropTargetProtocol dropTargetProtocol =
                    dropTargetProtocols.next();
                if (dropTargetProtocol.sendResponse(ctxt, e.getID(),
                                                    returnValue)) {
                    break;
                }
            }
        }
    } finally {
        if (dispatcherDone && ctxt != 0) {
            unsafe.freeMemory(ctxt);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:XDropTargetContextPeer.java

示例8: coalesceMouseEvent

import sun.awt.dnd.SunDropTargetEvent; //导入依赖的package包/类
private boolean coalesceMouseEvent(MouseEvent e) {
    if (e instanceof SunDropTargetEvent) {
        // SunDropTargetEvent should not coalesce with MouseEvent
        return false;
    }
    EventQueueItem[] cache = ((Component)e.getSource()).eventCache;
    if (cache == null) {
        return false;
    }
    int index = eventToCacheIndex(e);
    if (index != -1 && cache[index] != null) {
        cache[index].event = e;
        return true;
    }
    return false;
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:17,代码来源:EventQueue.java


注:本文中的sun.awt.dnd.SunDropTargetEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。