boolean embedded = false;
private boolean checkForJmol = true;
+ private boolean checkedForJmol = false; // ensure we don't check for jmol every time the app is re-inited
public boolean jmolAvailable = false;
}
}
- LoadJmolThread jmolAvailable = new LoadJmolThread();
- jmolAvailable.start();
-
final JalviewLite applet = this;
if (getParameter("embedded") != null
&& getParameter("embedded").equalsIgnoreCase("true"))
class LoadJmolThread extends Thread
{
+ private boolean running=false;
+
public void run()
{
+ if (running || checkedForJmol) {
+ return;
+ }
+ running=true;
if (checkForJmol)
{
try
.println("Skipping Jmol check. Will use MCView (probably)");
}
}
+ checkedForJmol=true;
+ running=false;
+ }
+
+ public boolean notFinished()
+ {
+ return running || !checkedForJmol;
}
}
String format;
JalviewLite applet;
-
private void dbgMsg(String msg)
{
if (applet.debug)
public void run()
{
+ LoadJmolThread jmolchecker = new LoadJmolThread();
+ jmolchecker.start();
+ while (jmolchecker.notFinished())
+ {
+ // wait around until the Jmol check is complete.
+ try { Thread.sleep(2); } catch (Exception e) {};
+ }
startLoading();
}