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

The following examples show how to use sun.awt.dnd.SunDropTargetEvent#getComponent() . 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: CDropTargetContextPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 2
Source File: CDropTargetContextPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 3
Source File: CDropTargetContextPeer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 4
Source File: CDropTargetContextPeer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 5
Source File: CDropTargetContextPeer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 6
Source File: CDropTargetContextPeer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 7
Source File: CDropTargetContextPeer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 8
Source File: CDropTargetContextPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 9
Source File: CDropTargetContextPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 10
Source File: CDropTargetContextPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 11
Source File: CDropTargetContextPeer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 12
Source File: CDropTargetContextPeer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 13
Source File: CDropTargetContextPeer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 14
Source File: CDropTargetContextPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 15
Source File: CDropTargetContextPeer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 16
Source File: CDropTargetContextPeer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 17
Source File: CDropTargetContextPeer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Could be called when DnD enters a heavyweight or synthesized in processMotionMessage
 */
@Override
protected void processEnterMessage(SunDropTargetEvent event) {
    Component c = event.getComponent();
    DropTarget dt = event.getComponent().getDropTarget();
    if (isEventInsideTarget(event)
            && dt != insideTarget
            && c.isShowing()
            && dt != null
            && dt.isActive()) {
        insideTarget = dt;
        super.processEnterMessage(event);
    }
}
 
Example 18
Source File: CDropTargetContextPeer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 19
Source File: CDropTargetContextPeer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}
 
Example 20
Source File: CDropTargetContextPeer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private boolean isEventInsideTarget(SunDropTargetEvent event) {
    Component eventSource = event.getComponent();
    Point screenPoint = event.getPoint();
    SwingUtilities.convertPointToScreen(screenPoint, eventSource);
    Point locationOnScreen = eventSource.getLocationOnScreen();
    Rectangle screenBounds = new Rectangle(locationOnScreen.x,
                                           locationOnScreen.y,
                                           eventSource.getWidth(),
                                           eventSource.getHeight());
    return screenBounds.contains(screenPoint);
}