Are you talking about integrating Jmol into a java application as opposed to
a web application?
If so the way I accomplish that is to create a class for housing jmol that
is an extension of JPanel
In that class declare
JmolViewer viewer;
JmolAdapter adapter;
Dimension currentSize;
Rectangle clipRect;
In the constructor create instances of currentSize and clipRect using the
standard constructor.
Create adapter using new SmarterJmolAdapter();
Create viewer using
JmolViewer.allocateViewer(this,adapter,null,null,null,null,null);
Instead of the nulls you can have the desired URLs and handler if needed
(see documentation for allocate viewer)
Create a getViewer method that just returns viewer
Override paint with
Public void paint (Graphics g){
getSize(currentSize);
g.getClipBounds(clipRect);
viewer.renderScreenImage(g,currentSize,clipRect);
You can then add the jmol class you created as a JPanel to what ever you
need to in your application. Get viewer and you have an instance of jmol
viewer.
Joe
> -----Original Message-----
> From: Vincent Le Guilloux [mailto:[email protected]]
> Sent: Sunday, October 04, 2009 10:29 AM
> To: [email protected]
> Subject: [Jmol-users] Jmol integration
>
>
> Hi,
>
> I'm planing to integrate JMol to my application to view PDB files and
> ligand pockets. Basically, my pockets will be represented by several
> spheres placed in the structure (input as PQR format), and atoms next
> to those speres, and I want the user to be able to select and extract
> pocket interactively.
>
> Anyway, I'm currently using a small code snippet taken from the
> biojava documentation. It makes use of the JmolSimpleViewer class.
>
> So currently, I'm able to display a pdb file in the viewer and execute
> some rasmol-like queries.
>
> My question would be: is there any way to get the Jmol popup menu that
> one get when right clicking on the desktop version of Jmol ?
>
> And more generally, what is the best and most recent place to learn
> how to integrate Jmol into an application? I'm currently using
> Biojava's examples, and I've checked the Jmol wiki here:
> http://wiki.jmol.org/index.php?title=Applications_Embedding_Jmol
>
> but currently I haven't found the way to do what I want to do.
>
> Thanks in advance!
> Vincent
>
>
> --------------------------------------------------------------------------
> ----
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register
> now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users