Commit 2d268b9b authored by legoc's avatar legoc
Browse files

Moved NomadController from Component to Axis

parent 685f0bfd
......@@ -565,7 +565,7 @@ public class EditorMenuBar extends MenuBar {
scenePane.getTabs().add(new Tab("Nomad", nomadPane));
GridPane.setMargin(nomadPane, new Insets(10));
Nomad3DController selectedController = selectedComponent.getController();
Nomad3DController selectedController = selectedAxis.getController();
if (selectedController == null) {
Label noLinkText = new Label("No controller associated with\n" + selectedComponent.getName());
noLinkText.setTextAlignment(TextAlignment.CENTER);
......@@ -680,8 +680,7 @@ public class EditorMenuBar extends MenuBar {
Optional<ButtonType> res = alert.showAndWait();
if (res.isPresent()) {
if (res.get() == ButtonType.OK) {
selectedComponent.setController(selectedController);
selectedController.setComponent(selectedComponent);
selectedAxis.setController(selectedController);
}
}
});
......@@ -716,10 +715,10 @@ public class EditorMenuBar extends MenuBar {
return;
}
if (selectedComponent.getController() != null) {
if (selectedAxis.getController() != null) {
Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle(linkAxisItem.getText());
alert.setContentText("Do you want to unlink the controller " + selectedComponent.getController().getName() + " from " + selectedComponent.getName() + " ?");
alert.setContentText("Do you want to unlink the controller " + selectedAxis.getController().getName() + " from " + selectedComponent.getName() + " ?");
Optional<ButtonType> res = alert.showAndWait();
if (res.isPresent()) {
if (res.get() != ButtonType.OK) {
......@@ -727,7 +726,7 @@ public class EditorMenuBar extends MenuBar {
}
}
selectedComponent.setController(null);
selectedAxis.setController(null);
} else {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle(linkAxisItem.getText());
......
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