Java Code Examples for sun.awt.dnd.SunDragSourceContextPeer#convertModifiersToDropAction()

The following examples show how to use sun.awt.dnd.SunDragSourceContextPeer#convertModifiersToDropAction() . 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: XMouseDragGestureRecognizer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Do not allow right mouse button drag since Motif DnD does not
    // terminate drag operation on right mouse button release.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 2
Source File: WMouseDragGestureRecognizer.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Prohibit multi-button drags.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK ||
          btns == InputEvent.BUTTON3_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 3
Source File: WMouseDragGestureRecognizer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Prohibit multi-button drags.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK ||
          btns == InputEvent.BUTTON3_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 4
Source File: WMouseDragGestureRecognizer.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Prohibit multi-button drags.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK ||
          btns == InputEvent.BUTTON3_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 5
Source File: WMouseDragGestureRecognizer.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Prohibit multi-button drags.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK ||
          btns == InputEvent.BUTTON3_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 6
Source File: XMouseDragGestureRecognizer.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Do not allow right mouse button drag since Motif DnD does not
    // terminate drag operation on right mouse button release.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 7
Source File: WMouseDragGestureRecognizer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Prohibit multi-button drags.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK ||
          btns == InputEvent.BUTTON3_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 8
Source File: XMouseDragGestureRecognizer.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * determine the drop action from the event
 */

protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // Do not allow right mouse button drag since Motif DnD does not
    // terminate drag operation on right mouse button release.
    if (!(btns == InputEvent.BUTTON1_DOWN_MASK ||
          btns == InputEvent.BUTTON2_DOWN_MASK)) {
        return DnDConstants.ACTION_NONE;
    }

    return
        SunDragSourceContextPeer.convertModifiersToDropAction(mods,
                                                              getSourceActions());
}
 
Example 9
Source File: XDragSourceContextPeer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the source action according to the specified state.
 *
 * @returns true if the source
 */
private boolean updateSourceAction(int state) {
    int action = SunDragSourceContextPeer.convertModifiersToDropAction(XWindow.getModifiers(state, 0, 0),
                                                                       sourceActions);
    if (sourceAction == action) {
        return false;
    }
    sourceAction = action;
    return true;
}
 
Example 10
Source File: XDragSourceContextPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the source action according to the specified state.
 *
 * @return true if the source
 */
private boolean updateSourceAction(int state) {
    int action = SunDragSourceContextPeer.convertModifiersToDropAction(XWindow.getModifiers(state, 0, 0),
                                                                       sourceActions);
    if (sourceAction == action) {
        return false;
    }
    sourceAction = action;
    return true;
}
 
Example 11
Source File: DragRecognitionSupport.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private int mapDragOperationFromModifiers(MouseEvent me,
                                          TransferHandler th) {

    if (th == null || !SwingUtilities.isLeftMouseButton(me)) {
        return TransferHandler.NONE;
    }

    return SunDragSourceContextPeer.
        convertModifiersToDropAction(me.getModifiersEx(),
                                     th.getSourceActions(component));
}
 
Example 12
Source File: DragRecognitionSupport.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private int mapDragOperationFromModifiers(MouseEvent me,
                                          TransferHandler th) {

    if (th == null || !SwingUtilities.isLeftMouseButton(me)) {
        return TransferHandler.NONE;
    }

    return SunDragSourceContextPeer.
        convertModifiersToDropAction(me.getModifiersEx(),
                                     th.getSourceActions(component));
}
 
Example 13
Source File: CMouseDragGestureRecognizer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // 8-29-02 VL: this shouldn't apply to OS X but let's leave this commented out until verified:
    // Do not allow right mouse button drag since Motif DnD does not terminate drag operation on right mouse button release.
    //if (!(btns == InputEvent.BUTTON1_DOWN_MASK || btns == InputEvent.BUTTON2_DOWN_MASK)) {
    //    return DnDConstants.ACTION_NONE;
    //}

    return SunDragSourceContextPeer.convertModifiersToDropAction(mods, getSourceActions());
}
 
Example 14
Source File: CMouseDragGestureRecognizer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // 8-29-02 VL: this shouldn't apply to OS X but let's leave this commented out until verified:
    // Do not allow right mouse button drag since Motif DnD does not terminate drag operation on right mouse button release.
    //if (!(btns == InputEvent.BUTTON1_DOWN_MASK || btns == InputEvent.BUTTON2_DOWN_MASK)) {
    //    return DnDConstants.ACTION_NONE;
    //}

    return SunDragSourceContextPeer.convertModifiersToDropAction(mods, getSourceActions());
}
 
Example 15
Source File: DragRecognitionSupport.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private int mapDragOperationFromModifiers(MouseEvent me,
                                          TransferHandler th) {

    if (th == null || !SwingUtilities.isLeftMouseButton(me)) {
        return TransferHandler.NONE;
    }

    return SunDragSourceContextPeer.
        convertModifiersToDropAction(me.getModifiersEx(),
                                     th.getSourceActions(component));
}
 
Example 16
Source File: XDragSourceContextPeer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the source action according to the specified state.
 *
 * @returns true if the source
 */
private boolean updateSourceAction(int state) {
    int action = SunDragSourceContextPeer.convertModifiersToDropAction(XWindow.getModifiers(state, 0, 0),
                                                                       sourceActions);
    if (sourceAction == action) {
        return false;
    }
    sourceAction = action;
    return true;
}
 
Example 17
Source File: XDragSourceContextPeer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the source action according to the specified state.
 *
 * @returns true if the source
 */
private boolean updateSourceAction(int state) {
    int action = SunDragSourceContextPeer.convertModifiersToDropAction(XWindow.getModifiers(state, 0, 0),
                                                                       sourceActions);
    if (sourceAction == action) {
        return false;
    }
    sourceAction = action;
    return true;
}
 
Example 18
Source File: XDragSourceContextPeer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the source action according to the specified state.
 *
 * @returns true if the source
 */
private boolean updateSourceAction(int state) {
    int action = SunDragSourceContextPeer.convertModifiersToDropAction(XWindow.getModifiers(state, 0, 0),
                                                                       sourceActions);
    if (sourceAction == action) {
        return false;
    }
    sourceAction = action;
    return true;
}
 
Example 19
Source File: CMouseDragGestureRecognizer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected int mapDragOperationFromModifiers(MouseEvent e) {
    int mods = e.getModifiersEx();
    int btns = mods & ButtonMask;

    // 8-29-02 VL: this shouldn't apply to OS X but let's leave this commented out until verified:
    // Do not allow right mouse button drag since Motif DnD does not terminate drag operation on right mouse button release.
    //if (!(btns == InputEvent.BUTTON1_DOWN_MASK || btns == InputEvent.BUTTON2_DOWN_MASK)) {
    //    return DnDConstants.ACTION_NONE;
    //}

    return SunDragSourceContextPeer.convertModifiersToDropAction(mods, getSourceActions());
}
 
Example 20
Source File: DragRecognitionSupport.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private int mapDragOperationFromModifiers(MouseEvent me,
                                          TransferHandler th) {

    if (th == null || !SwingUtilities.isLeftMouseButton(me)) {
        return TransferHandler.NONE;
    }

    return SunDragSourceContextPeer.
        convertModifiersToDropAction(me.getModifiersEx(),
                                     th.getSourceActions(component));
}