- * Close down this instance of Jalview's Chimera viewer, giving the user the
- * option to close the associated Chimera window (process). They may wish to
- * keep it open until they have had an opportunity to save any work.
- *
- * @param closeChimera
- * if true, close any linked Chimera process; if false, prompt first
- */
- @Override
- public void closeViewer(boolean closeChimera)
- {
- if (jmb != null && jmb.isChimeraRunning())
- {
- if (!closeChimera)
- {
- String prompt = MessageManager
- .formatMessage("label.confirm_close_chimera", new Object[]
- { jmb.getViewerTitle(getViewerName(), false) });
- prompt = JvSwingUtils.wrapTooltip(true, prompt);
- int confirm = JvOptionPane.showConfirmDialog(this, prompt,
- MessageManager.getString("label.close_viewer"),
- JvOptionPane.YES_NO_CANCEL_OPTION);
- /*
- * abort closure if user hits escape or Cancel
- */
- if (confirm == JvOptionPane.CANCEL_OPTION
- || confirm == JvOptionPane.CLOSED_OPTION)
- {
- return;
- }
- closeChimera = confirm == JvOptionPane.YES_OPTION;
- }
- jmb.closeViewer(closeChimera);
- }
- setAlignmentPanel(null);
- _aps.clear();
- _alignwith.clear();
- _colourwith.clear();
- // TODO: check for memory leaks where instance isn't finalised because jmb
- // holds a reference to the window
- jmb = null;
- dispose();
- }
-
- /**