本文整理匯總了Java中java.awt.event.MouseEvent.ALT_DOWN_MASK屬性的典型用法代碼示例。如果您正苦於以下問題:Java MouseEvent.ALT_DOWN_MASK屬性的具體用法?Java MouseEvent.ALT_DOWN_MASK怎麽用?Java MouseEvent.ALT_DOWN_MASK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.event.MouseEvent
的用法示例。
在下文中一共展示了MouseEvent.ALT_DOWN_MASK屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getCommandAtPoint
public String getCommandAtPoint(Point p, int tabState, Rectangle bounds, int mouseButton, int eventType, int modifiers) {
String result = null;
if (mouseButton == MouseEvent.BUTTON2 && eventType == MouseEvent.MOUSE_RELEASED) {
result = TabDisplayer.COMMAND_CLOSE;
}
else {
result = getCommandAtPoint (p, tabState, bounds);
}
if (result != null) {
if (TabDisplayer.COMMAND_SELECT == result) {
boolean clipped = isClipLeft() || isClipRight();
if ((clipped && eventType == MouseEvent.MOUSE_RELEASED && mouseButton == MouseEvent.BUTTON1) ||
(!clipped && eventType == MouseEvent.MOUSE_PRESSED && mouseButton == MouseEvent.BUTTON1)) {
return result;
}
} else if (TabDisplayer.COMMAND_CLOSE == result && eventType == MouseEvent.MOUSE_RELEASED && isShowCloseButton()) {
if ((modifiers & MouseEvent.SHIFT_DOWN_MASK) != 0) {
return TabDisplayer.COMMAND_CLOSE_ALL;
} else if ((modifiers & MouseEvent.ALT_DOWN_MASK) != 0 && mouseButton != MouseEvent.BUTTON2) {
return TabDisplayer.COMMAND_CLOSE_ALL_BUT_THIS;
} else if( ((tabState & TabState.CLOSE_BUTTON_ARMED) == 0 || (tabState & TabState.MOUSE_PRESSED_IN_CLOSE_BUTTON) == 0)
&& mouseButton == MouseEvent.BUTTON1 ) {
//#208732
result = TabDisplayer.COMMAND_SELECT;
}
return result;
}
}
return null;
}
示例2: canDrag
private boolean canDrag(MouseEvent e) {
return (e.getModifiersEx() & (MouseEvent.ALT_DOWN_MASK |
MouseEvent.ALT_GRAPH_DOWN_MASK |
MouseEvent.CTRL_DOWN_MASK |
MouseEvent.META_DOWN_MASK |
MouseEvent.SHIFT_DOWN_MASK)) == 0;
}