<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_17"/>
<classpathentry kind="lib" path="lib/activation.jar"/>
<classpathentry kind="lib" path="lib/axis.jar" sourcepath="D:/axis-1_2RC2-src/axis-1_2RC2"/>
<classpathentry kind="lib" path="lib/commons-discovery.jar"/>
<classpathentry kind="lib" path="lib/wsdl4j.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
- <classpathentry kind="lib" path="lib/Jmol-11.0.2.jar"/>
<classpathentry kind="lib" path="lib/castor-1.1-cycle-xml.jar" sourcepath="C:/Documents and Settings/JimP/workspace-3.3/castor/src/main/java"/>
<classpathentry kind="lib" path="lib/JGoogleAnalytics-0.2.1-SNAPSHOT.jar" sourcepath="/JGoogleAnalytics/src/main/java"/>
<classpathentry kind="lib" path="lib/vamsas-client.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/VamsasClient"/>
+ <classpathentry kind="lib" path="lib/min-jws2-client-1.0.jar"/>
+ <classpathentry kind="lib" path="lib/Jmol-12.0.RC18.jar" sourcepath="D:/BartonStuff/jmol/src.zip"/>
<classpathentry kind="output" path="classes"/>
</classpath>
import org.jmol.adapter.smarter.SmarterJmolAdapter;
import org.jmol.popup.*;
+import org.jmol.viewer.JmolConstants;
+
import jalview.schemes.*;
public class AppletJmol extends EmbmenuFrame implements StructureListener,
embedMenuIfNeeded(renderPanel);
this.add(renderPanel, BorderLayout.CENTER);
viewer = JmolViewer.allocateViewer(renderPanel,
- new SmarterJmolAdapter());
-
- viewer.setAppletContext("jalview", ap.av.applet.getDocumentBase(),
- ap.av.applet.getCodeBase(), null);
-
- viewer.setJmolStatusListener(this);
+ new SmarterJmolAdapter(), "jalviewJmol", ap.av.applet.getDocumentBase(),
+ ap.av.applet.getCodeBase(), "", this);
- jmolpopup = JmolPopup.newJmolPopup(viewer);
+ jmolpopup = JmolPopup.newJmolPopup(viewer, true, "Jmol", true);
this.addWindowListener(new WindowAdapter()
{
{
}
- public void setCallbackFunction(String callbackType,
- String callbackFunction)
- {
- }
-
public void notifyFileLoaded(String fullPathName, String fileName,
- String modelName, Object clientFile, String errorMsg)
+ String modelName, String errorMsg, int modelParts)
{
if (errorMsg != null)
{
if (fileName != null)
{
+ // TODO: do some checking using the modelPts number of parts against our own estimate of the number of chains
// FILE LOADED OK
jmolpopup.updateComputedMenus();
viewer
return;
}
- public void notifyFrameChanged(int frameNo)
- {
- boolean isAnimationRunning = (frameNo <= -2);
- }
-
- public void notifyScriptStart(String statusMessage, String additionalInfo)
- {
- }
-
public void sendConsoleEcho(String strEcho)
{
if (scriptWindow == null)
public void notifyNewPickingModeMeasurement(int iatom, String strMeasure)
{
- notifyAtomPicked(iatom, strMeasure);
- }
-
- public void notifyNewDefaultModeMeasurement(int count, String strInfo)
- {
+ notifyAtomPicked(iatom, strMeasure, null);
}
- public void notifyAtomPicked(int atomIndex, String strInfo)
+ 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(":");
if (chainSeparator == -1)
picked += strInfo.substring(strInfo.indexOf(":") + 1, strInfo
.indexOf("."));
- picked += ".CA";
+ picked = "(("+picked+".CA" + ")|("+picked+".P"+"))";
if (!atomsPicked.contains(picked))
{
}
}
- public void notifyAtomHovered(int atomIndex, String strInfo)
+ public void notifyAtomHovered(int atomIndex, String strInfo, String data)
{
+ if (data!=null)
+ {
+ System.err.println("Ignoring additional hover info: "+data);
+ }
mouseOverStructure(atomIndex, strInfo);
}
- public void sendSyncScript(String script, String appletName)
- {
- }
public void showUrl(String url)
{
validate();
}
- public float functionXY(String functionName, int x, int y)
+ public float[][] functionXY(String functionName, int x, int y)
{
- return 0;
+ return null ;
}
// /End JmolStatusListener
}
}
+ @Override
+ public String createImage(String fileName, String type,
+ Object textOrBytes, int quality)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public float[][][] functionXYZ(String functionName, int nx, int ny, int nz)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Hashtable getRegistryInfo()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void notifyCallback(int type, Object[] data)
+ {
+ try {
+ switch (type)
+ {
+ case JmolConstants.CALLBACK_LOADSTRUCT:
+ notifyFileLoaded((String) data[1], (String) data[2],
+ (String) data[3], (String) data[4], ((Integer) data[5]).intValue());
+
+ break;
+ case JmolConstants.CALLBACK_PICK:
+ notifyAtomPicked(((Integer) data[2]).intValue(), (String) data[1], (String) data[0]);
+ // also highlight in alignment
+ case JmolConstants.CALLBACK_HOVER:
+ notifyAtomHovered(((Integer) data[2]).intValue(), (String) data[1], (String) data[0]);
+ break;
+ case JmolConstants.CALLBACK_SCRIPT:
+ notifyScriptTermination((String)data[2], ((Integer)data[3]).intValue());
+ break;
+ case JmolConstants.CALLBACK_ECHO:
+ sendConsoleEcho((String)data[1]);
+ break;
+ case JmolConstants.CALLBACK_MESSAGE:
+ sendConsoleMessage((data==null) ? ((String) null) : (String)data[1]);
+ break;
+ case JmolConstants.CALLBACK_MEASURE:
+ case JmolConstants.CALLBACK_CLICK:
+ default:
+ System.err.println("Unhandled callback "+type+" "+data);
+ break;
+ }
+ }
+ catch (Exception e)
+ {
+ System.err.println("Squashed Jmol callback handler error:");
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public boolean notifyEnabled(int callbackPick)
+ {
+ switch (callbackPick)
+ {
+ case JmolConstants.CALLBACK_ECHO:
+ case JmolConstants.CALLBACK_LOADSTRUCT:
+ case JmolConstants.CALLBACK_MEASURE:
+ case JmolConstants.CALLBACK_MESSAGE:
+ case JmolConstants.CALLBACK_PICK:
+ case JmolConstants.CALLBACK_SCRIPT:
+ case JmolConstants.CALLBACK_HOVER:
+ case JmolConstants.CALLBACK_ERROR:
+ return true;
+ case JmolConstants.CALLBACK_CLICK:
+ case JmolConstants.CALLBACK_ANIMFRAME:
+ case JmolConstants.CALLBACK_MINIMIZATION:
+ case JmolConstants.CALLBACK_RESIZE:
+ case JmolConstants.CALLBACK_SYNC:
+ }
+ return false;
+ }
+
+ @Override
+ public void setCallbackFunction(String callbackType,
+ String callbackFunction)
+ {
+ System.err.println("Ignoring set-callback request to associate "+callbackType+" with function "+callbackFunction);
+
+ }
+
}
import java.io.*;
import jalview.jbgui.GStructureViewer;
+import jalview.bin.Cache;
import jalview.datamodel.*;
import jalview.gui.*;
import jalview.structure.*;
import org.jmol.api.*;
import org.jmol.adapter.smarter.SmarterJmolAdapter;
import org.jmol.popup.*;
+import org.jmol.viewer.JmolConstants;
public class AppJmol extends GStructureViewer implements StructureListener,
JmolStatusListener, Runnable
pdbentry = new PDBEntry();
pdbentry.setFile(file);
pdbentry.setId(id);
- this.chains = chains;
this.sequence = seq;
this.ap = ap;
this.setBounds(bounds);
this.setTitle(title.toString());
jalview.gui.Desktop.addInternalFrame(this, title.toString(),
getBounds().width, getBounds().height);
+ // * OK, but safer to assign htmlName, URL bases, comandOptions, and
+ // statusListener now.
viewer = org.jmol.api.JmolViewer.allocateViewer(renderPanel,
- new SmarterJmolAdapter());
+ new SmarterJmolAdapter(), "", null, null, "", this);
- viewer.setAppletContext("", null, null, "");
-
- viewer.setJmolStatusListener(this);
-
- jmolpopup = JmolPopup.newJmolPopup(viewer);
+ jmolpopup = JmolPopup.newJmolPopup(viewer, true, "Jmol", true);
viewer.evalStringQuiet(command);
}
System.out.println("JMOL CREATE IMAGE");
}
- public void setCallbackFunction(String callbackType,
- String callbackFunction)
- {
- }
-
public void notifyFileLoaded(String fullPathName, String fileName,
- String modelName, Object clientFile, String errorMsg)
+ String modelName, String errorMsg, int modelParts)
{
if (errorMsg != null)
{
if (fileName != null)
{
-
+ // TODO: do some checking using the modelPts number of parts against our own estimate of the number of chains
// FILE LOADED OK
ssm = StructureSelectionManager.getStructureSelectionManager();
MCview.PDBfile pdbFile = ssm.setMapping(sequence, chains, pdbentry
return;
}
- public void notifyFrameChanged(int frameNo)
- {
- boolean isAnimationRunning = (frameNo <= -2);
- }
-
- public void notifyScriptStart(String statusMessage, String additionalInfo)
- {
- }
-
public void sendConsoleEcho(String strEcho)
{
if (scriptWindow != null)
public void notifyNewPickingModeMeasurement(int iatom, String strMeasure)
{
- notifyAtomPicked(iatom, strMeasure);
+ notifyAtomPicked(iatom, strMeasure, null);
}
- public void notifyNewDefaultModeMeasurement(int count, String strInfo)
- {
- }
-
- public void notifyAtomPicked(int atomIndex, String strInfo)
+ public void notifyAtomPicked(int atomIndex, String strInfo, String strData)
{
+ if (strData!=null)
+ {
+ Cache.log.info("Non null pick data string: "+strData+" (other info: '"+strInfo+"' pos "+atomIndex+")");
+ }
Matcher matcher = pattern.matcher(strInfo);
matcher.find();
if (chainId != null)
picked += (":" + chainId.substring(1, chainId.length()));
- picked += ".CA";
+ picked = "(("+picked+".CA" + ")|("+picked+".P"+"))";
if (!atomsPicked.contains(picked))
{
}
}
- public void notifyAtomHovered(int atomIndex, String strInfo)
+ public void notifyAtomHovered(int atomIndex, String strInfo, String data)
{
+ if (data!=null)
+ {
+ Cache.log.info("Non null hover data string: "+data+" (other info: '"+strInfo+"' pos "+atomIndex+")");
+ }
mouseOverStructure(atomIndex, strInfo);
}
- public void sendSyncScript(String script, String appletName)
- {
- }
-
+ @Override
public void showUrl(String url)
{
+ try {
+ jalview.util.BrowserLauncher.openURL(url);
+ } catch (IOException e)
+ {
+ Cache.log.error("Failed to launch Jmol-associated url "+url,e);
+ // TODO: 2.6 : warn user if browser was not configured.
+ }
}
public void showConsole(boolean showConsole)
validate();
}
- public float functionXY(String functionName, int x, int y)
+ public float[][] functionXY(String functionName, int x, int y)
{
- return 0;
+ return null;
}
// /End JmolStatusListener
return viewId;
}
+ @Override
+ public String createImage(String fileName, String type,
+ Object textOrBytes, int quality)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public float[][][] functionXYZ(String functionName, int nx, int ny, int nz)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Hashtable getRegistryInfo()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void notifyCallback(int type, Object[] data)
+ {
+ try {
+ switch (type)
+ {
+ case JmolConstants.CALLBACK_LOADSTRUCT:
+ notifyFileLoaded((String) data[1], (String) data[2],
+ (String) data[3], (String) data[4], ((Integer) data[5]).intValue());
+
+ break;
+ case JmolConstants.CALLBACK_PICK:
+ notifyAtomPicked(((Integer) data[2]).intValue(), (String) data[1], (String) data[0]);
+ // also highlight in alignment
+ case JmolConstants.CALLBACK_HOVER:
+ notifyAtomHovered(((Integer) data[2]).intValue(), (String) data[1], (String) data[0]);
+ break;
+ case JmolConstants.CALLBACK_SCRIPT:
+ notifyScriptTermination((String)data[2], ((Integer)data[3]).intValue());
+ break;
+ case JmolConstants.CALLBACK_ECHO:
+ sendConsoleEcho((String)data[1]);
+ break;
+ case JmolConstants.CALLBACK_MESSAGE:
+ sendConsoleMessage((data==null) ? ((String) null) : (String)data[1]);
+ break;
+ case JmolConstants.CALLBACK_MEASURE:
+ case JmolConstants.CALLBACK_CLICK:
+ default:
+ System.err.println("Unhandled callback "+type+" "+data);
+ break;
+ }
+ }
+ catch (Exception e)
+ {
+ Cache.log.warn("Squashed Jmol callback handler error: ",e);
+ }
+ }
+
+ @Override
+ public boolean notifyEnabled(int callbackPick)
+ {
+ switch (callbackPick)
+ {
+ case JmolConstants.CALLBACK_ECHO:
+ case JmolConstants.CALLBACK_LOADSTRUCT:
+ case JmolConstants.CALLBACK_MEASURE:
+ case JmolConstants.CALLBACK_MESSAGE:
+ case JmolConstants.CALLBACK_PICK:
+ case JmolConstants.CALLBACK_SCRIPT:
+ case JmolConstants.CALLBACK_HOVER:
+ case JmolConstants.CALLBACK_ERROR:
+ return true;
+ case JmolConstants.CALLBACK_CLICK:
+ case JmolConstants.CALLBACK_ANIMFRAME:
+ case JmolConstants.CALLBACK_MINIMIZATION:
+ case JmolConstants.CALLBACK_RESIZE:
+ case JmolConstants.CALLBACK_SYNC:
+ }
+ return false;
+ }
+
+ @Override
+ public void setCallbackFunction(String callbackType,
+ String callbackFunction)
+ {
+ Cache.log.debug("Ignoring set-callback request to associate "+callbackType+" with function "+callbackFunction);
+
+ }
+
}
else
{
boolean isScriptExecuting = viewer.isScriptExecuting();
- if (viewer.checkHalt(strCommand))
+ if (viewer.checkHalt(strCommand, true))
strErrorMessage = (isScriptExecuting ? "string execution halted with "
+ strCommand
: "no script was executing");