當前位置: 首頁>>代碼示例>>Java>>正文


Java MouseEvent.ALT_DOWN_MASK屬性代碼示例

本文整理匯總了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;
  }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:31,代碼來源:AbstractTabCellRenderer.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:WatchAnnotationProvider.java


注:本文中的java.awt.event.MouseEvent.ALT_DOWN_MASK屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。