Java 类sun.awt.dnd.SunDropTargetEvent 实例源码

项目:OpenJSharp    文件:Container.java   
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);
}
项目:OpenJSharp    文件:EventQueue.java   
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;
    }
}
项目:OpenJSharp    文件:CDropTargetContextPeer.java   
@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);
}
项目:OpenJSharp    文件:WDropTargetContextPeer.java   
@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);
    }
}
项目:OpenJSharp    文件:XDropTargetContextPeer.java   
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);
        }
    }
}
项目:jdk8u-jdk    文件:Container.java   
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);
}
项目:jdk8u-jdk    文件:EventQueue.java   
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;
    }
}
项目:jdk8u-jdk    文件:CDropTargetContextPeer.java   
@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);
}
项目:jdk8u-jdk    文件:WDropTargetContextPeer.java   
@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);
    }
}
项目:jdk8u-jdk    文件:XDropTargetContextPeer.java   
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);
        }
    }
}
项目:openjdk-jdk10    文件:Container.java   
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);
}
项目:openjdk-jdk10    文件:EventQueue.java   
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;
    }
}
项目:openjdk-jdk10    文件:XDropTargetContextPeer.java   
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);
        }
    }
}
项目:openjdk-jdk10    文件:CDropTargetContextPeer.java   
@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);
}
项目:openjdk-jdk10    文件:WDropTargetContextPeer.java   
@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);
    }
}
项目:openjdk9    文件:Container.java   
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);
}
项目:openjdk9    文件:EventQueue.java   
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;
    }
}
项目:openjdk9    文件:XDropTargetContextPeer.java   
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);
        }
    }
}
项目:openjdk9    文件:CDropTargetContextPeer.java   
@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);
}
项目:openjdk9    文件:WDropTargetContextPeer.java   
@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);
    }
}
项目:Java8CN    文件:Container.java   
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);
}
项目:Java8CN    文件:EventQueue.java   
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;
    }
}
项目:jdk8u_jdk    文件:Container.java   
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);
}
项目:jdk8u_jdk    文件:EventQueue.java   
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;
    }
}
项目:jdk8u_jdk    文件:CDropTargetContextPeer.java   
@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);
}
项目:jdk8u_jdk    文件:WDropTargetContextPeer.java   
@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);
    }
}
项目:jdk8u_jdk    文件:XDropTargetContextPeer.java   
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);
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Container.java   
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);
}
项目:lookaside_java-1.8.0-openjdk    文件:EventQueue.java   
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;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:CDropTargetContextPeer.java   
@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);
}
项目:lookaside_java-1.8.0-openjdk    文件:WDropTargetContextPeer.java   
@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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:XDropTargetContextPeer.java   
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);
        }
    }
}
项目:jdk-1.7-annotated    文件:EventQueue.java   
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;
}
项目:infobip-open-jdk-8    文件:Container.java   
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);
}
项目:infobip-open-jdk-8    文件:EventQueue.java   
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;
    }
}
项目:infobip-open-jdk-8    文件:CDropTargetContextPeer.java   
@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);
}
项目:infobip-open-jdk-8    文件:WDropTargetContextPeer.java   
@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);
    }
}
项目:infobip-open-jdk-8    文件:XDropTargetContextPeer.java   
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);
        }
    }
}
项目:jdk8u-dev-jdk    文件:Container.java   
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);
}
项目:jdk8u-dev-jdk    文件:EventQueue.java   
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;
    }
}