Java Code Examples for java.awt.event.InputEvent.CTRL_DOWN_MASK

The following are Jave code examples for showing how to use CTRL_DOWN_MASK of the java.awt.event.InputEvent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: XEmbedHelper.java   View Source Code Vote up 6 votes
/**
     * Converts XEMBED modifiers mask into AWT InputEvent mask
     */
    int getModifiers(int state) {
        int mods = 0;
        if ((state & XEMBED_MODIFIER_SHIFT) != 0) {
            mods |= InputEvent.SHIFT_DOWN_MASK;
        }
        if ((state & XEMBED_MODIFIER_CONTROL) != 0) {
            mods |= InputEvent.CTRL_DOWN_MASK;
        }
        if ((state & XEMBED_MODIFIER_ALT) != 0) {
            mods |= InputEvent.ALT_DOWN_MASK;
        }
        // FIXME: What is super/hyper?
        // FIXME: Experiments show that SUPER is ALT. So what is Alt then?
        if ((state & XEMBED_MODIFIER_SUPER) != 0) {
            mods |= InputEvent.ALT_DOWN_MASK;
        }
//         if ((state & XEMBED_MODIFIER_HYPER) != 0) {
//             mods |= InputEvent.DOWN_MASK;
//         }
        return mods;
    }
 
Example 2
Project: incubator-netbeans   File: WizardUtils.java   View Source Code Vote up 6 votes
public static String keyStrokeToString(KeyStroke keyStroke) {
    int modifiers = keyStroke.getModifiers();
    StringBuffer sb = new StringBuffer();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) > 0) {
        sb.append("Ctrl+"); // NOI18N
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) > 0) {
        sb.append("Alt+"); // NOI18N
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) > 0) {
        sb.append("Shift+"); // NOI18N
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) > 0) {
        sb.append("Meta+"); // NOI18N
    }
    if (keyStroke.getKeyCode() != KeyEvent.VK_SHIFT &&
            keyStroke.getKeyCode() != KeyEvent.VK_CONTROL &&
            keyStroke.getKeyCode() != KeyEvent.VK_META &&
            keyStroke.getKeyCode() != KeyEvent.VK_ALT &&
            keyStroke.getKeyCode() != KeyEvent.VK_ALT_GRAPH) {
        sb.append(Utilities.keyToString(
                KeyStroke.getKeyStroke(keyStroke.getKeyCode(), 0)));
    }
    return sb.toString();
}
 
Example 3
Project: marathonv5   File: KeyStrokeParser.java   View Source Code Vote up 6 votes
public static String getKeyModifierText(int modifiers) {
    if (modifiers == 0) {
        return "";
    }
    StringBuffer sb = new StringBuffer();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        sb.append("Ctrl+");
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
        sb.append("Alt+");
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        sb.append("Shift+");
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
        sb.append("Meta+");
    }
    return sb.toString();
}
 
Example 4
Project: OpenJSharp   File: DragSourceDragEvent.java   View Source Code Vote up 6 votes
/**
 * Sets old modifiers by the new ones.
 */
private void setOldModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_MASK;
    }
}
 
Example 5
Project: Logisim   File: InputEventUtil.java   View Source Code Vote up 6 votes
public static String toKeyDisplayString(int mods) {
	ArrayList<String> arr = new ArrayList<String>();
	if ((mods & InputEvent.META_DOWN_MASK) != 0)
		arr.add(Strings.get("metaMod"));
	if ((mods & InputEvent.CTRL_DOWN_MASK) != 0)
		arr.add(Strings.get("ctrlMod"));
	if ((mods & InputEvent.ALT_DOWN_MASK) != 0)
		arr.add(Strings.get("altMod"));
	if ((mods & InputEvent.SHIFT_DOWN_MASK) != 0)
		arr.add(Strings.get("shiftMod"));

	Iterator<String> it = arr.iterator();
	if (it.hasNext()) {
		StringBuilder ret = new StringBuilder();
		ret.append(it.next());
		while (it.hasNext()) {
			ret.append(" ");
			ret.append(it.next());
		}
		return ret.toString();
	} else {
		return "";
	}
}
 
Example 6
Project: openjdk-jdk10   File: DragSourceDragEvent.java   View Source Code Vote up 6 votes
/**
 * Sets new modifiers by the old ones.
 * The mouse modifiers have higher priority than overlaying key
 * modifiers.
 */
@SuppressWarnings("deprecation")
private void setNewModifiers() {
    if ((gestureModifiers & InputEvent.BUTTON1_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON1_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON2_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON2_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.BUTTON3_MASK) != 0) {
        gestureModifiers |= InputEvent.BUTTON3_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.SHIFT_MASK) != 0) {
        gestureModifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.CTRL_MASK) != 0) {
        gestureModifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((gestureModifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        gestureModifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
}
 
Example 7
Project: openjdk-jdk10   File: AWTKeyStroke.java   View Source Code Vote up 5 votes
@SuppressWarnings("deprecation")
private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
Example 8
Project: incubator-netbeans   File: HyperlinkListener.java   View Source Code Vote up 5 votes
public void mouseMoved (MouseEvent e) {
    JEditorPane c = (JEditorPane) e.getComponent ();
    final NbEditorDocument doc = (NbEditorDocument) c.getDocument ();
    if (highlight != null) highlight.remove ();
    highlight = null;
    runnable = null;
    if (((e.getModifiers() | e.getModifiersEx()) & InputEvent.CTRL_DOWN_MASK) != InputEvent.CTRL_DOWN_MASK) {
        return;
    }

    int offset = c.viewToModel (e.getPoint ());
    highlight (doc, offset);
    c.repaint ();
}
 
Example 9
Project: geomapapp   File: LassoSelectionHandler.java   View Source Code Vote up 5 votes
private boolean testLassoConditions(MouseEvent e) {
	int onmask = InputEvent.BUTTON1_DOWN_MASK;
	int offmask = InputEvent.CTRL_DOWN_MASK
					| InputEvent.SHIFT_DOWN_MASK;
	return (e.getModifiersEx() & (onmask | offmask)) == onmask
			&& (enabled  || isLDown);
}
 
Example 10
Project: incubator-netbeans   File: KeyStrokeUtils.java   View Source Code Vote up 5 votes
/**
 * Get human-readable name for a {@link KeyStroke}.
 */
public static String getKeyStrokeAsText(@NonNull KeyStroke keyStroke) {
    int modifiers = keyStroke.getModifiers ();
    StringBuilder sb = new StringBuilder ();
    if ((modifiers & InputEvent.CTRL_DOWN_MASK) > 0) {
        sb.append(EMACS_CTRL);
    }
    if ((modifiers & InputEvent.ALT_DOWN_MASK) > 0) {
        sb.append(STRING_ALT);
    }
    if ((modifiers & InputEvent.SHIFT_DOWN_MASK) > 0) {
        sb.append (EMACS_SHIFT);
    }
    if ((modifiers & InputEvent.META_DOWN_MASK) > 0) {
        sb.append(STRING_META);
    }
    if (keyStroke.getKeyCode () != KeyEvent.VK_SHIFT &&
        keyStroke.getKeyCode () != KeyEvent.VK_CONTROL &&
        keyStroke.getKeyCode () != KeyEvent.VK_META &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT &&
        keyStroke.getKeyCode () != KeyEvent.VK_ALT_GRAPH) {
        sb.append (Utilities.keyToString (
            KeyStroke.getKeyStroke (keyStroke.getKeyCode (), 0)
        ));
    }
    return sb.toString ();
}
 
Example 11
Project: jdk8u-jdk   File: AWTKeyStroke.java   View Source Code Vote up 5 votes
private static int mapOldModifiers(int modifiers) {
    if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
        modifiers |= InputEvent.SHIFT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_MASK) != 0) {
        modifiers |= InputEvent.ALT_DOWN_MASK;
    }
    if ((modifiers & InputEvent.ALT_GRAPH_MASK) != 0) {
        modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
    }
    if ((modifiers & InputEvent.CTRL_MASK) != 0) {
        modifiers |= InputEvent.CTRL_DOWN_MASK;
    }
    if ((modifiers & InputEvent.META_MASK) != 0) {
        modifiers |= InputEvent.META_DOWN_MASK;
    }

    modifiers &= InputEvent.SHIFT_DOWN_MASK
        | InputEvent.ALT_DOWN_MASK
        | InputEvent.ALT_GRAPH_DOWN_MASK
        | InputEvent.CTRL_DOWN_MASK
        | InputEvent.META_DOWN_MASK
        | InputEvent.BUTTON1_DOWN_MASK
        | InputEvent.BUTTON2_DOWN_MASK
        | InputEvent.BUTTON3_DOWN_MASK;

    return modifiers;
}
 
Example 12
Project: incubator-netbeans   File: BookmarkHistoryPopup.java   View Source Code Vote up 5 votes
private static int modifiersBits(int modifiers) {
    return modifiers & (
            InputEvent.SHIFT_DOWN_MASK |
            InputEvent.CTRL_DOWN_MASK |
            InputEvent.ALT_DOWN_MASK |
            InputEvent.META_DOWN_MASK
            );
}
 
Example 13
Project: Logisim   File: InputEventUtil.java   View Source Code Vote up 5 votes
public static String toDisplayString(int mods) {
	ArrayList<String> arr = new ArrayList<String>();
	if ((mods & InputEvent.CTRL_DOWN_MASK) != 0)
		arr.add(Strings.get("ctrlMod"));
	if ((mods & InputEvent.ALT_DOWN_MASK) != 0)
		arr.add(Strings.get("altMod"));
	if ((mods & InputEvent.SHIFT_DOWN_MASK) != 0)
		arr.add(Strings.get("shiftMod"));
	if ((mods & InputEvent.BUTTON1_DOWN_MASK) != 0)
		arr.add(Strings.get("button1Mod"));
	if ((mods & InputEvent.BUTTON2_DOWN_MASK) != 0)
		arr.add(Strings.get("button2Mod"));
	if ((mods & InputEvent.BUTTON3_DOWN_MASK) != 0)
		arr.add(Strings.get("button3Mod"));

	if (arr.isEmpty())
		return "";

	Iterator<String> it = arr.iterator();
	if (it.hasNext()) {
		StringBuilder ret = new StringBuilder();
		ret.append(it.next());
		while (it.hasNext()) {
			ret.append(" ");
			ret.append(it.next());
		}
		return ret.toString();
	} else {
		return "";
	}
}
 
Example 14
Project: marathonv5   File: Marathon.java   View Source Code Vote up 5 votes
public String getCharSequence(String keys) {
    StringBuilder sb = new StringBuilder();
    if (keys.length() == 1) {
        sb.append(keys);
    } else {
        KeyStrokeParser ksp = new KeyStrokeParser(keys);
        KeyStroke ks = ksp.getKeyStroke();
        CharSequence keys2 = keyMapping.get(ks.getKeyCode());
        if (keys2 == null) {
            String keysText = KeyEvent.getKeyText(ks.getKeyCode());
            if (keysText.length() == 1 && Character.isUpperCase(keysText.charAt(0))) {
                keysText = keysText.toLowerCase();
            }
            keys2 = keysText;
        }
        int modifiers = ks.getModifiers();
        if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
            sb.append(Keys.SHIFT);
        }
        if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
            sb.append(Keys.CONTROL);
        }
        if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
            sb.append(Keys.META);
        }
        if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
            sb.append(Keys.ALT);
        }
        sb.append(keys2);
    }
    return sb.toString();
}
 
Example 15
Project: OpenJSharp   File: SunDragSourceContextPeer.java   View Source Code Vote up 5 votes
public static int convertModifiersToDropAction(final int modifiers,
                                               final int supportedActions) {
    int dropAction = DnDConstants.ACTION_NONE;

    /*
     * Fix for 4285634.
     * Calculate the drop action to match Motif DnD behavior.
     * If the user selects an operation (by pressing a modifier key),
     * return the selected operation or ACTION_NONE if the selected
     * operation is not supported by the drag source.
     * If the user doesn't select an operation search the set of operations
     * supported by the drag source for ACTION_MOVE, then for
     * ACTION_COPY, then for ACTION_LINK and return the first operation
     * found.
     */
    switch (modifiers & (InputEvent.SHIFT_DOWN_MASK |
                         InputEvent.CTRL_DOWN_MASK)) {
    case InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK:
        dropAction = DnDConstants.ACTION_LINK; break;
    case InputEvent.CTRL_DOWN_MASK:
        dropAction = DnDConstants.ACTION_COPY; break;
    case InputEvent.SHIFT_DOWN_MASK:
        dropAction = DnDConstants.ACTION_MOVE; break;
    default:
        if ((supportedActions & DnDConstants.ACTION_MOVE) != 0) {
            dropAction = DnDConstants.ACTION_MOVE;
        } else if ((supportedActions & DnDConstants.ACTION_COPY) != 0) {
            dropAction = DnDConstants.ACTION_COPY;
        } else if ((supportedActions & DnDConstants.ACTION_LINK) != 0) {
            dropAction = DnDConstants.ACTION_LINK;
        }
    }

    return dropAction & supportedActions;
}
 
Example 16
Project: incubator-netbeans   File: FindTypesSupport.java   View Source Code Vote up 4 votes
@Override
    public void mouseMoved(MouseEvent e) {
        JTextPane pane = (JTextPane)e.getSource();
        StyledDocument doc = pane.getStyledDocument();

        int offset = pane.viewToModel(e.getPoint());
        Element elem = doc.getCharacterElement(offset);

        Highlight h = getHighlight(pane, offset);
        Highlight prevHighlight = (Highlight) pane.getClientProperty(PREV_HIGHLIGHT_PROPERTY);
        AttributeSet prevAs = (AttributeSet) pane.getClientProperty(PREV_HIGHLIGHT_ATTRIBUTES);
//        if(h != null && h.equals(prevHighlight)) {
//            return; // nothing to do
//        } else 
        if(prevHighlight != null && prevAs != null) {
            doc.setCharacterAttributes(prevHighlight.startOffset, prevHighlight.endOffset - prevHighlight.startOffset, prevAs, true);
            pane.putClientProperty(PREV_HIGHLIGHT_PROPERTY, null);
            pane.putClientProperty(PREV_HIGHLIGHT_ATTRIBUTES, null);
        }

        int modifiers = e.getModifiers() | e.getModifiersEx();
        if ( (modifiers & InputEvent.CTRL_DOWN_MASK) == InputEvent.CTRL_DOWN_MASK ||
             (modifiers & InputEvent.META_DOWN_MASK) == InputEvent.META_DOWN_MASK) 
        {            
            AttributeSet as = elem.getAttributes();
            if (StyleConstants.isUnderline(as)) {
                // do not underline whats already underlined
                return;
            }

            Font font = doc.getFont(as);
            FontMetrics fontMetrics = pane.getFontMetrics(font);
            try {
                Rectangle rectangle = new Rectangle(
                        pane.modelToView(elem.getStartOffset()).x,
                        pane.modelToView(elem.getStartOffset()).y,
                        fontMetrics.stringWidth(doc.getText(elem.getStartOffset(), elem.getEndOffset() - elem.getStartOffset())),
                        fontMetrics.getHeight());

                if (h != null && offset < elem.getEndOffset() - 1 && rectangle.contains(e.getPoint())) {
                    Style hlStyle = doc.getStyle("regularBlue-findtype");               // NOI18N

                    pane.putClientProperty(PREV_HIGHLIGHT_ATTRIBUTES, as.copyAttributes());
                    doc.setCharacterAttributes(h.startOffset, h.endOffset - h.startOffset, hlStyle, true);
    //                doc.setCharacterAttributes(h.startOffset, h.endOffset - h.startOffset, as.copyAttributes(), true);
                    pane.putClientProperty(PREV_HIGHLIGHT_PROPERTY, h);
                } 
            } catch (BadLocationException ex) {
                Exceptions.printStackTrace(ex);
            }
        }
    }
 
Example 17
Project: incubator-netbeans   File: BaseCaret.java   View Source Code Vote up 4 votes
private boolean isMiddleMouseButtonExt(MouseEvent evt) {
    return (evt.getButton() == MouseEvent.BUTTON2) &&
            (evt.getModifiersEx() & (InputEvent.CTRL_DOWN_MASK | InputEvent.META_DOWN_MASK | /* cannot be tested bcs of bug in JDK InputEvent.ALT_DOWN_MASK | */ InputEvent.ALT_GRAPH_DOWN_MASK)) == 0;
}
 
Example 18
Project: incubator-netbeans   File: EditorCaret.java   View Source Code Vote up 4 votes
private boolean isMiddleMouseButtonExt(MouseEvent evt) {
    return (evt.getButton() == MouseEvent.BUTTON2) &&
            (evt.getModifiersEx() & (InputEvent.CTRL_DOWN_MASK | InputEvent.META_DOWN_MASK | /* cannot be tested bcs of bug in JDK InputEvent.ALT_DOWN_MASK | */ InputEvent.ALT_GRAPH_DOWN_MASK)) == 0;
}
 
Example 19
Project: rapidminer   File: ItemPanelKeyboardListener.java   View Source Code Vote up 4 votes
@Override
public void keyPressed(KeyEvent e) {
	if (this.pane == null) {
		if (e.getSource() instanceof ItemPanel) {
			this.pane = ((ItemPanel) e.getSource());
		} else if (e.getSource() instanceof Item) {
			this.pane = ((ItemPanel) ((JComponent) e.getSource()).getParent());
		}
	}

	if (e.getKeyCode() == KeyEvent.VK_DELETE) {
	} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
		if ((this.pane != null) && (this.pane.getFilePane().lastSelected != null)) {
			this.pane.getFilePane().filechooserUI.setCurrentDirectoryOfFileChooser(this.pane.getFilePane().lastSelected
					.getFile());
		}
	} else if (e.getKeyCode() == KeyEvent.VK_SPACE) {
		this.pane.useKeyMoves("SPACE", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
		this.pane.useKeyMoves("RIGHT", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_LEFT) {
		this.pane.useKeyMoves("LEFT", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_UP) {
		this.pane.useKeyMoves("UP", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
		this.pane.useKeyMoves("DOWN", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_HOME) {
		this.pane.useKeyMoves("HOME", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_END) {
		this.pane.useKeyMoves("END", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
		// ignore enter here!
	} else if (e.getKeyCode() == KeyEvent.VK_PAGE_UP) {
		this.pane.useKeyMoves("PAGE_UP", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else if (e.getKeyCode() == KeyEvent.VK_PAGE_DOWN) {
		this.pane.useKeyMoves("PAGE_DOWN", e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK);
	} else {
		if (KeyEvent.getKeyText(e.getKeyCode()).toLowerCase().equals("a")
				&& (e.getModifiersEx() == InputEvent.CTRL_DOWN_MASK)) {
			this.pane.getFilePane().selectAll();
		}
		if (e.getModifiersEx() == 0) {
			this.pane.forwardToNearestFor(String.valueOf(e.getKeyChar()).toLowerCase());
		}
	}
}
 
Example 20
Project: powertext   File: RSyntaxTextArea.java   View Source Code Vote up 3 votes
/**
 * Sets the mask for the key used to toggle whether we are scanning for
 * hyperlinks with mouse hovering.  The default value is
 * <code>CTRL_DOWN_MASK</code>.
 *
 * @param mask The mask to use.  This should be some bitwise combination of
 *        {@link InputEvent#CTRL_DOWN_MASK},
 *        {@link InputEvent#ALT_DOWN_MASK},
 *        {@link InputEvent#SHIFT_DOWN_MASK} or
 *        {@link InputEvent#META_DOWN_MASK}.
 *        For invalid values, behavior is undefined.
 * @see InputEvent
 */
public void setLinkScanningMask(int mask) {
	mask &= (InputEvent.CTRL_DOWN_MASK|InputEvent.META_DOWN_MASK|
			InputEvent.ALT_DOWN_MASK|InputEvent.SHIFT_DOWN_MASK);
	if (mask==0) {
		throw new IllegalArgumentException("mask argument should be " +
				"some combination of InputEvent.*_DOWN_MASK fields");
	}
	linkScanningMask = mask;
}