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


Java MouseEvent.isStillSincePress方法代码示例

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


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

示例1: notifyClickEvent

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
/**
 * 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,代码行数:36,代码来源:MouseEventNotificator.java

示例2: onClicked

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
private void onClicked(NodeModel nodeModel, MouseEvent event) {
    if (event.getButton().equals(MouseButton.PRIMARY)) {
        if (event.isShortcutDown() && event.isStillSincePress() && lastElementSelectedAtShortcutAndPress) {
            nodeModel.setSelected(false);
        }
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:8,代码来源:SelectionClickBehavior.java

示例3: onBackgroundReleased

import javafx.scene.input.MouseEvent; //导入方法依赖的package包/类
private void onBackgroundReleased(MouseEvent event) {
    if (event.getButton() == MouseButton.PRIMARY) {
        root.setVisible(false);
        dragActive = false;
        if (!event.isStillSincePress()) {
            selectInBounds(root.getBoundsInParent());
        }
        root.setWidth(0);
        root.setHeight(0);
    }
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:12,代码来源:SelectionBoxComponent.java


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