本文整理汇总了Java中java.awt.event.MouseEvent.SHIFT_DOWN_MASK属性的典型用法代码示例。如果您正苦于以下问题:Java MouseEvent.SHIFT_DOWN_MASK属性的具体用法?Java MouseEvent.SHIFT_DOWN_MASK怎么用?Java MouseEvent.SHIFT_DOWN_MASK使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.event.MouseEvent
的用法示例。
在下文中一共展示了MouseEvent.SHIFT_DOWN_MASK属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
private boolean process (Widget widget, Point localLocation, int modifiers) {
boolean ctrl = (modifiers & MouseEvent.CTRL_DOWN_MASK) != 0;
boolean shift = (modifiers & MouseEvent.SHIFT_DOWN_MASK) != 0;
ContiguousSelectEvent.SelectionType type = ctrl
? (shift ? ContiguousSelectEvent.SelectionType.ADDITIVE_CONTIGUOUS : ContiguousSelectEvent.SelectionType.ADDITIVE_NON_CONTIGUOUS)
: (shift ? ContiguousSelectEvent.SelectionType.REPLACE_CONTIGUOUS : ContiguousSelectEvent.SelectionType.REPLACE_NON_CONTIGUOUS);
ContiguousSelectEvent providerEvent = ContiguousSelectEvent.create (previousWidget, previousLocalLocation, widget, localLocation, type);
if (provider.isSelectionAllowed (providerEvent)) {
provider.select(providerEvent);
if (! shift) {
previousWidget = widget;
previousLocalLocation = localLocation;
}
return true;
}
return false;
}
示例2: 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;
}
示例3: 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;
}