> I guess I could just output pdb-files and load them, but I would > prefer to do it programmatically - something like > > 1) transform, my model into a Jmol model (with org.jmol.viewer.Atom's ?) > 2) set the model as the current model in Jmol > 3) repaint > > I've been looking in org.jmol.viewer.Frame and ModelManager, but I > cant see any methods that would immediately help me. > > Can anyone recommend how to proceed?
Anders, Jmol is designed to do what you want. The JmolModelAdapter defines the API that you need to use. The core Jmol viewer does not read directly from files. Rather, it retrieves molecular model data through the JmolModelAdapter interface. This allows one to store molecular model data in whatever format you want, and feed it to Jmol in the way that it wants. The api is defined in org.jmol.api.JmolModelAdapter There are two examples of implementations. src.org.jmol.adapter.smarter.SmarterModelAdapter src.org.jmol.cdk.CdkJmolModelAdapter The first of these is for reading files. The 'resolver' mechanism and the individual file readers are a little complicated, but the core data model (Atom, Bond, etc.) is rather simple. The second of these is for taking a molecular model directly from the Chemistry Development Kit (cdk.sourceforge.net). This may be a better example for you ... because it is interfacing directly with a library of in-memory data structures. Ask questions on this mailing list ([email protected]) if you have problems. Miguel ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 _______________________________________________ Jmol-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-developers
