2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.ext.jmol;
23 import java.applet.Applet;
25 import java.awt.event.*;
27 import jalview.api.FeatureRenderer;
28 import jalview.api.SequenceRenderer;
29 import jalview.api.SequenceStructureBinding;
30 import jalview.datamodel.*;
31 import jalview.structure.*;
34 import org.jmol.api.*;
35 import org.jmol.adapter.smarter.SmarterJmolAdapter;
37 import org.jmol.popup.*;
38 import org.jmol.viewer.JmolConstants;
40 import jalview.schemes.*;
42 public abstract class JalviewJmolBinding implements StructureListener,
43 JmolStatusListener, SequenceStructureBinding, JmolSelectionListener
47 * set if Jmol state is being restored from some source - instructs binding
48 * not to apply default display style when structure set is updated for first
51 private boolean loadingFromArchive = false;
54 * state flag used to check if the Jmol viewer's paint method can be called
56 private boolean finishedInit = false;
58 public boolean isFinishedInit()
63 public void setFinishedInit(boolean finishedInit)
65 this.finishedInit = finishedInit;
68 boolean allChainsSelected = false;
71 * when true, try to search the associated datamodel for sequences that are
72 * associated with any unknown structures in the Jmol view.
74 private boolean associateNewStructs = false;
76 Vector atomsPicked = new Vector();
78 public Vector chainNames;
82 boolean colourBySequence = true;
84 StringBuffer eval = new StringBuffer();
86 public String fileLoadingError;
89 * the default or current model displayed if the model cannot be identified
90 * from the selection message
94 protected JmolPopup jmolpopup;
100 boolean loadedInline;
103 * current set of model filenames loaded in the Jmol instance
105 String[] modelFileNames = null;
107 public PDBEntry[] pdbentry;
110 * datasource protocol for access to PDBEntry
112 String protocol = null;
114 StringBuffer resetLastRes = new StringBuffer();
116 public SequenceI[] sequence;
118 StructureSelectionManager ssm;
120 public JmolViewer viewer;
122 public JalviewJmolBinding(PDBEntry[] pdbentry, SequenceI[] seq,
123 String[] chains, String protocol)
126 this.chains = chains;
127 this.pdbentry = pdbentry;
128 this.protocol = protocol;
131 * viewer = JmolViewer.allocateViewer(renderPanel, new SmarterJmolAdapter(),
132 * "jalviewJmol", ap.av.applet .getDocumentBase(),
133 * ap.av.applet.getCodeBase(), "", this);
135 * jmolpopup = JmolPopup.newJmolPopup(viewer, true, "Jmol", true);
139 public JalviewJmolBinding(JmolViewer viewer2)
142 viewer.setJmolStatusListener(this);
143 viewer.addSelectionListener(this);
147 * construct a title string for the viewer window based on the data jalview
152 public String getViewerTitle()
154 if (sequence == null || pdbentry == null || sequence.length < 1
155 || pdbentry.length < 1)
157 return ("Jalview Jmol Window");
159 StringBuffer title = new StringBuffer(sequence[0].getName() + ":"
160 + pdbentry[0].getId());
162 if (pdbentry[0].getProperty() != null)
164 if (pdbentry[0].getProperty().get("method") != null)
166 title.append(" Method: ");
167 title.append(pdbentry[0].getProperty().get("method"));
169 if (pdbentry[0].getProperty().get("chains") != null)
171 title.append(" Chain:");
172 title.append(pdbentry[0].getProperty().get("chains"));
175 return title.toString();
179 * prepare the view for a given set of models/chains. chainList contains
180 * strings of the form 'pdbfilename:Chaincode'
183 * list of chains to make visible
185 public void centerViewer(Vector chainList)
187 StringBuffer cmd = new StringBuffer();
190 for (int i = 0, iSize = chainList.size(); i < iSize; i++)
193 lbl = (String) chainList.elementAt(i);
197 mlength = lbl.indexOf(":", p);
198 } while (p < mlength && mlength < (lbl.length() - 2));
199 cmd.append(":" + lbl.substring(mlength + 1) + " /"
200 + getModelNum(lbl.substring(0, mlength)) + " or ");
202 if (cmd.length() > 0)
203 cmd.setLength(cmd.length() - 4);
204 evalStateCommand("select *;restrict " + cmd + ";cartoon;center " + cmd);
207 public void closeViewer()
209 viewer.setModeMouse(org.jmol.viewer.JmolConstants.MOUSE_NONE);
210 // remove listeners for all structures in viewer
211 StructureSelectionManager.getStructureSelectionManager()
212 .removeStructureViewerListener(this, this.getPdbFile());
213 // and shut down jmol
214 viewer.evalStringQuiet("zap");
215 viewer.setJmolStatusListener(null);
220 public void colourByChain()
222 colourBySequence = false;
223 evalStateCommand("select *;color chain");
226 public void colourByCharge()
228 colourBySequence = false;
229 evalStateCommand("select *;color white;select ASP,GLU;color red;"
230 + "select LYS,ARG;color blue;select CYS;color yellow");
234 * superpose the structures associated with sequences in the alignment
235 * according to their corresponding positions.
237 public void superposeStructures(AlignmentI alignment)
239 String[] files = getPdbFile();
241 StringBuffer command = new StringBuffer();
242 boolean matched[] = new boolean[alignment.getWidth()];
243 String commonpositions[][] = new String[files.length][alignment
245 for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
247 StructureMapping[] mapping = ssm.getMapping(files[pdbfnum]);
249 if (mapping == null || mapping.length < 1)
253 for (int s = 0; s < sequence.length; s++)
255 for (int sp, m = 0; m < mapping.length; m++)
257 if (mapping[m].getSequence() == sequence[s]
258 && (sp = alignment.findIndex(sequence[s])) > -1)
260 SequenceI asp = alignment.getSequenceAt(sp);
261 for (int r = 0; r < asp.getLength(); r++)
263 // no mapping to gaps in sequence
264 if (jalview.util.Comparison.isGap(asp.getCharAt(r)))
266 matched[r] = false; // exclude from common set
269 int pos = mapping[m].getPDBResNum(asp.findPosition(r));
271 if (pos < 1 || pos == lastPos)
276 commonpositions[m][r] = (mapping[m].getChain() != " " ? ":"
277 + mapping[m].getChain() : "")
278 + "/" + (pdbfnum + 1) + ".1";
285 command.append("select ");
286 // form the matched pair selection strings
288 for (int r = 0; r < matched.length; r++)
294 for (int s = 0; s < commonpositions.length; s++)
298 command.append(" | ");
300 command.append(commonpositions[s][r]);
306 evalStateCommand(command.toString());
309 public void evalStateCommand(String command)
312 if (lastCommand == null || !lastCommand.equals(command))
314 viewer.evalStringQuiet(command + "\n");
317 lastCommand = command;
321 * colour any structures associated with sequences in the given alignment
322 * using the getFeatureRenderer() and getSequenceRenderer() renderers but only
323 * if colourBySequence is enabled.
325 public void colourBySequence(boolean showFeatures, AlignmentI alignment)
327 if (!colourBySequence)
333 String[] files = getPdbFile();
334 SequenceRenderer sr = getSequenceRenderer();
336 FeatureRenderer fr = null;
339 fr = getFeatureRenderer();
342 StringBuffer command = new StringBuffer();
344 for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
346 StructureMapping[] mapping = ssm.getMapping(files[pdbfnum]);
348 if (mapping == null || mapping.length < 1)
352 for (int s = 0; s < sequence.length; s++)
354 for (int sp, m = 0; m < mapping.length; m++)
356 if (mapping[m].getSequence() == sequence[s]
357 && (sp = alignment.findIndex(sequence[s])) > -1)
359 SequenceI asp = alignment.getSequenceAt(sp);
360 for (int r = 0; r < asp.getLength(); r++)
362 // no mapping to gaps in sequence
363 if (jalview.util.Comparison.isGap(asp.getCharAt(r)))
367 int pos = mapping[m].getPDBResNum(asp.findPosition(r));
369 if (pos < 1 || pos == lastPos)
374 Color col = sr.getResidueBoxColour(sequence[s], r);
377 col = fr.findFeatureColour(col, sequence[s], r);
378 String newSelcom = (mapping[m].getChain() != " " ? ":"
379 + mapping[m].getChain() : "")
388 + col.getBlue() + "]";
389 if (command.toString().endsWith(newSelcom))
391 command = condenseCommand(command.toString(), pos);
394 // TODO: deal with case when buffer is too large for Jmol to parse
395 // - execute command and flush
397 command.append(";select " + pos);
398 command.append(newSelcom);
405 evalStateCommand(command.toString());
408 public boolean isColourBySequence()
410 return colourBySequence;
413 public void setColourBySequence(boolean colourBySequence)
415 this.colourBySequence = colourBySequence;
418 StringBuffer condenseCommand(String command, int pos)
421 StringBuffer sb = new StringBuffer(command.substring(0,
422 command.lastIndexOf("select") + 7));
424 command = command.substring(sb.length());
428 if (command.indexOf("-") > -1)
430 start = command.substring(0, command.indexOf("-"));
434 start = command.substring(0, command.indexOf(":"));
437 sb.append(start + "-" + pos + command.substring(command.indexOf(":")));
442 public void createImage(String file, String type, int quality)
444 System.out.println("JMOL CREATE IMAGE");
447 public String createImage(String fileName, String type,
448 Object textOrBytes, int quality)
450 System.out.println("JMOL CREATE IMAGE");
454 public String eval(String strEval)
456 // System.out.println(strEval);
457 // "# 'eval' is implemented only for the applet.";
461 // End StructureListener
462 // //////////////////////////
464 public float[][] functionXY(String functionName, int x, int y)
469 public float[][][] functionXYZ(String functionName, int nx, int ny, int nz)
471 // TODO Auto-generated method stub
475 public Color getColour(int atomIndex, int pdbResNum, String chain,
478 if (getModelNum(pdbfile) < 0)
480 // TODO: verify atomIndex is selecting correct model.
481 return new Color(viewer.getAtomArgb(atomIndex));
485 * returns the current featureRenderer that should be used to colour the
490 public abstract FeatureRenderer getFeatureRenderer();
493 * instruct the Jalview binding to update the pdbentries vector if necessary
494 * prior to matching the jmol view's contents to the list of structure files
495 * Jalview knows about.
497 public abstract void refreshPdbEntries();
499 private int getModelNum(String modelFileName)
501 String[] mfn = getPdbFile();
506 for (int i = 0; i < mfn.length; i++)
508 if (mfn[i].equalsIgnoreCase(modelFileName))
514 // ////////////////////////////////
515 // /StructureListener
516 public String[] getPdbFile()
518 if (modelFileNames == null)
520 String mset[] = new String[viewer.getModelCount()];
521 for (int i = 0; i < mset.length; i++)
523 mset[i] = viewer.getModelFileName(i);
525 modelFileNames = mset;
527 return modelFileNames;
531 * map from string to applet
533 public Map getRegistryInfo()
535 // TODO Auto-generated method stub
540 * returns the current sequenceRenderer that should be used to colour the
545 public abstract SequenceRenderer getSequenceRenderer();
547 // ///////////////////////////////
548 // JmolStatusListener
550 public void handlePopupMenu(int x, int y)
552 jmolpopup.show(x, y);
556 public void highlightAtom(int atomIndex, int pdbResNum, String chain,
559 if (modelFileNames == null)
564 // look up file model number for this pdbfile
567 // may need to adjust for URLencoding here - we don't worry about that yet.
568 while (mdlNum < modelFileNames.length
569 && !pdbfile.equals(modelFileNames[mdlNum]))
571 // System.out.println("nomatch:"+pdbfile+"\nmodelfn:"+fn);
574 if (mdlNum == modelFileNames.length)
580 // if (!pdbfile.equals(pdbentry.getFile()))
582 if (resetLastRes.length() > 0)
584 viewer.evalStringQuiet(resetLastRes.toString());
588 eval.append("select " + pdbResNum); // +modelNum
590 resetLastRes.setLength(0);
591 resetLastRes.append("select " + pdbResNum); // +modelNum
594 resetLastRes.append(":");
595 if (!chain.equals(" "))
598 resetLastRes.append(chain);
601 eval.append(" /" + (mdlNum + 1));
602 resetLastRes.append("/" + (mdlNum + 1));
604 eval.append(";wireframe 100;" + eval.toString() + " and not hetero;");
606 resetLastRes.append(";wireframe 0;" + resetLastRes.toString()
607 + " and not hetero; spacefill 0;");
609 eval.append("spacefill 200;select none");
611 viewer.evalStringQuiet(eval.toString());
616 boolean debug = true;
618 private void jmolHistory(boolean enable)
620 viewer.evalStringQuiet("History " + ((debug || enable) ? "on" : "off"));
623 public void loadInline(String string)
626 viewer.openStringInline(string);
629 public void mouseOverStructure(int atomIndex, String strInfo)
632 int mdlSep = strInfo.indexOf("/");
633 int chainSeparator = strInfo.indexOf(":"), chainSeparator1 = -1;
635 if (chainSeparator == -1)
637 chainSeparator = strInfo.indexOf(".");
638 if (mdlSep > -1 && mdlSep < chainSeparator)
640 chainSeparator1 = chainSeparator;
641 chainSeparator = mdlSep;
644 pdbResNum = Integer.parseInt(strInfo.substring(
645 strInfo.indexOf("]") + 1, chainSeparator));
649 if (strInfo.indexOf(":") > -1)
650 chainId = strInfo.substring(strInfo.indexOf(":") + 1,
651 strInfo.indexOf("."));
657 String pdbfilename = modelFileNames[frameNo]; // default is first or current
661 if (chainSeparator1 == -1)
663 chainSeparator1 = strInfo.indexOf(".", mdlSep);
665 String mdlId = (chainSeparator1 > -1) ? strInfo.substring(mdlSep + 1,
666 chainSeparator1) : strInfo.substring(mdlSep + 1);
669 // recover PDB filename for the model hovered over.
671 .getModelFileName(new Integer(mdlId).intValue() - 1);
672 } catch (Exception e)
677 if (lastMessage == null || !lastMessage.equals(strInfo))
678 ssm.mouseOverStructure(pdbResNum, chainId, pdbfilename);
680 lastMessage = strInfo;
683 public void notifyAtomHovered(int atomIndex, String strInfo, String data)
687 System.err.println("Ignoring additional hover info: " + data
688 + " (other info: '" + strInfo + "' pos " + atomIndex + ")");
690 mouseOverStructure(atomIndex, strInfo);
694 * { if (history != null && strStatus != null &&
695 * !strStatus.equals("Script completed")) { history.append("\n" + strStatus);
699 public void notifyAtomPicked(int atomIndex, String strInfo, String strData)
702 * this implements the toggle label behaviour copied from the original
703 * structure viewer, MCView
707 System.err.println("Ignoring additional pick data string " + strData);
709 int chainSeparator = strInfo.indexOf(":");
711 if (chainSeparator == -1)
712 chainSeparator = strInfo.indexOf(".");
714 String picked = strInfo.substring(strInfo.indexOf("]") + 1,
716 String mdlString = "";
717 if ((p = strInfo.indexOf(":")) > -1)
718 picked += strInfo.substring(p + 1, strInfo.indexOf("."));
720 if ((p = strInfo.indexOf("/")) > -1)
722 mdlString += strInfo.substring(p, strInfo.indexOf(" #"));
724 picked = "((" + picked + ".CA" + mdlString + ")|(" + picked + ".P"
728 if (!atomsPicked.contains(picked))
730 viewer.evalStringQuiet("select " + picked + ";label %n %r:%c");
731 atomsPicked.addElement(picked);
735 viewer.evalString("select " + picked + ";label off");
736 atomsPicked.removeElement(picked);
739 // TODO: in application this happens
741 // if (scriptWindow != null)
743 // scriptWindow.sendConsoleMessage(strInfo);
744 // scriptWindow.sendConsoleMessage("\n");
749 public void notifyCallback(int type, Object[] data)
755 case JmolConstants.CALLBACK_LOADSTRUCT:
756 notifyFileLoaded((String) data[1], (String) data[2],
757 (String) data[3], (String) data[4],
758 ((Integer) data[5]).intValue());
761 case JmolConstants.CALLBACK_PICK:
762 notifyAtomPicked(((Integer) data[2]).intValue(), (String) data[1],
764 // also highlight in alignment
765 case JmolConstants.CALLBACK_HOVER:
766 notifyAtomHovered(((Integer) data[2]).intValue(), (String) data[1],
769 case JmolConstants.CALLBACK_SCRIPT:
770 notifyScriptTermination((String) data[2],
771 ((Integer) data[3]).intValue());
773 case JmolConstants.CALLBACK_ECHO:
774 sendConsoleEcho((String) data[1]);
776 case JmolConstants.CALLBACK_MESSAGE:
777 sendConsoleMessage((data == null) ? ((String) null)
780 case JmolConstants.CALLBACK_ERROR:
781 // System.err.println("Ignoring error callback.");
783 case JmolConstants.CALLBACK_SYNC:
784 case JmolConstants.CALLBACK_RESIZE:
787 case JmolConstants.CALLBACK_MEASURE:
789 case JmolConstants.CALLBACK_CLICK:
792 System.err.println("Unhandled callback " + type + " "
793 + data[1].toString());
796 } catch (Exception e)
798 System.err.println("Squashed Jmol callback handler error:");
803 public boolean notifyEnabled(int callbackPick)
805 switch (callbackPick)
807 case JmolConstants.CALLBACK_ECHO:
808 case JmolConstants.CALLBACK_LOADSTRUCT:
809 case JmolConstants.CALLBACK_MEASURE:
810 case JmolConstants.CALLBACK_MESSAGE:
811 case JmolConstants.CALLBACK_PICK:
812 case JmolConstants.CALLBACK_SCRIPT:
813 case JmolConstants.CALLBACK_HOVER:
814 case JmolConstants.CALLBACK_ERROR:
816 case JmolConstants.CALLBACK_RESIZE:
817 case JmolConstants.CALLBACK_SYNC:
818 case JmolConstants.CALLBACK_CLICK:
819 case JmolConstants.CALLBACK_ANIMFRAME:
820 case JmolConstants.CALLBACK_MINIMIZATION:
825 public void notifyFileLoaded(String fullPathName, String fileName2,
826 String modelName, String errorMsg, int modelParts)
828 if (errorMsg != null)
830 fileLoadingError = errorMsg;
834 // the rest of this routine ignores the arguments, and simply interrogates
835 // the Jmol view to find out what structures it contains, and adds them to
836 // the structure selection manager.
837 fileLoadingError = null;
838 String[] oldmodels = modelFileNames;
839 modelFileNames = null;
840 chainNames = new Vector();
841 boolean notifyLoaded = false;
842 String[] modelfilenames = getPdbFile();
843 ssm = StructureSelectionManager.getStructureSelectionManager();
844 // first check if we've lost any structures
845 if (oldmodels != null && oldmodels.length > 0)
848 for (int i = 0; i < oldmodels.length; i++)
850 for (int n = 0; n < modelfilenames.length; n++)
852 if (modelfilenames[n] == oldmodels[i])
858 if (oldmodels[i] != null)
865 String[] oldmfn = new String[oldm];
867 for (int i = 0; i < oldmodels.length; i++)
869 if (oldmodels[i] != null)
871 oldmfn[oldm++] = oldmodels[i];
874 // deregister the Jmol instance for these structures - we'll add
875 // ourselves again at the end for the current structure set.
876 ssm.removeStructureViewerListener(this, oldmfn);
880 for (int modelnum = 0; modelnum < modelfilenames.length; modelnum++)
882 String fileName = modelfilenames[modelnum];
883 if (fileName != null)
885 boolean foundEntry = false;
886 // search pdbentries and sequences to find correct pdbentry and
887 // sequence[] pair for this filename
888 if (pdbentry != null)
890 for (int pe = 0; pe < pdbentry.length; pe++)
892 if (pdbentry[pe].getFile().equals(fileName))
898 // TODO: replace with getData ?
899 pdb = ssm.setMapping(sequence, chains,
900 pdbentry[pe].getFile(), AppletFormatAdapter.PASTE);
901 pdbentry[pe].setFile("INLINE" + pdb.id);
905 // TODO: Jmol can in principle retrieve from CLASSLOADER but
908 // to be tested. See mantis bug
909 // https://mantis.lifesci.dundee.ac.uk/view.php?id=36605
910 String protocol = AppletFormatAdapter.URL;
913 File fl = new java.io.File(pdbentry[pe].getFile());
916 protocol = AppletFormatAdapter.FILE;
918 } catch (Exception e)
924 pdb = ssm.setMapping(sequence, chains,
925 pdbentry[pe].getFile(), protocol);
929 pdbentry[pe].setId(pdb.id);
931 for (int i = 0; i < pdb.chains.size(); i++)
933 chainNames.addElement(new String(pdb.id + ":"
934 + ((MCview.PDBChain) pdb.chains.elementAt(i)).id));
940 if (!foundEntry && associateNewStructs)
942 // this is a foreign pdb file that jalview doesn't know about - add
943 // it to the dataset and try to find a home - either on a matching
944 // sequence or as a new sequence.
945 String pdbcontent = viewer.getData("/" + (modelnum + 1) + ".1",
947 // parse pdb file into a chain, etc.
948 // locate best match for pdb in associated views and add mapping to
950 // if properly registered then
957 // so finally, update the jmol bits and pieces
958 if (jmolpopup != null)
960 jmolpopup.updateComputedMenus();
962 if (!isLoadingFromArchive())
964 viewer.evalStringQuiet("model 0; select backbone;restrict;cartoon;wireframe off;spacefill off");
966 setLoadingFromArchive(false);
967 // register ourselves as a listener and notify the gui that it needs to
969 ssm.addStructureViewerListener(this);
972 FeatureRenderer fr = getFeatureRenderer();
981 public void notifyNewPickingModeMeasurement(int iatom, String strMeasure)
983 notifyAtomPicked(iatom, strMeasure, null);
986 public abstract void notifyScriptTermination(String strStatus,
990 * display a message echoed from the jmol viewer
994 public abstract void sendConsoleEcho(String strEcho); /*
995 * { showConsole(true);
997 * history.append("\n" +
1001 // /End JmolStatusListener
1002 // /////////////////////////////
1006 * status message - usually the response received after a script
1009 public abstract void sendConsoleMessage(String strStatus);
1011 public void setCallbackFunction(String callbackType,
1012 String callbackFunction)
1014 System.err.println("Ignoring set-callback request to associate "
1015 + callbackType + " with function " + callbackFunction);
1019 public void setJalviewColourScheme(ColourSchemeI cs)
1021 colourBySequence = false;
1030 // TODO: Switch between nucleotide or aa selection expressions
1031 Enumeration en = ResidueProperties.aa3Hash.keys();
1032 StringBuffer command = new StringBuffer("select *;color white;");
1033 while (en.hasMoreElements())
1035 res = en.nextElement().toString();
1036 index = ((Integer) ResidueProperties.aa3Hash.get(res)).intValue();
1040 col = cs.findColour(ResidueProperties.aa[index].charAt(0));
1042 command.append("select " + res + ";color[" + col.getRed() + ","
1043 + col.getGreen() + "," + col.getBlue() + "];");
1046 evalStateCommand(command.toString());
1050 public void showHelp()
1052 showUrl("http://jmol.sourceforge.net/docs/JmolUserGuide/", "jmolHelp");
1056 * open the URL somehow
1060 public abstract void showUrl(String url, String target);
1063 * called when the binding thinks the UI needs to be refreshed after a Jmol
1064 * state change. this could be because structures were loaded, or because an
1065 * error has occured.
1067 public abstract void refreshGUI();
1071 * @param renderPanel
1072 * @param jmolfileio - when true will initialise jmol's file IO system (should be false in applet context)
1074 * @param documentBase
1076 * @param commandOptions
1078 public void allocateViewer(Component renderPanel, boolean jmolfileio, String htmlName,
1079 URL documentBase, URL codeBase, String commandOptions)
1081 viewer = JmolViewer.allocateViewer(renderPanel,
1082 (jmolfileio ? new SmarterJmolAdapter() : null),
1083 htmlName + ((Object) this).toString(), documentBase, codeBase,
1084 commandOptions, this);
1087 public void setLoadingFromArchive(boolean loadingFromArchive)
1089 this.loadingFromArchive = loadingFromArchive;
1092 public boolean isLoadingFromArchive()
1094 return loadingFromArchive;
1097 public void setBackgroundColour(java.awt.Color col)
1100 viewer.evalStringQuiet("background [" + col.getRed() + ","
1101 + col.getGreen() + "," + col.getBlue() + "];");