public Viewer jmolViewer;
- private boolean globalUseScriptWait = false;
-
public JalviewJmolBinding(StructureSelectionManager ssm,
PDBEntry[] pdbentry, SequenceI[][] sequenceIs,
DataSourceType protocol)
{
Console.debug(">>Jmol>> " + script);
String s;
- if (globalUseScriptWait || useScriptWait)
+ if (useScriptWait)
{
s = jmolViewer.scriptWait(script);
}
{
if (atoms != null)
{
- // we set the globalUseScriptWait (and reset to previous value) only if
- // we're going to use it here
boolean useScriptWait = atoms.size() > 1;
- boolean prevUseScriptWait = false;
- if (useScriptWait)
- prevUseScriptWait = setGlobalUseScriptWait(useScriptWait);
if (resetLastRes.length() > 0)
{
jmolScript(resetLastRes.toString(), useScriptWait);
highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
atom.getChain(), atom.getPdbFile(), useScriptWait);
}
- if (useScriptWait)
- setGlobalUseScriptWait(prevUseScriptWait);
}
}
return;
}
- jmolHistory(false);
+ jmolHistory(false, useScriptWait);
StringBuilder selection = new StringBuilder(32);
StringBuilder cmd = new StringBuilder(64);
.append(" and not hetero; spacefill 0;");
jmolScript(cmd.toString(), useScriptWait);
- jmolHistory(true);
+ jmolHistory(true, useScriptWait);
}
private boolean debug = true;
private void jmolHistory(boolean enable)
{
- jmolScript("History " + ((debug || enable) ? "on" : "off"));
+ jmolHistory(enable, false);
+ }
+
+ private void jmolHistory(boolean enable, boolean useScriptWait)
+ {
+ jmolScript("History " + ((debug || enable) ? "on" : "off"),
+ useScriptWait);
}
public void loadInline(String string)
{
return "http://wiki.jmol.org"; // BH 2018
}
-
- private boolean setGlobalUseScriptWait(boolean b)
- {
- boolean prev = globalUseScriptWait;
- globalUseScriptWait = b;
- return prev;
- }
}