Discussion:
[Cdk-user] JChemPaint embedded in Swing application
Nina Jeliazkova
2010-04-08 19:31:09 UTC
Permalink
Hello All,

I am trying to upgrade a Swing application (
http://toxtree.sourceforge.net/ ) to use recent versions of CDK and
JChemPaint.
An embedded JChemPaint had been used successfully since 2005, but I am
having troubles with upgrading to recent JChemPaint 3.x versions. The
code below uses cdk-1.3.4 and jchempaint-3.0.1:

IChemModel chemModel =
DefaultChemObjectBuilder.getInstance().newChemModel();
chemModel.setMoleculeSet(chemModel.getBuilder().newMoleculeSet());

chemModel.getMoleculeSet().addAtomContainer(chemModel.getBuilder().newMolecule());

JChemPaintPanel jcp= new JChemPaintPanel(chemModel,
JChemPaint.GUI_APPLICATION, false,null);

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError:
org.openscience.cdk.tools.ILoggingTool.debug(Ljava/lang/Object;Ljava/lang/Object;)V
at
org.openscience.jchempaint.JChemPaintMenuHelper.createMenu(JChemPaintMenuHelper.java:89)
at
org.openscience.jchempaint.JChemPaintMenuBar.addNormalMenuBar(JChemPaintMenuBar.java:84)
at
org.openscience.jchempaint.JChemPaintMenuBar.<init>(JChemPaintMenuBar.java:61)
at
org.openscience.jchempaint.JChemPaintPanel.customizeView(JChemPaintPanel.java:366)
at
org.openscience.jchempaint.JChemPaintPanel.<init>(JChemPaintPanel.java:146)

I have tried unsuccessfully to use cdk-jchempaint-8/9.jar with cdk-1.3.4
, but it doesn't recognize org.openscience.jchempaint.renderer.*
classes, and replacing these with org.openscience.cdk.renderer.* gives
some compile errors.

Any recommendation for correct dependencies between CDK and JChemPaint
versions, or working examples of embedded JChemPaint will help a lot.

Best regards,
Nina Jeliazkova
Stefan Kuhn
2010-04-09 09:02:52 UTC
Permalink
Hi Nina,
JCP is working (I just checked) with a checkout of the EBI cdk repository at
http://www.ebi.ac.uk/steinbeck-srv/git/cdk. This is cdk master plus some
patches. Since JCP is no longer integrated to cdk and since git has the
philosophy of many repositories existing in parallel, it is not and cannot be
guaranteed to work with any other cdk code.
Stefan
Post by Nina Jeliazkova
Hello All,
I am trying to upgrade a Swing application (
http://toxtree.sourceforge.net/ ) to use recent versions of CDK and
JChemPaint.
An embedded JChemPaint had been used successfully since 2005, but I am
having troubles with upgrading to recent JChemPaint 3.x versions. The
IChemModel chemModel =
DefaultChemObjectBuilder.getInstance().newChemModel();
chemModel.setMoleculeSet(chemModel.getBuilder().newMoleculeSet());
chemModel.getMoleculeSet().addAtomContainer(chemModel.getBuilder().newMolec
ule());
JChemPaintPanel jcp= new JChemPaintPanel(chemModel,
JChemPaint.GUI_APPLICATION, false,null);
org.openscience.cdk.tools.ILoggingTool.debug(Ljava/lang/Object;Ljava/lang/O
bject;)V at
org.openscience.jchempaint.JChemPaintMenuHelper.createMenu(JChemPaintMenuHe
lper.java:89) at
org.openscience.jchempaint.JChemPaintMenuBar.addNormalMenuBar(JChemPaintMen
uBar.java:84) at
61) at
org.openscience.jchempaint.JChemPaintPanel.customizeView(JChemPaintPanel.ja
va:366) at
org.openscience.jchempaint.JChemPaintPanel.<init>(JChemPaintPanel.java:146)
I have tried unsuccessfully to use cdk-jchempaint-8/9.jar with cdk-1.3.4
, but it doesn't recognize org.openscience.jchempaint.renderer.*
classes, and replacing these with org.openscience.cdk.renderer.* gives
some compile errors.
Any recommendation for correct dependencies between CDK and JChemPaint
versions, or working examples of embedded JChemPaint will help a lot.
Best regards,
Nina Jeliazkova
---------------------------------------------------------------------------
--- Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cdk-user mailing list
https://lists.sourceforge.net/lists/listinfo/cdk-user
--
Stefan Kuhn B. Sc. M. A.
Software Engineer in the Chemoinformatics and Metabolism Team
European Bioinformatics Institute (EBI)
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD UK
Phone +44 1223 49 2657
Fax +44 (0)1223 494 468
Nina Jeliazkova
2010-04-09 09:11:55 UTC
Permalink
Hi Stefan,

I've more or less managed to get it working with cdk-1.3.3 (not 1.3.4)
and jchempaint-3.0.1 ; there are few minor issues I'll be reporting later.
Post by Stefan Kuhn
Hi Nina,
JCP is working (I just checked) with a checkout of the EBI cdk repository at
http://www.ebi.ac.uk/steinbeck-srv/git/cdk. This is cdk master plus some
patches. Since JCP is no longer integrated to cdk and since git has the
philosophy of many repositories existing in parallel, it is not and cannot be
guaranteed to work with any other cdk code.
This sounds quite scary - isn't it possible to at least define
dependencies between released packages - for example maven is excellent
at supporting these - I would be glad to help with.
I am sure I am not the only one who would like to use cdk library and
jchempaint in third party applications.

Best regards,
Nina
Post by Stefan Kuhn
Stefan
Post by Nina Jeliazkova
Hello All,
I am trying to upgrade a Swing application (
http://toxtree.sourceforge.net/ ) to use recent versions of CDK and
JChemPaint.
An embedded JChemPaint had been used successfully since 2005, but I am
having troubles with upgrading to recent JChemPaint 3.x versions. The
IChemModel chemModel =
DefaultChemObjectBuilder.getInstance().newChemModel();
chemModel.setMoleculeSet(chemModel.getBuilder().newMoleculeSet());
chemModel.getMoleculeSet().addAtomContainer(chemModel.getBuilder().newMolec
ule());
JChemPaintPanel jcp= new JChemPaintPanel(chemModel,
JChemPaint.GUI_APPLICATION, false,null);
org.openscience.cdk.tools.ILoggingTool.debug(Ljava/lang/Object;Ljava/lang/O
bject;)V at
org.openscience.jchempaint.JChemPaintMenuHelper.createMenu(JChemPaintMenuHe
lper.java:89) at
org.openscience.jchempaint.JChemPaintMenuBar.addNormalMenuBar(JChemPaintMen
uBar.java:84) at
61) at
org.openscience.jchempaint.JChemPaintPanel.customizeView(JChemPaintPanel.ja
va:366) at
org.openscience.jchempaint.JChemPaintPanel.<init>(JChemPaintPanel.java:146)
I have tried unsuccessfully to use cdk-jchempaint-8/9.jar with cdk-1.3.4
, but it doesn't recognize org.openscience.jchempaint.renderer.*
classes, and replacing these with org.openscience.cdk.renderer.* gives
some compile errors.
Any recommendation for correct dependencies between CDK and JChemPaint
versions, or working examples of embedded JChemPaint will help a lot.
Best regards,
Nina Jeliazkova
---------------------------------------------------------------------------
--- Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Cdk-user mailing list
https://lists.sourceforge.net/lists/listinfo/cdk-user
Egon Willighagen
2010-04-09 09:26:53 UTC
Permalink
Post by Stefan Kuhn
JCP is working (I just checked) with a checkout of the EBI cdk repository at
http://www.ebi.ac.uk/steinbeck-srv/git/cdk. This is cdk master plus some
patches. Since JCP is no longer integrated to cdk
JChemPaint *is* integrated with the CDK... I guess what is meant here,
is that the JChemPaint 3 applet the EBI team worked on has some
patches to make things work?

The CDK-JChemPaint examples I have in my blog use the other branch,
which contains the JChemPaint renderer and controller code that does
integrate with CDK 1.3.4.
Post by Stefan Kuhn
and since git has the
philosophy of many repositories existing in parallel, it is not and cannot be
guaranteed to work with any other cdk code.
Git actually solves the problem of parallel branches, by using unique
hashes for states of the repository. Only if you start 'git
rebase'-ing, the hashes change, and you loose the *common ancestor*...
So, 'git' stops working of people do not ensure to have a common
ancestor, which could be, for example, the cdk-1.3.4 tag found in the
repository.

Egon
--
Post-doc @ Uppsala University
Proteochemometrics / Bioclipse Group of Prof. Jarl Wikberg
Homepage: http://egonw.github.com/
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers
Nina Jeliazkova
2010-04-09 09:47:54 UTC
Permalink
Post by Egon Willighagen
Post by Stefan Kuhn
JCP is working (I just checked) with a checkout of the EBI cdk repository at
http://www.ebi.ac.uk/steinbeck-srv/git/cdk. This is cdk master plus some
patches. Since JCP is no longer integrated to cdk
JChemPaint *is* integrated with the CDK... I guess what is meant here,
is that the JChemPaint 3 applet the EBI team worked on has some
patches to make things work?
The CDK-JChemPaint examples I have in my blog use the other branch,
which contains the JChemPaint renderer and controller code that does
integrate with CDK 1.3.4.
Well, rendering does work as per your examples, but I didn't succeed at
launching JChemPaintPanel using cdk-jchempaint-8 and cdk-1.3.4 due to
compile errors.
Egon Willighagen
2010-04-10 08:15:57 UTC
Permalink
Hi Nina,
Post by Nina Jeliazkova
Well, rendering does work as per your examples, but I didn't succeed at
launching JChemPaintPanel  using cdk-jchempaint-8 and cdk-1.3.4 due to
compile errors.
Yes, the JChemPaint applet in incompatible with CDK-JChemPaint code base.
Nina Jeliazkova
2010-04-10 08:42:41 UTC
Permalink
Hi Egon,
Post by Stefan Kuhn
Hi Nina,
Post by Nina Jeliazkova
Well, rendering does work as per your examples, but I didn't succeed at
launching JChemPaintPanel using cdk-jchempaint-8 and cdk-1.3.4 due to
compile errors.
Yes, the JChemPaint applet in incompatible with CDK-JChemPaint code base.
Egon Willighagen
2010-04-10 10:13:34 UTC
Permalink
Can you tell what's the best starting point to learn about CDK git
infrastructure - I am afraid I've been ignoring it so far - as well as where
would be the recommended place to commit ambit smarts parser code?
There is no documentation so far... but any git tutorial on the web
will basically do...

Start with:

git clone git://github.com/egonw/cdk.git

Making patches is then as with any git repository. Look for 'git add'
to 'stage' changes for a commit, 'git commit' to make the actual
commit and give it a commit message, and 'git format-patch' to
serialize the patch into a ASCII file, which others can then easily
apply with 'git am'... looks for tutorials on the web for the
details...

Advice: if you start making patches, do this in a local branch, so
that your copy of 'master' keeps to be the same as 'upstream', being
the main repository. Make a new branch with:

git checkout -b 1-myNewBranchWhereIFixThis master

creating the new branch named 1-myNewBranchWhereIFixThis, branched
from 'master'.

The "1-" is a local convention I got hinted at on the web, and allows
me to see easily the historic order of patches, by increasing that
number by one with each new branch.

Which is one of the two main repositories... the other one hosted at
SourceForge, but since Rajarshi pushed only to this GitHub repository
and I sync the SF one manually later, the above one is best.

Egon
--
Post-doc @ Uppsala University
Proteochemometrics / Bioclipse Group of Prof. Jarl Wikberg
Homepage: http://egonw.github.com/
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers
Stefan Kuhn
2010-04-12 08:40:03 UTC
Permalink
Post by Stefan Kuhn
Hi Nina,
Post by Nina Jeliazkova
Well, rendering does work as per your examples, but I didn't succeed at
launching JChemPaintPanel  using cdk-jchempaint-8 and cdk-1.3.4 due to
compile errors.
Yes, the JChemPaint applet in incompatible with CDK-JChemPaint code base.
Actually, it's the other way round...
If you say "using cdk-jchempaint-8 and cdk-1.3.4" it sounds like you do not
use the JChemPaint application and applet (=JCP) code. I cannot comment on
CDK-JChemPaint since I have no idea what it is for and about and can't say
how to compile it. I can only repeat what I have already said here and which
stays true: JCP uses CDK master + potentially some pending patches (these are
in the ebi git repository) + the JCP code from svn. This is explained here:
http://sourceforge.net/apps/mediawiki/cdk/index.php?title=Checking_out_JCP.
Nothing else is needed for JCP, and also CDK-JChemPaint has no relationship
to JCP.
Stefan
--
Stefan Kuhn B. Sc. M. A.
Software Engineer in the Chemoinformatics and Metabolism Team
European Bioinformatics Institute (EBI)
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD UK
Phone +44 1223 49 2657
Fax +44 (0)1223 494 468
Nina Jeliazkova
2010-04-12 09:05:34 UTC
Permalink
Hi Stefan,
Post by Stefan Kuhn
Post by Stefan Kuhn
Hi Nina,
Post by Nina Jeliazkova
Well, rendering does work as per your examples, but I didn't succeed at
launching JChemPaintPanel using cdk-jchempaint-8 and cdk-1.3.4 due to
compile errors.
Yes, the JChemPaint applet in incompatible with CDK-JChemPaint code base.
Actually, it's the other way round...
What matters these are mutually incompatible ;)
Post by Stefan Kuhn
If you say "using cdk-jchempaint-8 and cdk-1.3.4" it sounds like you do not
use the JChemPaint application and applet (=JCP) code. I cannot comment on
CDK-JChemPaint since I have no idea what it is for and about and can't say
how to compile it.
OK, that was the point - I was not sure what to use and found out a
workable combination by trials and errors, starting with Egon's examples
with cdk-jchempaint-8.
Post by Stefan Kuhn
I can only repeat what I have already said here and which
stays true: JCP uses CDK master + potentially some pending patches (these are
http://sourceforge.net/apps/mediawiki/cdk/index.php?title=Checking_out_JCP.
Nothing else is needed for JCP, and also CDK-JChemPaint has no relationship
to JCP.
Ideally, one would like to download a jar (jars) and don't care which
source repository they have been compiled from. Hoping to get familiar
with git soon and have something to propose in this direction.

Best regards,
Nina
Post by Stefan Kuhn
Stefan
Loading...