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();
+ }
}
String[] args = cmdLine.split("\\s+");
CommandsTest.callJalviewMain(args);
- try
+ while (Desktop.instance!=null && Desktop.instance.operationsAreInProgress())
{
- // sleep for slow build server to open annotations and viewer windows
- Thread.sleep(seqNum * 50 + annNum * 50 + viewerNum * 500);
- } catch (InterruptedException e)
- {
- e.printStackTrace();
+ try
+ {
+ // sleep for slow build server to open annotations and viewer windows
+ Thread.sleep(viewerNum * 50);
+ } catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
}
+ ;
AlignFrame[] afs = Desktop.getAlignFrames();
Assert.assertNotNull(afs);