@EventHandler protected void onEvent(final DisplayDeletedEvent event) { /* OLD COMMENT : no longer relevant except for testing purposes // Need to make sure: // - modern IJ Windows always close when legacy IJ close expected // Stack to Images, Split Channels, etc. // - No ImagePlus/Display mapping becomes a zombie in the // LegacyImageMap failing to get garbage collected. // - That modern IJ does not think legacy IJ initiated the ij1.close() */ if (event.getObject() instanceof ImageDisplay) { unregisterDisplay((ImageDisplay) event.getObject()); } }
/** Stops animation if display has been deleted. */ @EventHandler protected void onEvent(final DisplayDeletedEvent event) { final ImageDisplay imageDisplay = toImageDisplay(event.getObject()); if (imageDisplay == null) return; stop(imageDisplay); animations.remove(imageDisplay); }
@EventHandler protected void onEvent(final DisplayDeletedEvent event) { if (event.getObject() == display) userHasQuit = true; }