/** * Sets whether or not to show the HUD ({@link #guiNode}). If the value changes, this will * enable/disable the HUD in the rendering thread. * * @param display Whether or not to show the HUD. * @see #getDisplayHUD() */ public void setDisplayHUD(final boolean display) { // If the value has changed, we need to update the Application's guiNode // by either attaching or detaching this view's guiNode. if (displayHUD.compareAndSet(!display, display)) { app.enqueue( new Callable<Boolean>() { @Override public Boolean call() throws Exception { if (display) { rootGuiNode.attachChild(guiNode); } else { rootGuiNode.detachChild(guiNode); } return true; } }); } return; }
/** * Sets whether or not to show the {@link #axes}. If the value changes, this will enable/disable * the axes in the rendering thread. * * @param display Whether or not to show the axes. * @see #getDisplayAxes() */ public void setDisplayAxes(final boolean display) { // If the value has changed, we need to update the Application's scene // by either attaching or detaching the axis Spatials. if (displayAxes.compareAndSet(!display, display)) { app.enqueue( new Callable<Boolean>() { @Override public Boolean call() throws Exception { if (display) { // Attach the axes to the root Node. rootNode.attachChild(axes); } else { // Detach the axes from the root Node. rootNode.detachChild(axes); } return true; } }); } return; }