String message = "There is a movie in progress. " +
"Are you sure you want to exit this model? " +
"You will lose the contents of your movie.";
if (org.nlogo.swing.OptionDialog.show
(this, "NetLogo", message, options) == 1) {
throw new UserCancelException();
}
app.workspace().movieEncoder.cancel();
app.workspace().movieEncoder = null;
}