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
66c0f507
Commit
66c0f507
authored
Jun 29, 2017
by
Ivan Dages
Browse files
unlink controller
parent
22e0a649
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/n3d/gui/EditorMenuBar.java
View file @
66c0f507
...
@@ -739,7 +739,40 @@ public class EditorMenuBar extends MenuBar {
...
@@ -739,7 +739,40 @@ public class EditorMenuBar extends MenuBar {
linkStage
.
show
();
linkStage
.
show
();
});
});
axisMenu
.
getItems
().
addAll
(
addAxisItem
,
calibrateAxisItem
,
linkAxisItem
,
displayAxisItem
);
MenuItem
unlinkAxisItem
=
new
MenuItem
(
"Unlink axis"
);
unlinkAxisItem
.
setOnAction
(
event
->
{
if
(
Nomad3DEditor
.
getInstance
().
getModel
()
==
null
||
Nomad3DEditor
.
getInstance
().
getRoot
()
==
null
)
{
return
;
}
final
Component
selectedComponent
=
selectComponent
(
calibrateAxisItem
.
getText
());
final
Axis
selectedAxis
=
(
selectedComponent
==
null
)
?
null
:
selectedComponent
.
getAxis
();
if
(
selectedAxis
==
null
)
{
// Error alert already display in selectComponent(String)
return
;
}
if
(
selectedComponent
.
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
()
+
" ?"
);
Optional
<
ButtonType
>
res
=
alert
.
showAndWait
();
if
(
res
.
isPresent
())
{
if
(
res
.
get
()
!=
ButtonType
.
OK
)
{
return
;
}
}
selectedComponent
.
setController
(
null
);
}
else
{
Alert
alert
=
new
Alert
(
AlertType
.
WARNING
);
alert
.
setTitle
(
linkAxisItem
.
getText
());
alert
.
setContentText
(
"No controller linked to "
+
selectedComponent
.
getName
());
alert
.
showAndWait
();
}
});
axisMenu
.
getItems
().
addAll
(
addAxisItem
,
calibrateAxisItem
,
linkAxisItem
,
unlinkAxisItem
,
displayAxisItem
);
MenuItem
modifyMaterialItem
=
new
MenuItem
(
"Modify material"
);
MenuItem
modifyMaterialItem
=
new
MenuItem
(
"Modify material"
);
modifyMaterialItem
.
setOnAction
(
new
EventHandler
<
ActionEvent
>()
{
modifyMaterialItem
.
setOnAction
(
new
EventHandler
<
ActionEvent
>()
{
...
...
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