Commit 27d95dfc authored by legoc's avatar legoc
Browse files

Added undo button

parent 030946aa
......@@ -167,6 +167,13 @@ public class EditorMenuBar extends MenuBar {
this.file.getItems().addAll(openItem, saveItem);
this.edit = new Menu("Edit");
MenuItem undoItem = new MenuItem("Undo");
undoItem.setOnAction(event -> {
// Undo the last operation.
Operations.getInstance().undoLastOperation(Nomad3DEditor.getInstance().getModel());
});
Menu axisMenu = new Menu("Axis");
MenuItem addAxisItem = new MenuItem("Modify axis");
addAxisItem.setOnAction(event -> {
......@@ -1406,7 +1413,7 @@ public class EditorMenuBar extends MenuBar {
Menu componentsMenu = new Menu("Components");
componentsMenu.getItems().addAll(regroupComponentsItem, subdivideComponentItem, insertComponentItem, removeComponentsItem);
this.edit.getItems().addAll(axisMenu, modifyMaterialItem, componentsMenu);
this.edit.getItems().addAll(undoItem, axisMenu, modifyMaterialItem, componentsMenu);
this.view = new Menu("View");
Menu cameraMenu = new Menu("Camera");
......
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