JChemPaint / jchempaint

Chemical 2D structure editor application/applet based on the Chemistry Development Kit
http://jchempaint.github.com
110 stars 34 forks source link

update to CDK 2.2 #191

Open egonw opened 4 years ago

egonw commented 4 years ago

Just replacing the dependency causes several regressions.

johnmay commented 4 years ago

What are they...? We should be API stable, in the past though there was issues with classes duplicated across JChemPaint and CDK.

araskind commented 4 years ago

I would like to use JChemPaint as a part of a larger application and at the moment I have to keep CDK version at 2.0 since both 2.2 and 2,3 lead to the following exception when I am trying to make any modifications to the current molecule (I think it pops out often even when I just mouse-over the screen). This specific case is when I've added a single bond to the canvas and then tried to delete it. I am not giving the full text of the exception since all the rest seems to be just Swing stuff not related to the cause of the problem. I will greatly appreciate if you could fix this problem.

Exception in thread "AWT-EventQueue-0" org.openscience.cdk.exception.NoSuchAtomException: Atom is not a member of this AtomContainer at org.openscience.cdk.AtomContainer2.getAtomRef(AtomContainer2.java:182) at org.openscience.cdk.AtomContainer2.newBondRef(AtomContainer2.java:217) at org.openscience.cdk.AtomContainer2.addBond(AtomContainer2.java:924) at org.openscience.cdk.renderer.selection.AbstractSelection.addToAtomContainer(AbstractSelection.java:90) at org.openscience.jchempaint.renderer.selection.SingleSelection.getConnectedAtomContainer(SingleSelection.java:54) at org.openscience.jchempaint.controller.ControllerModuleAdapter.getSelectedAtomContainer(ControllerModuleAdapter.java:189) at org.openscience.jchempaint.controller.RemoveModule.mouseClickedDown(RemoveModule.java:53) at org.openscience.jchempaint.controller.ControllerModuleAdapter.mouseClickedDown(ControllerModuleAdapter.java:77) at org.openscience.jchempaint.controller.ControllerHub.mouseClickedDown(ControllerHub.java:281) at org.openscience.jchempaint.controller.SwingMouseEventRelay.mousePressed(SwingMouseEventRelay.java:95) at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6633)...

egonw commented 4 years ago

I need to continue looking into this too. A partner in the NanoSolveIT project needs an update of JChemPaint to 2.3 too.

johnmay commented 4 years ago

See Gotha's https://github.com/cdk/cdk/wiki/AtomContainer2. Quick fix should be -DCdkUseLegacyAtomContainer=false

johnmay commented 4 years ago

Sorry other way... -DCdkUseLegacyAtomContainer=true

johnmay commented 4 years ago

Yep, java -DCdkUseLegacyAtomContainer=true -jar app-jar/target/JChemPaint.jar stops the exception as expected but there still a lot of other things that are broken in general to the point it's unusable.