Commit 7fb4b2a7 authored by yannick legoc's avatar yannick legoc
Browse files

Added default buttons

parent 58f48b8b
......@@ -963,7 +963,6 @@ public class EditorMenuBar extends MenuBar {
///////////////////////////////////////////////////////////////////////////////////////
// Material menu
MenuItem editMaterialItem = new MenuItem("Edit Material");
editMaterialItem.setAccelerator(new KeyCodeCombination(KeyCode.M, KeyCombination.CONTROL_DOWN));
editMaterialItem.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
......@@ -1058,6 +1057,7 @@ public class EditorMenuBar extends MenuBar {
///////////////////////////////////////////////////////////////////////////////////////
// Add component menu
MenuItem addComponentItem = new MenuItem("Add Component");
addComponentItem.setAccelerator(new KeyCodeCombination(KeyCode.N, KeyCombination.CONTROL_DOWN));
addComponentItem.setOnAction(event -> {
if (!modelLoaded()) {
return;
......@@ -1115,6 +1115,7 @@ public class EditorMenuBar extends MenuBar {
addPane.addRow(1, parentLabel, parentBox);
Button okButton = new Button("OK");
okButton.setDefaultButton(true);
okButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
......@@ -1189,7 +1190,8 @@ public class EditorMenuBar extends MenuBar {
///////////////////////////////////////////////////////////////////////////////////////
// Remove components menu
MenuItem removeComponentsItem = new MenuItem("Remove Components");
MenuItem removeComponentsItem = new MenuItem("Delete Components");
removeComponentsItem.setAccelerator(new KeyCodeCombination(KeyCode.D, KeyCombination.CONTROL_DOWN));
removeComponentsItem.setOnAction(event -> {
if (Nomad3DEditor.getInstance().getModel() == null || Nomad3DEditor.getInstance().getModel().getRoot() == null) {
......@@ -1239,6 +1241,7 @@ public class EditorMenuBar extends MenuBar {
///////////////////////////////////////////////////////////////////////////////////////
// Rename component menu
MenuItem renameComponentItem = new MenuItem("Rename Component");
renameComponentItem.setAccelerator(new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN));
renameComponentItem.setOnAction(event -> {
// Check the selection.
......@@ -1307,6 +1310,7 @@ public class EditorMenuBar extends MenuBar {
namePane.addRow(0, newNameLabel, newNameField);
Button okButton = new Button("OK");
okButton.setDefaultButton(true);
okButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
......@@ -1379,6 +1383,7 @@ public class EditorMenuBar extends MenuBar {
///////////////////////////////////////////////////////////////////////////////////////
// Move components menu
MenuItem moveComponentsItem = new MenuItem("Move Components");
moveComponentsItem.setAccelerator(new KeyCodeCombination(KeyCode.M, KeyCombination.CONTROL_DOWN));
moveComponentsItem.setOnAction(event -> {
if (!modelLoaded()) {
return;
......@@ -1428,6 +1433,7 @@ public class EditorMenuBar extends MenuBar {
movePane.addRow(1, parentLabel, parentBox);
Button okButton = new Button("OK");
okButton.setDefaultButton(true);
okButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
......@@ -1853,7 +1859,7 @@ public class EditorMenuBar extends MenuBar {
///////////////////////////////////////////////////////////////////////////////////////
// Reference axis menu
MenuItem displayReferenceAxesItem = new MenuItem("Show Reference Axes");
displayReferenceAxesItem.setAccelerator(new KeyCodeCombination(KeyCode.R, KeyCombination.CONTROL_DOWN));
displayReferenceAxesItem.setAccelerator(new KeyCodeCombination(KeyCode.R, KeyCombination.SHIFT_DOWN, KeyCombination.CONTROL_DOWN));
displayReferenceAxesItem.setOnAction(event -> {
if (Nomad3DEditor.getInstance().getModel() == null || Nomad3DEditor.getInstance().getRoot() == null) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment