Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
Protos
Nomad 3D
nomad-3d-editor
Commits
f9a31d00
Commit
f9a31d00
authored
May 14, 2019
by
legoc
Browse files
Reset the direction coordinates when changing the type
parent
94af7c06
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/n3d/gui/EditorMenuBar.java
View file @
f9a31d00
...
...
@@ -619,7 +619,9 @@ public class EditorMenuBar extends MenuBar {
typeBox
.
getSelectionModel
().
selectedItemProperty
().
addListener
(
new
ChangeListener
<
Axis
.
Type
>()
{
@Override
public
void
changed
(
ObservableValue
<?
extends
Axis
.
Type
>
observable
,
Axis
.
Type
oldValue
,
Axis
.
Type
newValue
)
{
Nomad3DEditor
.
getInstance
().
getAxisBuilder
().
setType
(
newValue
);
// Set the type.
editedAxis
.
setType
(
newValue
);
// Reset the movement.
editedAxis
.
resetMovement
();
...
...
@@ -641,6 +643,11 @@ public class EditorMenuBar extends MenuBar {
// Set the current value label text.
valueText
.
setText
(
currentValueText
(
editedAxis
.
getType
()));
// Set the direction fields.
xDirField
.
setText
(
String
.
format
(
"%.3f"
,
editedAxis
.
getDirection
().
getX
()));
yDirField
.
setText
(
String
.
format
(
"%.3f"
,
editedAxis
.
getDirection
().
getY
()));
zDirField
.
setText
(
String
.
format
(
"%.3f"
,
editedAxis
.
getDirection
().
getZ
()));
}
});
...
...
@@ -821,12 +828,12 @@ public class EditorMenuBar extends MenuBar {
Button
okButton
=
new
Button
(
"OK"
);
okButton
.
setOnAction
(
okEvent
->
{
// Do not save the operation if the axis is the same.
if
(!
editedAxis
.
equals
(
initialAxis
))
{
// Stop the build.
Nomad3DEditor
.
getInstance
().
getAxisBuilder
().
stop
();
// Do not save the operation if the axis is the same.
if
(!
editedAxis
.
equals
(
initialAxis
))
{
String
referenceAxisName
=
null
;
String
zeroValueReferenceAxis1Name
=
null
;
String
zeroValueReferenceAxis2Name
=
null
;
...
...
@@ -886,7 +893,9 @@ public class EditorMenuBar extends MenuBar {
Button
cancelButton
=
new
Button
(
"Cancel"
);
cancelButton
.
setCancelButton
(
true
);
cancelButton
.
setOnAction
(
cancelEvent
->
{
Nomad3DEditor
.
getInstance
().
getAxisBuilder
().
stop
(
modified
);
// Stop the build.
Nomad3DEditor
.
getInstance
().
getAxisBuilder
().
stop
();
// Hide the axes.
editedAxis
.
setVisible
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment