本文整理汇总了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;
}