Java Code Examples for sun.awt.dnd.SunDropTargetEvent#getID()

The following examples show how to use sun.awt.dnd.SunDropTargetEvent#getID() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WDropTargetContextPeer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 2
Source File: WDropTargetContextPeer.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 3
Source File: WDropTargetContextPeer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 4
Source File: WDropTargetContextPeer.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 5
Source File: WDropTargetContextPeer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 6
Source File: WDropTargetContextPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 7
Source File: WDropTargetContextPeer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 8
Source File: WDropTargetContextPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example 9
Source File: WDropTargetContextPeer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected void eventPosted(final SunDropTargetEvent e) {
    if (e.getID() != SunDropTargetEvent.MOUSE_DROPPED) {
        Runnable runnable = new Runnable() {
                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);
    }
}
 
Example 10
Source File: Container.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 11
Source File: Container.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 12
Source File: Container.java    From Java8CN with Apache License 2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 13
Source File: Container.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 14
Source File: Container.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 15
Source File: Container.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 16
Source File: Container.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 17
Source File: Container.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 18
Source File: Container.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 19
Source File: Container.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}
 
Example 20
Source File: Container.java    From jdk-1.7-annotated with Apache License 2.0 4 votes vote down vote up
private boolean processDropTargetEvent(SunDropTargetEvent e) {
    int id = e.getID();
    int x = e.getX();
    int y = e.getY();

    /*
     * Fix for BugTraq ID 4395290.
     * It is possible that SunDropTargetEvent's Point is outside of the
     * native container bounds. In this case we truncate coordinates.
     */
    if (!nativeContainer.contains(x, y)) {
        final Dimension d = nativeContainer.getSize();
        if (d.width <= x) {
            x = d.width - 1;
        } else if (x < 0) {
            x = 0;
        }
        if (d.height <= y) {
            y = d.height - 1;
        } else if (y < 0) {
            y = 0;
        }
    }
    Component mouseOver =   // not necessarily sensitive to mouse events
        nativeContainer.getDropTargetEventTarget(x, y,
                                                 Container.INCLUDE_SELF);
    trackMouseEnterExit(mouseOver, e);

    if (mouseOver != nativeContainer && mouseOver != null) {
        switch (id) {
        case SunDropTargetEvent.MOUSE_ENTERED:
        case SunDropTargetEvent.MOUSE_EXITED:
            break;
        default:
            retargetMouseEvent(mouseOver, id, e);
            e.consume();
            break;
        }
    }
    return e.isConsumed();
}