本文整理汇总了Java中javafx.scene.input.MouseButton.MIDDLE属性的典型用法代码示例。如果您正苦于以下问题:Java MouseButton.MIDDLE属性的具体用法?Java MouseButton.MIDDLE怎么用?Java MouseButton.MIDDLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.scene.input.MouseButton
的用法示例。
在下文中一共展示了MouseButton.MIDDLE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMouseButton
public MouseButton getMouseButton() {
if (button == 0) {
return MouseButton.PRIMARY;
} else if (button == 1) {
return MouseButton.MIDDLE;
} else {
return MouseButton.SECONDARY;
}
}
示例2: storeMouseDown
private void storeMouseDown(MouseButton button) {
if (button == MouseButton.PRIMARY) {
button1Pressed = true;
}
if (button == MouseButton.MIDDLE) {
button2Pressed = true;
}
if (button == MouseButton.SECONDARY) {
button3Pressed = true;
}
}
示例3: storeMouseUp
private void storeMouseUp(MouseButton button) {
if (button == MouseButton.PRIMARY) {
button1Pressed = false;
}
if (button == MouseButton.MIDDLE) {
button2Pressed = false;
}
if (button == MouseButton.SECONDARY) {
button3Pressed = false;
}
}
示例4: getButtons
public MouseButton getButtons() {
if (button1Pressed) {
return MouseButton.PRIMARY;
}
if (button2Pressed) {
return MouseButton.MIDDLE;
}
if (button3Pressed) {
return MouseButton.SECONDARY;
}
return MouseButton.NONE;
}
示例5: getButtonMask
public MouseButton getButtonMask() {
if (button1Pressed) {
return MouseButton.PRIMARY;
}
if (button2Pressed) {
return MouseButton.MIDDLE;
}
if (button3Pressed) {
return MouseButton.SECONDARY;
}
return MouseButton.NONE;
}
示例6: getModifiersExText
protected static String getModifiersExText(MouseEvent event) {
StringBuffer buf = new StringBuffer();
if (event.isMetaDown()) {
buf.append("Meta");
buf.append("+");
}
if (event.isControlDown()) {
buf.append("Ctrl");
buf.append("+");
}
if (event.isAltDown()) {
buf.append("Alt");
buf.append("+");
}
if (event.isShiftDown()) {
buf.append("Shift");
buf.append("+");
}
if (event.getButton() == MouseButton.PRIMARY) {
buf.append("Button1");
buf.append("+");
}
if (event.getButton() == MouseButton.MIDDLE) {
buf.append("Button2");
buf.append("+");
}
if (event.getButton() == MouseButton.SECONDARY) {
buf.append("Button3");
buf.append("+");
}
return buf.toString();
}
示例7: notifyClickEvent
/**
* Use this method to process a click event and send a special GUI event by the means of the message system.
* @param event MouseEvent. A click event
*/
void notifyClickEvent(MouseEvent event) {
if (!event.isStillSincePress()) {
return;
}
Map<String, Object> m = new HashMap<>();
m.put("screenX", event.getScreenX());
m.put("screenY", event.getScreenY());
m.put("nodeX", event.getScreenX() - sender.getLayoutX());
m.put("nodeY", event.getScreenY() - sender.getLayoutY());
m.put("nodeWidth", sender.getLayoutBounds().getWidth());
m.put("nodeHeight", sender.getLayoutBounds().getHeight());
StringBuilder eventMessage = new StringBuilder("gui-events:").append(senderName).append("-");
if (event.getButton() == MouseButton.PRIMARY) {
if (event.getClickCount() == 2) {
eventMessage.append("double");
} else {
eventMessage.append("left");
}
} else if (event.getButton() == MouseButton.SECONDARY) {
eventMessage.append("right");
} else if (event.getButton() == MouseButton.MIDDLE) {
eventMessage.append("middle");
} else {
return;
}
eventMessage.append("-click");
Main.getInstance().getPluginProxy().sendMessage(eventMessage.toString(), m);
}