if (!binding.launchPymol())
{
JvOptionPane.showMessageDialog(Desktop.desktop,
- MessageManager.getString("label.pymol_failed"),
+ MessageManager.formatMessage("label.open_viewer_failed",
+ getViewerName()),
MessageManager.getString("label.error_loading_file"),
JvOptionPane.ERROR_MESSAGE);
this.dispose();
}
@Override
- public void closeViewer(boolean closePymol)
- {
- if (binding != null && binding.isPymolRunning())
- {
- if (!closePymol)
- {
- // TODO i18n (and pull up)
- String prompt = MessageManager
- .formatMessage("label.confirm_close_pymol", new Object[]
- { binding.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;
- }
- closePymol = confirm == JvOptionPane.YES_OPTION;
- }
- binding.closeViewer(closePymol);
- }
- setAlignmentPanel(null);
- _aps.clear();
- _alignwith.clear();
- _colourwith.clear();
- // TODO: check for memory leaks where instance isn't finalised because
- // binding
- // holds a reference to the window
- binding = null;
- dispose();
- }
-
- @Override
public ViewerType getViewerType()
{
return ViewerType.PYMOL;