当前位置: 首页>>代码示例>>Java>>正文


Java MouseEvent.SHIFT_DOWN_MASK属性代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ContiguousSelectAction.java

示例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;
  }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:AbstractTabCellRenderer.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:WatchAnnotationProvider.java


注:本文中的java.awt.event.MouseEvent.SHIFT_DOWN_MASK属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。