本文整理汇总了Java中javafx.scene.input.KeyCode.R属性的典型用法代码示例。如果您正苦于以下问题:Java KeyCode.R属性的具体用法?Java KeyCode.R怎么用?Java KeyCode.R使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.scene.input.KeyCode
的用法示例。
在下文中一共展示了KeyCode.R属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleKeyActionImpl
@Override
@FXThread
protected boolean handleKeyActionImpl(@NotNull final KeyCode keyCode, final boolean isPressed,
final boolean isControlDown, final boolean isShiftDown,
final boolean isButtonMiddleDown) {
final MA editor3DState = getEditor3DState();
if (editor3DState.isCameraMoving()) {
return false;
}
if (isPressed && isControlDown && keyCode == KeyCode.Z) {
undo();
return true;
} else if (isPressed && isControlDown && keyCode == KeyCode.Y) {
redo();
return true;
} else if (isPressed && keyCode == KeyCode.G && !isControlDown && !isButtonMiddleDown) {
final ToggleButton moveToolButton = getMoveToolButton();
moveToolButton.setSelected(true);
return true;
} else if (isPressed && keyCode == KeyCode.R && !isControlDown && !isButtonMiddleDown) {
final ToggleButton rotationToolButton = getRotationToolButton();
rotationToolButton.setSelected(true);
return true;
} else if (isPressed && keyCode == KeyCode.S && !isControlDown && !isButtonMiddleDown) {
final ToggleButton scaleToolButton = getScaleToolButton();
scaleToolButton.setSelected(true);
return true;
} else if (isPressed && keyCode == KeyCode.DELETE) {
final ModelNodeTree modelNodeTree = getModelNodeTree();
final TreeNode<?> selected = modelNodeTree.getSelected();
if (selected == null || !selected.canRemove()) return false;
final Object element = selected.getElement();
final TreeNode<?> parent = selected.getParent();
final Object parentElement = parent == null ? null : parent.getElement();
if (element instanceof Spatial) {
final Spatial spatial = (Spatial) element;
execute(new RemoveChildOperation(spatial, spatial.getParent()));
} else if (element instanceof Light && parentElement instanceof Node) {
final Light light = (Light) element;
execute(new RemoveLightOperation(light, (Node) parentElement));
} else if (element instanceof Control && parentElement instanceof Spatial) {
final Control control = (Control) element;
execute(new RemoveControlOperation(control, (Spatial) parentElement));
}
return true;
}
return super.handleKeyActionImpl(keyCode, isPressed, isControlDown, isShiftDown, isButtonMiddleDown);
}