JChemPaint / jchempaint

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

Switch to using SWT instead of Swing #190

Closed Krzmbrzl closed 6 years ago

Krzmbrzl commented 6 years ago

As far as I can see, the application's UI is written in Swing (+ some AWT). Personally I just don't like the look of these (it always looks as if the UI was developed 10 years ago). I'd like to see the whole application making use of the SWT library which can create (in my opinion) up-to-date UIs.

As I do know that this would require quite a big rewrite I'd like to mention this right away: I'm not really expecting you to do it. I'd be willing to take over the work as my alternative would be to write a new program altogether which seems like a waste of time and resources given that JCP already exists. However before I start rewriting the code I'd like to get some feedback from your side on the following things:

The overall goal I am seeing here would be to have a separate branch that uses the SWT library for the UI stuff but shares all functional libraries. That way users could choose the UI they'd like to work with without having to worry about missing or broken functionality.

I know that this is not really an issue or anything but it seemed like the best place to propose the whole thing. I hope you are not taking my suggesting as a criticism of the work you have done right here but rather as an appreciation and willingness to further improve it.

johnmay commented 6 years ago

The problem with the AI looking bad isn't Swing, this is Swing (I wrote it) skinned to look native on OS X: image

Saying that, I don't like Swing but also don't like SWT. For the most part I consider this project dead, still used in places, but no one has time to maintain it and Java UI's really are quite unfavourable, particular in the browser. I would vote for rewrite as there are many bloated and overly complicated parts. I've been thinking about starting a new FOSS editor but it would be JS front end (with a Java server back-end), JSME/Ketcher are good starting points but they miss some key usability features from ChemDraw/MarvinSketch.

Does this program mainly use the CDK for all underlying operations (e.g. is JCP mainly a graphical frontend for the functions provided by the CDK)?

Yes an no, for example, compare how the diagrams look in JCP to a recent version of CDK: http://simolecule.com/cdkdepict/depict.html. Historically JCP duplicated some parts from CDK and was non-trivial to re-integrate.

Why did you have an interest in doing this?

Krzmbrzl commented 6 years ago

Why did you have an interest in doing this?

Well that's quite simple: I need a molecular editor every now and then so I was looking around on the options I have. As I am running Linux on my computer ChemDraw is not an option and I don't really like web applications (though I didn't even know that there are some for this purpose). I stumbled across xDrawChem and tried it out. However it didn't quite do it the way I'd like so I started playing arounf with the source code. But since the source code is a mess I continued my search and came across CDK and finally JCP. So as said earlier: The two options I was left with was either writing a new program altogether or trying on improving JCP.

I would vote for rewrite as there are many bloated and overly complicated parts. I've been thinking about starting a new FOSS editor but it would be JS front end (with a Java server back-end)

From that I am assuming that you wouldn't suggest using the current JCP backend-code as the foundation of a new editor? If you were starting a new project it would be possible to design it in a way that the backend is clearly separated from the frontend (which afaik would be necessary anyway if you want to use a server backend). And from there one could still go ahead and write a "normal" application from it. I think I'd be willing to help with the development of such a new editor (not with the JS part though as I haven't touched it yet).

johnmay commented 6 years ago

Have you tried MarvinSketch? https://chemaxon.com/products/marvin

Krzmbrzl commented 6 years ago

No I haven't. Although it seems pretty good I'd prefer an OpenSource editor that I can access without any registration and that I can change as I wish...

johnmay commented 6 years ago

http://sketchel.sourceforge.net/

Krzmbrzl commented 6 years ago

Also not bad. However it is incapable of creating reaction schemes.

Thank you for your recommendations. For the time being I might actually give MarvinSketch a closer look. In the end I think I'm going fior an OpenSource version and as I am quite picky I'll probably go ahead and start my own one (as you stated that you consider JCP dead and in need of a rewrite).

Closing this issue