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
5958a67e
Commit
5958a67e
authored
Feb 07, 2019
by
legoc
Browse files
Do not show reference axes widgets depending on the type
parent
6ba52f2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/n3d/gui/EditorMenuBar.java
View file @
5958a67e
...
...
@@ -384,6 +384,7 @@ public class EditorMenuBar extends MenuBar {
ComboBox
<
String
>
zeroValueReference1Box
=
new
ComboBox
<>(
references
);
zeroValueReference1Label
.
setVisible
(
selectedAxis
.
getType
()
==
Axis
.
Type
.
ROTATION
||
selectedAxis
.
getType
()
==
Axis
.
Type
.
TRANSLATION
);
zeroValueReference1Box
.
setVisible
(
selectedAxis
.
getType
()
==
Axis
.
Type
.
ROTATION
||
selectedAxis
.
getType
()
==
Axis
.
Type
.
TRANSLATION
);
reversedDirection1Check
.
setVisible
(
selectedAxis
.
getType
()
==
Axis
.
Type
.
ROTATION
);
// Select the reference axis.
if
(
selectedAxis
.
getZeroValueReferenceAxis1
()
!=
null
)
{
...
...
@@ -513,6 +514,7 @@ public class EditorMenuBar extends MenuBar {
// Change the visibility of the zero value reference boxes and labels.
zeroValueReference1Label
.
setVisible
(
newValue
==
Axis
.
Type
.
ROTATION
||
newValue
==
Axis
.
Type
.
TRANSLATION
);
zeroValueReference1Box
.
setVisible
(
newValue
==
Axis
.
Type
.
ROTATION
||
newValue
==
Axis
.
Type
.
TRANSLATION
);
reversedDirection1Check
.
setVisible
(
newValue
==
Axis
.
Type
.
ROTATION
);
zeroValueReference2Label
.
setVisible
(
newValue
==
Axis
.
Type
.
ROTATION
);
zeroValueReference2Box
.
setVisible
(
newValue
==
Axis
.
Type
.
ROTATION
);
...
...
@@ -545,26 +547,42 @@ public class EditorMenuBar extends MenuBar {
controllerBox
.
getSelectionModel
().
selectedItemProperty
().
addListener
(
new
ChangeListener
<
String
>()
{
@Override
public
void
changed
(
ObservableValue
<?
extends
String
>
observable
,
String
oldValue
,
String
newValue
)
{
// Select the controller.
selectedAxis
.
setController
(
NomadLinker
.
getInstance
().
getControllerByName
(
newValue
));
// Set the text of the min and max labels.
minValueLabel
.
setText
(
"Min Value : "
+
selectedAxis
.
getController
().
getMinPosition
());
maxValueLabel
.
setText
(
"Max Value : "
+
selectedAxis
.
getController
().
getMaxPosition
());
// Set the type of axis based on the type of the controller.
Nomad3DController
.
Type
type
=
selectedAxis
.
getController
().
getType
();
if
(!
newValue
.
equals
(
""
))
{
if
(
type
==
Nomad3DController
.
Type
.
ROTATION
)
{
selectedAxis
.
setType
(
Axis
.
Type
.
ROTATION
);
}
else
if
(
type
==
Nomad3DController
.
Type
.
TRANSLATION
)
{
selectedAxis
.
setType
(
Axis
.
Type
.
TRANSLATION
);
// Select the controller.
selectedAxis
.
setController
(
NomadLinker
.
getInstance
().
getControllerByName
(
newValue
));
// Set the text of the min and max labels.
minValueLabel
.
setText
(
"Min Value : "
+
selectedAxis
.
getController
().
getMinPosition
());
maxValueLabel
.
setText
(
"Max Value : "
+
selectedAxis
.
getController
().
getMaxPosition
());
// Set the type of axis based on the type of the controller.
Nomad3DController
.
Type
type
=
selectedAxis
.
getController
().
getType
();
if
(
type
==
Nomad3DController
.
Type
.
ROTATION
)
{
selectedAxis
.
setType
(
Axis
.
Type
.
ROTATION
);
}
else
if
(
type
==
Nomad3DController
.
Type
.
TRANSLATION
)
{
selectedAxis
.
setType
(
Axis
.
Type
.
TRANSLATION
);
}
else
{
selectedAxis
.
setType
(
Axis
.
Type
.
FIXED
);
}
typeBox
.
getSelectionModel
().
select
(
selectedAxis
.
getType
());
}
else
{
selectedAxis
.
setType
(
Axis
.
Type
.
FIXED
);
// Reset the controller.
selectedAxis
.
setController
(
null
);
// Set the text of the min and max labels.
minValueLabel
.
setText
(
""
);
maxValueLabel
.
setText
(
""
);
// Reset the type of axis.
selectedAxis
.
setType
(
Axis
.
Type
.
NONE
);
typeBox
.
getSelectionModel
().
select
(
selectedAxis
.
getType
());
}
typeBox
.
getSelectionModel
().
select
(
selectedAxis
.
getType
());
}
});
...
...
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