jmolHistory(false);
if (lastCommand == null || !lastCommand.equals(command))
{
- viewer.evalStringQuiet(command + "\n");
+ jmolScript(command + "\n");
}
jmolHistory(true);
lastCommand = command;
{
if (resetLastRes.length() > 0)
{
- viewer.evalStringQuiet(resetLastRes.toString());
+ jmolScript(resetLastRes.toString());
resetLastRes.setLength(0);
}
for (AtomSpec atom : atoms)
cmd.append("spacefill 200;select none");
- viewer.evalStringQuiet(cmd.toString());
+ jmolScript(cmd.toString());
jmolHistory(true);
}
private void jmolHistory(boolean enable)
{
- viewer.evalStringQuiet("History " + ((debug || enable) ? "on" : "off"));
+ jmolScript("History " + ((debug || enable) ? "on" : "off"));
}
public void loadInline(String string)
if (!atomsPicked.contains(picked))
{
- viewer.evalStringQuiet("select " + picked + ";label %n %r:%c");
+ jmolScript("select " + picked + ";label %n %r:%c");
atomsPicked.addElement(picked);
}
else
// }
if (!isLoadingFromArchive())
{
- viewer.evalStringQuiet(
+ jmolScript(
"model *; select backbone;restrict;cartoon;wireframe off;spacefill off");
}
// register ourselves as a listener and notify the gui that it needs to
viewer.setJmolStatusListener(this); // extends JmolCallbackListener
- console = createJmolConsole(consolePanel, buttonsToShow);
+ console = null;//createJmolConsole(consolePanel, buttonsToShow);
if (consolePanel != null)
{
consolePanel.addComponentListener(this);
public void setBackgroundColour(java.awt.Color col)
{
jmolHistory(false);
- viewer.evalStringQuiet("background [" + col.getRed() + ","
+ jmolScript("background [" + col.getRed() + ","
+ col.getGreen() + "," + col.getBlue() + "];");
jmolHistory(true);
}
+ private String jmolScript(String script)
+ {
+ return viewer.scriptWait(script);
+ }
+
@Override
public int[] resizeInnerPanel(String data)
{