本文整理汇总了Java中javafx.scene.input.MouseButton.NONE属性的典型用法代码示例。如果您正苦于以下问题:Java MouseButton.NONE属性的具体用法?Java MouseButton.NONE怎么用?Java MouseButton.NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.scene.input.MouseButton
的用法示例。
在下文中一共展示了MouseButton.NONE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getButtons
public MouseButton getButtons() {
if (button1Pressed) {
return MouseButton.PRIMARY;
}
if (button2Pressed) {
return MouseButton.MIDDLE;
}
if (button3Pressed) {
return MouseButton.SECONDARY;
}
return MouseButton.NONE;
}
示例2: getButtonMask
public MouseButton getButtonMask() {
if (button1Pressed) {
return MouseButton.PRIMARY;
}
if (button2Pressed) {
return MouseButton.MIDDLE;
}
if (button3Pressed) {
return MouseButton.SECONDARY;
}
return MouseButton.NONE;
}
示例3: moveto
@Override public void moveto(Node node, double xoffset, double yoffset) {
MouseButton buttons = deviceState.getButtons();
if (node != deviceState.getNode()) {
if (deviceState.getNode() != null) {
dispatchEvent(createMouseEvent(MouseEvent.MOUSE_PRESSED, null, null, xoffset, yoffset, 0, 0, buttons, 0,
deviceState.shiftPressed, deviceState.ctrlPressed, deviceState.altPressed, deviceState.metaPressed,
buttons == MouseButton.PRIMARY, buttons == MouseButton.MIDDLE, buttons == MouseButton.SECONDARY, false,
false, false, node));
}
dispatchEvent(createMouseEvent(MouseEvent.MOUSE_ENTERED, null, null, xoffset, yoffset, 0, 0, buttons, 0,
deviceState.shiftPressed, deviceState.ctrlPressed, deviceState.altPressed, deviceState.metaPressed,
buttons == MouseButton.PRIMARY, buttons == MouseButton.MIDDLE, buttons == MouseButton.SECONDARY, false, false,
false, node));
}
Node source = node;
EventType<MouseEvent> id = MouseEvent.MOUSE_MOVED;
if (buttons != MouseButton.NONE) {
id = MouseEvent.MOUSE_DRAGGED;
source = deviceState.getDragSource();
}
MouseButton modifierEx = deviceState.getButtonMask();
dispatchEvent(createMouseEvent(id, null, null, xoffset, yoffset, 0, 0, buttons, 0, deviceState.shiftPressed,
deviceState.ctrlPressed, deviceState.altPressed, deviceState.metaPressed, modifierEx == MouseButton.PRIMARY,
modifierEx == MouseButton.MIDDLE, modifierEx == MouseButton.SECONDARY, false, false, false, source));
deviceState.setNode(node);
deviceState.setMousePosition(xoffset, yoffset);
}