当前位置: 首页>>代码示例>>Java>>正文


Java MouseButton.SECONDARY属性代码示例

本文整理汇总了Java中javafx.scene.input.MouseButton.SECONDARY属性的典型用法代码示例。如果您正苦于以下问题:Java MouseButton.SECONDARY属性的具体用法?Java MouseButton.SECONDARY怎么用?Java MouseButton.SECONDARY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javafx.scene.input.MouseButton的用法示例。


在下文中一共展示了MouseButton.SECONDARY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handle

@Override
public void handle(MouseEvent event) {
    if(event.getEventType()==MouseEvent.MOUSE_MOVED){
        move.handle(event.getX(),event.getY());
    }else if(event.getEventType()==MouseEvent.MOUSE_PRESSED){
        if(event.getButton()==MouseButton.PRIMARY){
            press.handle(event.getX(),event.getY());
        }else if(event.getButton()==MouseButton.SECONDARY){
            rightPress.handle(event.getX(),event.getY());
        }
    }else if(event.getEventType()==MouseEvent.MOUSE_RELEASED){
        if(event.getButton()==MouseButton.PRIMARY){
            release.handle(event.getX(),event.getY());
        }else if(event.getButton()==MouseButton.SECONDARY){
            rightRelease.handle(event.getX(),event.getY());
        }
    }
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:18,代码来源:MouseEventHandler.java

示例2: getMouseButton

public MouseButton getMouseButton() {
    if (button == 0) {
        return MouseButton.PRIMARY;
    } else if (button == 1) {
        return MouseButton.MIDDLE;
    } else {
        return MouseButton.SECONDARY;
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:IDevice.java

示例3: storeMouseDown

private void storeMouseDown(MouseButton button) {
    if (button == MouseButton.PRIMARY) {
        button1Pressed = true;
    }
    if (button == MouseButton.MIDDLE) {
        button2Pressed = true;
    }
    if (button == MouseButton.SECONDARY) {
        button3Pressed = true;
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:FXEventQueueDevice.java

示例4: storeMouseUp

private void storeMouseUp(MouseButton button) {
    if (button == MouseButton.PRIMARY) {
        button1Pressed = false;
    }
    if (button == MouseButton.MIDDLE) {
        button2Pressed = false;
    }
    if (button == MouseButton.SECONDARY) {
        button3Pressed = false;
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:FXEventQueueDevice.java

示例5: getButtons

public MouseButton getButtons() {
    if (button1Pressed) {
        return MouseButton.PRIMARY;
    }
    if (button2Pressed) {
        return MouseButton.MIDDLE;
    }
    if (button3Pressed) {
        return MouseButton.SECONDARY;
    }
    return MouseButton.NONE;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:FXEventQueueDevice.java

示例6: getButtonMask

public MouseButton getButtonMask() {
    if (button1Pressed) {
        return MouseButton.PRIMARY;
    }
    if (button2Pressed) {
        return MouseButton.MIDDLE;
    }
    if (button3Pressed) {
        return MouseButton.SECONDARY;
    }
    return MouseButton.NONE;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:FXEventQueueDevice.java

示例7: 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();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:32,代码来源:EventQueueDeviceTest.java

示例8: requestMoney

@FXML
protected void requestMoney(MouseEvent event) {
    if (event.getButton() == MouseButton.SECONDARY || (event.getButton() == MouseButton.PRIMARY && event.isMetaDown())) {
        // User right clicked or the Mac equivalent. Show the context menu.
        addressMenu.show(addressLabel, event.getScreenX(), event.getScreenY());
    } else {
        // User left clicked.
        try {
            Desktop.getDesktop().browse(URI.create(uri()));
        } catch (IOException e) {
            GuiUtils.informationalAlert("Opening wallet app failed", "Perhaps you don't have one installed?");
        }
    }
}
 
开发者ID:creativechain,项目名称:creacoinj,代码行数:14,代码来源:ClickableBitcoinAddress.java

示例9: handleClick

private void handleClick(final TableRow<SampServer> row, final MouseEvent clicked) {
	if (clicked.getButton() == MouseButton.PRIMARY) {
		handleLeftClick(row);
	} else if (clicked.getButton() == MouseButton.SECONDARY) {
		handleRightClick(row, clicked);
	}
}
 
开发者ID:Bios-Marcel,项目名称:ServerBrowser,代码行数:7,代码来源:SampServerTable.java

示例10: 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);
}
 
开发者ID:DeskChan,项目名称:DeskChan,代码行数:35,代码来源:MouseEventNotificator.java

示例11: onMousePressed

private void onMousePressed(MouseEvent event) {
    if (event.getButton() == MouseButton.SECONDARY) {
        contentXAtPress = view.getContent().getLayoutX();
        contentYAtPress = view.getContent().getLayoutY();
        screenXAtPress = event.getScreenX();
        screenYAtPress = event.getScreenY();
        setSceneCursor(Cursor.MOVE);
        panningActive = true;
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:10,代码来源:PanningPresenter.java

示例12: onMouseDragged

private void onMouseDragged(MouseEvent event) {
    if (event.getButton() == MouseButton.SECONDARY && panningActive) {
        double deltaX = event.getScreenX() - screenXAtPress;
        double deltaY = event.getScreenY() - screenYAtPress;
        view.getContent().setLayoutX(contentXAtPress + deltaX);
        view.getContent().setLayoutY(contentYAtPress + deltaY);
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:8,代码来源:PanningPresenter.java

示例13: handle

@Override
public void handle(MouseEvent event) {
	if(event.getButton() == MouseButton.SECONDARY) {
		contextMenuController.getMenu().show(pane.getTreeView(), event.getScreenX(), event.getScreenY());
	}
}
 
开发者ID:tbusanny,项目名称:bubuirc,代码行数:6,代码来源:TreeController.java

示例14: onMouseClicked

private void onMouseClicked(MouseEvent mouseEvent) {
  if (mouseEvent.getButton() == MouseButton.SECONDARY) {
    this.lastMouseEvent = mouseEvent;
    view.getContextMenu().show(view, mouseEvent.getScreenX(), mouseEvent.getScreenY());
  }
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:6,代码来源:TimingDiagramController.java

示例15: onMouseReleased

private void onMouseReleased(MouseEvent event) {
    if (event.getButton() == MouseButton.SECONDARY) {
        panningActive = false;
        setSceneCursor(null);
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:6,代码来源:PanningPresenter.java


注:本文中的javafx.scene.input.MouseButton.SECONDARY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。