structureFilepath, tft, paeFilepath, false,
ssFromStructure, false, viewerType);
- if (headless)
+ if (sv==null)
+ {
+ Console.error("Failed to import and open structure view.");
+ continue;
+ }
+ while (sv.isBusy())
{
- sv.setAsync(false);
+ try {
+ Thread.sleep(25);
+ }
+ catch (Exception x)
+ {
+
+ }
}
String structureImageFilename = ArgParser.getValueFromSubValOrArg(
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();
+ }
}
// a long sequence.
// check for at least 55% nucleotide, and nucleotide and ambiguity codes
// (including N) must make up 95%
- return ntCount * 100 > NUCLEOTIDE_COUNT_PERCENT * allCount
+ return ntCount * 100 >= NUCLEOTIDE_COUNT_PERCENT * allCount
&& 100 * (ntCount + nCount
- + ntaCount) > NUCLEOTIDE_COUNT_LONG_SEQUENCE_AMBIGUITY_PERCENT
+ + ntaCount) >= NUCLEOTIDE_COUNT_LONG_SEQUENCE_AMBIGUITY_PERCENT
* allCount;
}
else if (allCount > NUCLEOTIDE_COUNT_VERY_SHORT_SEQUENCE)
// a short sequence.
// check if a short sequence is at least 55% nucleotide and the rest of
// the symbols are all X or all N
- if (ntCount * 100 > NUCLEOTIDE_COUNT_PERCENT * allCount
+ if (ntCount * 100 >= NUCLEOTIDE_COUNT_PERCENT * allCount
&& (nCount == aaCount || xCount == aaCount))
{
return true;
import jalview.datamodel.AlignmentAnnotation;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Hashtable;
}
synchronized (updating)
{
- for (List<AlignCalcWorkerI> workers : updating.values())
+ Collection<List<AlignCalcWorkerI>> workersLists = updating.values();
+ synchronized (workersLists)
{
- working |= workers.size() > 0;
+ for (List<AlignCalcWorkerI> workers : workersLists)
+ {
+ if (workers!=null)
+ {
+ synchronized (workers) {
+ working |= workers.size() > 0;
+ }
+ }
+ }
}
}
return working;
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);