- pdbentry.setId(pdb.id);
-
- Vector chains = new Vector();
- for (int i = 0; i < pdb.chains.size(); i++)
- {
- chains.addElement(new String(pdb.id + ":"
- + ((MCview.PDBChain) pdb.chains.elementAt(i)).id));
- }
- setChainMenuItems(chains);
-
- colourBySequence(ap);
-
- StringBuffer title = new StringBuffer(sequence[0].getName() + ":"
- + pdbentry.getId());
-
- if (pdbentry.getProperty() != null)
- {
- if (pdbentry.getProperty().get("method") != null)
- {
- title.append(" Method: ");
- title.append(pdbentry.getProperty().get("method"));
- }
- if (pdbentry.getProperty().get("chains") != null)
- {
- title.append(" Chain:");
- title.append(pdbentry.getProperty().get("chains"));
- }
- }
-
- this.setTitle(title.toString());
-
- }
- else
- {
- // this is a foreign pdb file that jalview doesn't know about - add it to the dataset
- // and try to find a home - either on a matching sequence or as a new sequence.
- String pdbcontent = viewer.getData("/" + (modelnum + 1) + ".1",
- "PDB");
- // parse pdb file into a chain, etc.
- // locate best match for pdb in associated views and add mapping to
- // ssm
- modelsloaded=true;
- }
- }
- }
- if (modelsloaded) {
- // FILE LOADED OK
- jmolpopup.updateComputedMenus();
- viewer
- .evalStringQuiet("model 0; select backbone;restrict;cartoon;wireframe off;spacefill off");
-
- ssm.addStructureViewerListener(this);
- }
- }
-
- public void sendConsoleEcho(String strEcho)
- {
- if (scriptWindow == null)
- showConsole(true);
-
- history.append("\n" + strEcho);
- }
-
- public void sendConsoleMessage(String strStatus)
- {
- if (history != null && strStatus != null
- && !strStatus.equals("Script completed"))
- {
- history.append("\n" + strStatus);
- }
- }
-
- public void notifyScriptTermination(String strStatus, int msWalltime)
- {
- }
-
- public void handlePopupMenu(int x, int y)
- {
- jmolpopup.show(x, y);
- }
-
- public void notifyNewPickingModeMeasurement(int iatom, String strMeasure)
- {
- notifyAtomPicked(iatom, strMeasure, null);
- }
-
- public void notifyAtomPicked(int atomIndex, String strInfo, String strData)
- {
- if (strData != null)
- {
- System.err.println("Ignoring additional pick data string " + strData);
- }
- int chainSeparator = strInfo.indexOf(":");
- int p=0;
- if (chainSeparator == -1)
- chainSeparator = strInfo.indexOf(".");
-
- String picked = strInfo.substring(strInfo.indexOf("]") + 1,
- chainSeparator);
- String mdlString="";
- if ((p=strInfo.indexOf(":")) > -1)
- picked += strInfo.substring(p + 1, strInfo
- .indexOf("."));
-
- if ((p=strInfo.indexOf("/"))> -1)
- {
- mdlString += strInfo.substring(p, strInfo.indexOf(" #"));
- }
- picked = "((" + picked + ".CA" + mdlString+")|(" + picked + ".P" + mdlString+"))";
- jmolHistory(false);
-
- if (!atomsPicked.contains(picked))
- {
- viewer.evalStringQuiet("select " + picked + ";label %n %r:%c");
- atomsPicked.addElement(picked);
- }
- else
- {
- viewer.evalString("select " + picked + ";label off");
- atomsPicked.removeElement(picked);
- }
- jmolHistory(true);
-
- }
-
- public void notifyAtomHovered(int atomIndex, String strInfo, String data)
- {
- if (data != null)
- {
- System.err.println("Ignoring additional hover info: " + data);
- }
- mouseOverStructure(atomIndex, strInfo);