本文整理匯總了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);
}
示例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;
}
}
示例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();
}
示例4: isForwardEvent
private boolean isForwardEvent(MouseEvent e) {
int eventID = e.getID();
return eventID == MouseEvent.MOUSE_PRESSED ||
eventID == MouseEvent.MOUSE_RELEASED ||
eventID == MouseEvent.MOUSE_WHEEL;
}