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


Java MouseEvent.MOUSE_WHEEL屬性代碼示例

本文整理匯總了Java中java.awt.event.MouseEvent.MOUSE_WHEEL屬性的典型用法代碼示例。如果您正苦於以下問題:Java MouseEvent.MOUSE_WHEEL屬性的具體用法?Java MouseEvent.MOUSE_WHEEL怎麽用?Java MouseEvent.MOUSE_WHEEL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.event.MouseEvent的用法示例。


在下文中一共展示了MouseEvent.MOUSE_WHEEL屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: processMouseEvent

@Override
protected void processMouseEvent(MouseEvent e) {
    switch(e.getID()) {
      case MouseEvent.MOUSE_PRESSED:
          selectionDisabled = false;
          break;
      case MouseEvent.MOUSE_RELEASED:
          selectionDisabled = false;
          break;
      case MouseEvent.MOUSE_CLICKED:
          selectionDisabled = false;
          break;
      case MouseEvent.MOUSE_ENTERED:
          selectionDisabled = false;
          break;
      case MouseEvent.MOUSE_EXITED:
          selectionDisabled = false;
          break;
      case MouseEvent.MOUSE_MOVED:
          break;
      case MouseEvent.MOUSE_DRAGGED:
          if (selectionDisabled) {
              //System.err.println("\nDrag DISABLED.");
              return ;
          }
          break;
      case MouseEvent.MOUSE_WHEEL:
          break;
    }
    super.processMouseEvent(e);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:31,代碼來源:Outline.java

示例2: getMouseButton

public static MouseButton getMouseButton(MouseEvent me) {
	switch(me.getButton()) {
		case MouseEvent.BUTTON1:
			return MouseButton.LEFT;
		case MouseEvent.BUTTON2:
			return MouseButton.MIDDLE;
		case MouseEvent.BUTTON3:
			return MouseButton.RIGHT;
		case MouseEvent.MOUSE_WHEEL:
			return MouseButton.WHEEL;
		default:
			return MouseButton.LEFT;
	}
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:14,代碼來源:EventHelper.java

示例3: eventToString

private static String eventToString(MouseEvent e) {
    StringBuilder result = new StringBuilder();

    switch (e.getID()) {
        case MouseEvent.MOUSE_PRESSED:
            result.append("MOUSE_PRESSED");
            break;
        case MouseEvent.MOUSE_RELEASED:
            result.append("MOUSE_RELEASED");
            break;
        case MouseEvent.MOUSE_CLICKED:
            result.append("MOUSE_CLICKED");
            break;
        case MouseEvent.MOUSE_ENTERED:
            result.append("MOUSE_ENTERED");
            break;
        case MouseEvent.MOUSE_EXITED:
            result.append("MOUSE_EXITED");
            break;
        case MouseEvent.MOUSE_MOVED:
            result.append("MOUSE_MOVED");
            break;
        case MouseEvent.MOUSE_DRAGGED:
            result.append("MOUSE_DRAGGED");
            break;
        case MouseEvent.MOUSE_WHEEL:
            result.append("MOUSE_WHEEL");
            break;
        default:
            result.append("unknown type");
    }

    result.append(", modifiers = " + MouseEvent.getMouseModifiersText(e.getModifiers()));
    result.append(", modifiersEx = " + MouseEvent.getMouseModifiersText(e.getModifiersEx()));
    result.append(", button = " + e.getButton());

    return result.toString();
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:38,代碼來源:bug7146377.java

示例4: isForwardEvent

private boolean isForwardEvent(MouseEvent e) {
    int eventID = e.getID();
    return eventID == MouseEvent.MOUSE_PRESSED ||
           eventID == MouseEvent.MOUSE_RELEASED ||
           eventID == MouseEvent.MOUSE_WHEEL;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:ProfilerTableHover.java


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