JChemPaint / jchempaint

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

Compilation fails with CDK 1.5.12 #185

Closed vedina closed 8 years ago

vedina commented 8 years ago

I've tried to change the dependency to CDK 1.5.12 and compilation fails with

The method placeFusedRing(IRing, IAtomContainer, Vector2d, double)
 in the type RingPlacer is not applicable for the arguments (IRing, IAtomContainer, Point2d, Vector2d, double)  
ControllerHub.java  /jchempaint-core/src/main/java/org/openscience/jchempaint/controller    line 1668   

The method is invoked when trying to place.

at org.openscience.jchempaint.controller.ControllerHub.addPhenyl(ControllerHub.java:1800)
    at org.openscience.jchempaint.controller.AddRingModule.addRingToBond(AddRingModule.java:82)
    at org.openscience.jchempaint.controller.AddRingModule.mouseMove(AddRingModule.java:201)
    at org.openscience.jchempaint.controller.ControllerHub.mouseMove(ControllerHub.java:375)
    at org.openscience.jchempaint.controller.SwingMouseEventRelay.mouseMoved(SwingMouseEventRelay.java:56)
    at java.awt.Component.processMouseMotionEvent(Component.java:6561)
    at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3339)

There is probably an easy fix, any hints appreciated !

The reason to upgrade the dependency is Toxtree is currently compiled with CDK 1.5.12 and JChemPaint 3.4-SNAPSHOT. Unfortunately, JCP is not functional with CDK 1.5.12 dependency, almost any structure editing fails.

vedina commented 8 years ago

The easy fix by commenting out sharedAtomsCenter doesn't work entirely

    IRing newRing = createAttachRing(sharedAtoms, 6, "C", phantom);
        ringPlacer.placeFusedRing(newRing, sharedAtoms, 
                //sharedAtomsCenter,
                ringCenterVector, bondLength);

there is still a repeating error , and structure editing fails

Visitor method for org.openscience.cdk.renderer.elements.MarkedElement is not implemented
johnmay commented 8 years ago

Hi Nina, these should be easier to resolve and will look into it.

vedina commented 8 years ago

Thanks a lot, John!

johnmay commented 8 years ago

Patched, dev is not at 1.1.13-SNAPSHOT but will also work with 1.1.12. I did have intentions to get it somewhat decent shape, there's ALOT of ui glitches particularly on mac to do with zoom for example (curious if you see this also).

Might try and get it working better this weekend but overall not too motivated as it's Swing. Might be better to start a fresh with JavaFX>

vedina commented 8 years ago

Confirmed it's working with 1.5.12, thanks

johnmay commented 8 years ago

Ah I had 'fit to screen' enabled which is why i saw the odd zoom behaviour.