/**
   * Disconnects the <code>ViewAppState</code> from the associated {@link Application}.
   *
   * <p><b>Note:</b> If this method is overridden, then the first call from the sub-class should be
   * <code>super.cleanupAppState();</code> in order to properly clean up the default <code>
   * SimpleAppState</code> and <code>ViewAppState</code> features.
   */
  @Override
  public void cleanupAppState() {

    // Detach this view's root node and GUI node from the application's
    // respective nodes.
    app.getRootNode().detachChild(rootNode);
    app.getGuiNode().detachChild(rootGuiNode);

    // Un-initialize all of the initialized components of the ViewAppState.
    clearAxes();

    // Unset the reference to the MasterApplication.
    app = null;

    // Proceed with the default cleanup last.
    super.cleanupAppState();
  }