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-commons
Commits
33f6c036
Commit
33f6c036
authored
Jul 03, 2017
by
Ivan Dages
Browse files
component : toggle configuration visibility
parent
9005d4a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/ill/ics/n3d/model/Component.java
View file @
33f6c036
...
...
@@ -442,6 +442,32 @@ public class Component {
this
.
axis
.
moveTo
(
oldAxisValue
);
}
public
void
setConfigurationVisibility
(
boolean
visible
,
String
configName
,
String
configSourceName
,
boolean
recursive
)
{
ConfigParams
config
=
this
.
getConfigurationByName
(
configName
);
config
.
setVisible
(
visible
);
if
(
visible
&&
!
this
.
isRoot
()
&&
!
this
.
parent
.
getConfigurationByName
(
configName
).
isVisible
())
{
parent
.
setConfigurationVisibility
(
visible
,
configName
,
configSourceName
,
false
);
}
try
{
ConfigParams
configSource
=
this
.
getConfigurationByName
(
configSourceName
);
config
.
setRotation
(
configSource
.
getRotation
());
config
.
setTranslation
(
configSource
.
getTranslation
());
config
.
setScale
(
configSource
.
getScale
());
}
catch
(
NullPointerException
e
)
{
// Nothing to do : no source config
}
catch
(
Exception
e
)
{
Logger
.
getLogger
(
"nomad-3d"
).
severe
(
e
.
getMessage
());
e
.
printStackTrace
();
}
if
(
recursive
)
{
for
(
Component
child
:
this
.
children
)
{
child
.
setConfigurationVisibility
(
visible
,
configName
,
configSourceName
,
recursive
);
}
}
}
/**
* Gets a specific child by its name.
* @param name Name of the child
...
...
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