}
});
desktop.addMouseListener(ma);
+
+ if (Platform.isJS())
+ {
+ // used for jalviewjsTest
+ jalview.bin.Console.info("JALVIEWJS: CREATED DESKTOP");
+ }
}
/**
String title = "View of desktop";
ImageExporter exporter = new ImageExporter(writer, null, TYPE.EPS,
title);
- try {
+ try
+ {
exporter.doExport(of, this, width, height, title);
- } catch (ImageOutputException ioex) {
- jalview.bin.Console.error("Unexpected error whilst writing Jalview desktop snapshot as EPS",ioex);
+ } catch (ImageOutputException ioex)
+ {
+ jalview.bin.Console.error(
+ "Unexpected error whilst writing Jalview desktop snapshot as EPS",
+ ioex);
}
}
*/
public static void closeDesktop()
{
- if (Desktop.instance != null) {
+ if (Desktop.instance != null)
+ {
Desktop.instance.closeAll_actionPerformed(null);
Desktop.instance.setVisible(false);
Desktop.instance.dispose();
Desktop.instance = null;
}
}
+
+ /**
+ * checks if any progress bars are being displayed in any of the windows managed by the desktop
+ * @return
+ */
+ public boolean operationsAreInProgress()
+ {
+ JInternalFrame[] frames = getAllFrames();
+ for (JInternalFrame frame:frames)
+ {
+ if (frame instanceof IProgressIndicator)
+ {
+ if (((IProgressIndicator)frame).operationInProgress())
+ {
+ return true;
+ }
+ }
+ }
+ return operationInProgress();
+ }
}