Commit 9756107d authored by legoc's avatar legoc
Browse files

Better init of direction vector

parent 7e3efd38
......@@ -263,7 +263,7 @@ public class EditorMenuBar extends MenuBar {
///////////////////////////////////////////////////////////////////////////////////////
// Rotation direction
ObservableList<Axis.RotationDirection> rotationDirections = FXCollections.observableArrayList(Axis.RotationDirection.CW, Axis.RotationDirection.CCW);
ObservableList<Axis.RotationDirection> rotationDirections = FXCollections.observableArrayList(Axis.RotationDirection.CCW, Axis.RotationDirection.CW);
ComboBox<Axis.RotationDirection> rotationDirectionBox = new ComboBox<>(rotationDirections);
rotationDirectionBox.getSelectionModel().select(selectedAxis.getRotationDirection());
rotationDirectionBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<Axis.RotationDirection>() {
......@@ -307,20 +307,17 @@ public class EditorMenuBar extends MenuBar {
ComboBox<String> referenceBox = new ComboBox<>(references);
if (selectedAxis.getReferenceAxis() != null) {
// Get the reference axis.
ReferenceAxis referenceAxis = selectedAxis.getReferenceAxis();
// Select the reference axis.
referenceBox.getSelectionModel().select(referenceAxis.getName());
referenceBox.getSelectionModel().select(selectedAxis.getReferenceAxis().getName());
// Set the fields.
xDirField.setText(String.format("%.3f", referenceAxis.getDirection().getX()));
yDirField.setText(String.format("%.3f", referenceAxis.getDirection().getY()));
zDirField.setText(String.format("%.3f", referenceAxis.getDirection().getZ()));
xDirField.setText(String.format("%.3f", selectedAxis.getDirection().getX()));
yDirField.setText(String.format("%.3f", selectedAxis.getDirection().getY()));
zDirField.setText(String.format("%.3f", selectedAxis.getDirection().getZ()));
xPosField.setText(String.format("%.3f", referenceAxis.getPosition().getX()));
yPosField.setText(String.format("%.3f", referenceAxis.getPosition().getY()));
zPosField.setText(String.format("%.3f", referenceAxis.getPosition().getZ()));
xPosField.setText(String.format("%.3f", selectedAxis.getPosition().getX()));
yPosField.setText(String.format("%.3f", selectedAxis.getPosition().getY()));
zPosField.setText(String.format("%.3f", selectedAxis.getPosition().getZ()));
}
......
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