From: Stefan K. <ste...@eb...> - 2010-01-21 17:47:12
|
For me, that sounds like you have IRingSet twice in your classpath. What also fits into the picture is that the sortAtomContainers method is a recent addition, if I remember correctly. Please check your classpath for double cdk jars. Stefan On Thursday 21 January 2010 17:43:00 Andreas Truszkowski wrote: > Hallo Stefan, > > > Hi Andreas, > > sorry for confusion, I should have realized this earlier. For reactions > > please use trunk aka development branch, i. e. th 3.1.x releases. I > > attach a jchempaint-3.1.1.jar, which is from current trunk. For me, this > > works with your code. > > The trunk right now has failing tests. I will either fix these are do a > > release from trunk, it's development anyway. > > Stefan > > Ok, attachment to large. I put the file at > > http://www.ebi.ac.uk/steinbeck-srv/jchempaint-3.1.1.jar > > In a test application it works for me too (also 3.0.1). But if I use it > in my application it makes no difference if I try to render a molecule > or a reaction even if I use 3.1.1. > And the application has no special or curious setup. (All CDK depending > methods still work). > > Andreas > > Stefan Kuhn schrieb: > > Hi Andreas, > > sorry for confusion, I should have realized this earlier. For reactions > > please use trunk aka development branch, i. e. th 3.1.x releases. I > > attach a jchempaint-3.1.1.jar, which is from current trunk. For me, this > > works with your code. > > The trunk right now has failing tests. I will either fix these are do a > > release from trunk, it's development anyway. > > Stefan > > Ok, attachment to large. I put the file at > > http://www.ebi.ac.uk/steinbeck-srv/jchempaint-3.1.1.jar > > > > On Thursday 21 January 2010 09:10:59 Stefan Kuhn wrote: > >> Thanks for trying, I will investigate that. > >> Stefan > >> > >> On Wednesday 20 January 2010 18:07:03 Andreas Truszkowski wrote: > >>> Hello Stefan, > >>> > >>>> Hm, that should work, but it is not really intended for library > >>>> integration. Can give the jars in jchempaint-lib-3.0.1.zip (also from > >>>> the sf download) a try, if they work with your code (or your code > >>>> works with them). If the error is still there, I will look at it. > >>>> Stefan > >>> > >>> I have tried to reference all libraries and only the jchempaint.jar > >>> from the jchempaint-lib-3.0.1.zip to my project. > >>> But the result was in every case the same. Everytime the exception was > >>> thrown. > >>> > >>> Andreas > >>> > >>> Stefan Kuhn schrieb: > >>>> Hm, that should work, but it is not really intended for library > >>>> integration. Can give the jars in jchempaint-lib-3.0.1.zip (also from > >>>> the sf download) a try, if they work with your code (or your code > >>>> works with them). If the error is still there, I will look at it. > >>>> Stefan > >>>> > >>>> On Wednesday 20 January 2010 12:46:57 Andreas Truszkowski wrote: > >>>>> Hello Stefan, > >>>>> > >>>>> I only reference the jchempaint-3.0.1.jar downloaded from > >>>>> http://sourceforge.net/projects/cdk/files/. > >>>>> > >>>>> Andreas > >>>>> > >>>>> Stefan Kuhn schrieb: > >>>>>> For me, this sounds a bit like your jcp and cdk libraries don't fit. > >>>>>> Which libraries are you using, respectivly where did you get them > >>>>>> from? Stefan > >>>>>> > >>>>>> On Wednesday 20 January 2010 11:12:07 Andreas Truszkowski wrote: > >>>>>>> *Hello together,* > >>>>>>> > >>>>>>> *if I try to render a reaction with the following code:* > >>>>>>> > >>>>>>> BufferedImage reactionImage; > >>>>>>> // Create the image > >>>>>>> GraphicsConfiguration gc = > >>>>>>> GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenD > >>>>>>>e vi ce () .getDefaultConfiguration(); > >>>>>>> reactionImage = gc.createCompatibleImage(this.getWidth(), > >>>>>>> this.getHeight()); > >>>>>>> Rectangle drawArea = new Rectangle(this.getWidth(), > >>>>>>> this.getHeight()); > >>>>>>> // generators make the image elements > >>>>>>> List<IGenerator> generators = new ArrayList<IGenerator>(); > >>>>>>> generators.add(new BasicBondGenerator()); > >>>>>>> generators.add(new BasicAtomGenerator()); > >>>>>>> > >>>>>>> List<IReactionGenerator> reactiongenerators = new > >>>>>>> ArrayList<IReactionGenerator>(); > >>>>>>> // generate the bounds first, so that they are to the back > >>>>>>> reactiongenerators.add(new ReactionArrowGenerator()); > >>>>>>> reactiongenerators.add(new ReactionPlusGenerator()); > >>>>>>> > >>>>>>> // Init renderer > >>>>>>> Renderer renderer = new Renderer(generators, > >>>>>>> reactiongenerators, new AWTFontManager(), null); > >>>>>>> > >>>>>>> Graphics2D g2 = (Graphics2D) reactionImage.getGraphics(); > >>>>>>> g2.setColor(renderer.getRenderer2DModel().getBackColor()); > >>>>>>> g2.fillRect(0, 0, this.getWidth(), this.getHeight()); > >>>>>>> > >>>>>>> // paint the reaction > >>>>>>> renderer.paintReaction(reaction, new AWTDrawVisitor(g2), > >>>>>>> drawArea, false); > >>>>>>> * > >>>>>>> the following exception will be thrown:* > >>>>>>> > >>>>>>> Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: > >>>>>>> org.openscience.cdk.interfaces.IRingSet.sortAtomContainers(Ljava/ut > >>>>>>>i l/ Co mpa rator;)V at > >>>>>>> org.openscience.jchempaint.renderer.generators.BasicBondGenerator.g > >>>>>>>e ne ra te( BasicBondGenerator.java:146) at > >>>>>>> org.openscience.jchempaint.renderer.Renderer.generateDiagram(Render > >>>>>>>e r. ja va: 956) at > >>>>>>> org.openscience.jchempaint.renderer.Renderer.generateDiagram(Render > >>>>>>>e r. ja va: 945) at > >>>>>>> org.openscience.jchempaint.renderer.Renderer.paintReaction(Renderer > >>>>>>>. ja va > >>>>>>> > >>>>>>> :49 5) at > >>>>>>> > >>>>>>> CDKEnumeratorGUI.DrawReactionView.paintComponent(DrawReactionView.j > >>>>>>>a va > >>>>>>> > >>>>>>> :1 21) at javax.swing.JComponent.paint(JComponent.java:1029) > >>>>>>> > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1038) > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1038) > >>>>>>> at javax.swing.JLayeredPane.paint(JLayeredPane.java:567) > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1038) > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1038) > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1038) > >>>>>>> at javax.swing.JLayeredPane.paint(JLayeredPane.java:567) > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1038) > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1038) > >>>>>>> at javax.swing.JLayeredPane.paint(JLayeredPane.java:567) > >>>>>>> at javax.swing.JComponent.paintChildren(JComponent.java:862) > >>>>>>> at > >>>>>>> javax.swing.JComponent.paintToOffscreen(JComponent.java:5131) at > >>>>>>> javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Repaint > >>>>>>>M an ag er. java:1479) at > >>>>>>> javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1 > >>>>>>>4 10 ) at javax.swing.RepaintManager.paint(RepaintManager.java:1224) > >>>>>>> at javax.swing.JComponent.paint(JComponent.java:1015) > >>>>>>> at > >>>>>>> java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:2 > >>>>>>>1 ) at > >>>>>>> sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.jav > >>>>>>>a > >>>>>>> > >>>>>>> :6 0) at > >>>>>>> > >>>>>>> sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java: > >>>>>>>9 7) at java.awt.Container.paint(Container.java:1780) > >>>>>>> at java.awt.Window.paint(Window.java:3375) > >>>>>>> at > >>>>>>> javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:79 > >>>>>>>6 ) at > >>>>>>> javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:71 > >>>>>>>3 ) at > >>>>>>> javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java > >>>>>>>: 69 3) at > >>>>>>> javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Syst > >>>>>>>e mE ve ntQ ueueUtilities.java:125) at > >>>>>>> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) > >>>>>>> at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) > >>>>>>> at > >>>>>>> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchTh > >>>>>>>r ea d. jav a:269) at > >>>>>>> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThrea > >>>>>>>d .j av a:1 84) at > >>>>>>> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchTh > >>>>>>>r ea d. jav a:174) at > >>>>>>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:16 > >>>>>>>9 ) at > >>>>>>> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:16 > >>>>>>>1 ) at > >>>>>>> java.awt.EventDispatchThread.run(EventDispatchThread.java:122) > >>>>>>> > >>>>>>> *What is wrong with my code? > >>>>>>> Thanking you in anticipation. > >>>>>>> > >>>>>>> Regards > >>>>>>> Andreas > >>>>>>> * > >>>>> > >>>>> --------------------------------------------------------------------- > >>>>>- -- --- --- Throughout its 18-year history, RSA Conference > >>>>> consistently attracts the world's best and brightest in the field, > >>>>> creating opportunities for Conference attendees to learn about > >>>>> information security's most important issues through interactions > >>>>> with peers, luminaries and emerging and established companies. > >>>>> http://p.sf.net/sfu/rsaconf-dev2dev > >>>>> _______________________________________________ > >>>>> Cdk-jchempaint mailing list > >>>>> Cdk...@li... > >>>>> https://lists.sourceforge.net/lists/listinfo/cdk-jchempaint > >>> > >>> ----------------------------------------------------------------------- > >>>-- -- --- Throughout its 18-year history, RSA Conference consistently > >>> attracts the world's best and brightest in the field, creating > >>> opportunities for Conference attendees to learn about information > >>> security's most important issues through interactions with peers, > >>> luminaries and emerging and established companies. > >>> http://p.sf.net/sfu/rsaconf-dev2dev > >>> _______________________________________________ > >>> Cdk-jchempaint mailing list > >>> Cdk...@li... > >>> https://lists.sourceforge.net/lists/listinfo/cdk-jchempaint > > --------------------------------------------------------------------------- >--- Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for > Conference attendees to learn about information security's most important > issues through interactions with peers, luminaries and emerging and > established companies. http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Cdk-jchempaint mailing list > Cdk...@li... > https://lists.sourceforge.net/lists/listinfo/cdk-jchempaint -- 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 |