當前位置: 首頁>>代碼示例>>Java>>正文


Java MouseEvent.isShortcutDown方法代碼示例

本文整理匯總了Java中javafx.scene.input.MouseEvent.isShortcutDown方法的典型用法代碼示例。如果您正苦於以下問題:Java MouseEvent.isShortcutDown方法的具體用法?Java MouseEvent.isShortcutDown怎麽用?Java MouseEvent.isShortcutDown使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.input.MouseEvent的用法示例。


在下文中一共展示了MouseEvent.isShortcutDown方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPressed

import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
private void onPressed(NodeModel nodeModel, MouseEvent event) {
    lastElementSelectedAtShortcutAndPress = false;
    if (event.getButton().equals(MouseButton.PRIMARY)) {
        if (event.isShortcutDown()) {
            if (nodeModel.isSelected()) {
                lastElementSelectedAtShortcutAndPress = true;
            } else {
                nodeModel.setSelected(true);
            }
        } else {
            if (!nodeModel.isSelected()) {
                sceneModel.getSelectedNodes().forEach(n -> n.setSelected(false));
                nodeModel.setSelected(true);
            }
            sceneModel.setLastSelectedNode(nodeModel);
        }
    }
}
 
開發者ID:rmfisher,項目名稱:fx-animation-editor,代碼行數:19,代碼來源:SelectionClickBehavior.java

示例2: onMousePressed

import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
private void onMousePressed(MouseEvent event) {
    // Don't start drag if shortcut is down because the node might be about to be deselected.
    if (event.getButton() == MouseButton.PRIMARY && !event.isShortcutDown()) {
        screenXAtPress = event.getScreenX();
        screenYAtPress = event.getScreenY();
        lastScreenX = screenXAtPress;
        lastScreenY = screenYAtPress;
        panXAtPress = panningComponent.panXProperty().get();
        panYAtPress = panningComponent.panYProperty().get();
        xAtPress = node.getLayoutX();
        yAtPress = node.getLayoutY();
        dragActive = true;
        inertiaOvercome = false;
        if (onDragStarted != null) {
            onDragStarted.run();
        }
        event.consume();
    }
}
 
開發者ID:rmfisher,項目名稱:fx-animation-editor,代碼行數:20,代碼來源:DragBehavior.java

示例3: edgePressed

import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
@FXML
public void edgePressed(final MouseEvent event) {
    if (!event.isShiftDown()) {
        event.consume();

        if (event.isShortcutDown()) {
            SelectHelper.addToSelection(this);
        } else {
            SelectHelper.select(this);
        }
    }
}
 
開發者ID:ulriknyman,項目名稱:H-Uppaal,代碼行數:13,代碼來源:EdgeController.java

示例4: 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

示例5: isMenuShortcutKeyDown

import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
public boolean isMenuShortcutKeyDown(MouseEvent event) {
    return event.isShortcutDown();
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:4,代碼來源:RFXComponent.java

示例6: isMultiSelect

import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
private boolean isMultiSelect(MouseEvent evt) {
    return (evt.isShiftDown() || evt.isShortcutDown()) && getSelectionMode().equals(MULTIPLE);
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:4,代碼來源:DateControl.java

示例7: handleSingleClick

import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
private void handleSingleClick(MouseEvent evt, Node node, LocalDate date) {
    if (!(evt.getButton() == MouseButton.PRIMARY)) {
        return;
    }

    YearMonthView view = getSkinnable();
    switch (view.getClickBehaviour()) {
        case NONE:
            break;
        case SHOW_DETAILS:
            Callback<DateDetailsParameter, Boolean> callback = view.getDateDetailsCallback();
            DateDetailsParameter param = new DateDetailsParameter(evt, view, node, date, evt.getScreenX(), evt.getScreenY());
            callback.call(param);
            break;
        case PERFORM_SELECTION:
            boolean multiSelect = evt.isShiftDown() || evt.isShortcutDown();
            if (!multiSelect || (view.getSelectionMode().equals(SINGLE)
                    && !evt.isControlDown())) {
                view.getSelectedDates().clear();
            }

            if (evt.isShiftDown()) {
                if (lastSelectedDate != null) {
                    LocalDate st = lastSelectedDate;
                    LocalDate et = date;
                    if (date.isBefore(st)) {
                        st = date;
                        et = lastSelectedDate;
                    }

                    do {
                        view.getSelectedDates().add(st);
                        st = st.plusDays(1);
                    } while (!et.isBefore(st));
                } else {
                    view.getSelectedDates().clear();
                    view.getSelectedDates().add(date);
                }
            } else {
                if (view.getSelectedDates().contains(date)) {
                    view.getSelectedDates().remove(date);
                } else {
                    view.getSelectedDates().add(date);
                }
            }

            lastSelectedDate = date;

            if (!date.getMonth().equals(view.getYearMonth().getMonth())) {
                view.setDate(date);
            }

            break;
        default:
            break;
    }
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:58,代碼來源:YearMonthViewSkin.java

示例8: onBackgroundPressed

import javafx.scene.input.MouseEvent; //導入方法依賴的package包/類
private void onBackgroundPressed(MouseEvent event) {
    if (event.getButton() == MouseButton.PRIMARY && !event.isShortcutDown()) {
        sceneModel.getSelectedNodes().forEach(n -> n.setSelected(false));
    }
}
 
開發者ID:rmfisher,項目名稱:fx-animation-editor,代碼行數:6,代碼來源:SelectionClickBehavior.java


注:本文中的javafx.scene.input.MouseEvent.isShortcutDown方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。