Commit cc97175a authored by legoc's avatar legoc
Browse files

Set default value to showAxes to false

parent d264491b
......@@ -166,7 +166,7 @@ public class EditorMenuBar extends MenuBar {
* Constructor.
*/
public EditorMenuBar() {
this.showAxes = true;
this.showAxes = false;
this.showSystem = true;
this.showWalls = true;
this.showType = Component.ShowType.ALL;
......@@ -285,7 +285,7 @@ public class EditorMenuBar extends MenuBar {
if (modifiedComponent == null) {
return;
}
// TODO This code has to be reviewed.
final Component selectedComponent = modifiedComponent;
Axis modifiedAxis = null;
......@@ -305,6 +305,8 @@ public class EditorMenuBar extends MenuBar {
// The selected axis is modified.
final Axis selectedAxis = modifiedAxis;
selectedAxis.setVisible(true);
// The initial axis is used to cancel the edition.
final Axis initialAxis = selectedAxis.clone();
......@@ -785,6 +787,8 @@ public class EditorMenuBar extends MenuBar {
updateModified(true);
}
selectedAxis.setVisible(false);
Nomad3DEditor.getInstance().getModel().clearSelection();
// We can imagine to not update the entire scene here but it is easier to do it.
......@@ -800,6 +804,8 @@ public class EditorMenuBar extends MenuBar {
cancelButton.setOnAction(cancelEvent -> {
Nomad3DEditor.getInstance().getAxisBuilder().stop(modified);
initialAxis.setVisible(false);
// Reset the initial axis.
selectedComponent.setAxis(initialAxis);
Nomad3DEditor.getInstance().getModel().clearSelection();
......@@ -1460,13 +1466,15 @@ public class EditorMenuBar extends MenuBar {
ObservableList<String> references = FXCollections.observableArrayList("");
references.addAll(ReferenceAxisList.getInstance().getNames());
// Reference axis builder
// Reference axis builder.
ReferenceAxisBuilder referenceAxisBuilder = new ReferenceAxisBuilder();
// Get the root node.
Group rootNode = (Group)Nomad3DEditor.getInstance().getModel().getRoot().getSceneNode();
// We must set it at the end of the group.
rootNode.getChildren().add(referenceAxisBuilder.getVisualGroup());
// We set it at the end of the group so that it is always in front of the components.
rootNode.getChildren().add(0, referenceAxisBuilder.getVisualGroup());
referenceAxisBuilder.getVisualGroup().toFront();
///////////////////////////////////////////////////////////////////////////////////////
// Position
......@@ -2098,7 +2106,7 @@ public class EditorMenuBar extends MenuBar {
this.lodMenu = new Menu("Level of detail");
updateLodMenu();
CheckMenuItem showAxesItem = new CheckMenuItem("Show axes");
CheckMenuItem showAxesItem = new CheckMenuItem("Show Axes");
showAxesItem.setAccelerator(new KeyCodeCombination(KeyCode.A, KeyCombination.SHIFT_DOWN));
showAxesItem.setSelected(this.showAxes);
showAxesItem.setOnAction(new EventHandler<ActionEvent>() {
......@@ -2108,7 +2116,7 @@ public class EditorMenuBar extends MenuBar {
updateAxes();
}
});
CheckMenuItem showSystemItem = new CheckMenuItem("Show coordinate system");
CheckMenuItem showSystemItem = new CheckMenuItem("Show Coordinate System");
showSystemItem.setSelected(this.showSystem);
showSystemItem.setAccelerator(new KeyCodeCombination(KeyCode.Q, KeyCombination.SHIFT_DOWN));
showSystemItem.setOnAction(new EventHandler<ActionEvent>() {
......
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