Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal for asynchronous compatability with SwingJS #86

Open
BobHanson opened this issue Feb 2, 2023 · 3 comments
Open

proposal for asynchronous compatability with SwingJS #86

BobHanson opened this issue Feb 2, 2023 · 3 comments

Comments

@BobHanson
Copy link

I'll be adapting OpenChemLib for JavaScript/SwingJS. It's all working there, as discussed in issue #83, with the exception of modal dialogs. I have those working as well, but it requires some additional classes and adjustments -- specifically:

  1. exposing the mDialog field of CustomAtomDialogBuilder (and perhaps other related dialogs),
  2. allowing for the chaining of event handlers, and
  3. addition of an GenericEditorArea.showCustomAtomDialog extension with optional OK and Cancel java.lang.Runnable parameters

In addition, at least for now (maybe address this when I have a bit more time), I'm bypassing the Glyph font business. Honestly, I can't see any difference there on my machine when I replace that with standard fonts. Is there some particular reason to use the Glyph fonts?

This seems to be all I need.

I'm thinking I will fork the repo anyway, so that I can have a "OCL-SwingJS" branded repo, but I was wondering if you want to provide me a branch in addition to that so that you can see exactly what is involved.

Let me know what you think best. I will start on the fork right now; hope to have this all done tomorrow.

OCL has been a great contribution to JME-SwingJS (and, consequently, Jmol-SwingJS). Just lovely. You can thank Bruno Bienfeit for introducing me to OCL.

BTW - I realize that SwingJS is not for everyone, but it is certainly proving to be up to everything I throw at it in Java 8 and some in Java 11+ (but the coverage there is very minimal, just on demand). Probably about 30-40% the speed of Java. Plenty of speed for everything I have needed on web pages. Decently small footprint and transfer size. (JME with OCL is 750K transferred by gzip -- maybe a second or two of startup.) Relatively full files system and Swing capabilities; asynchronous, even with modal dialogs.

As we are seeing with OpenChemLib, the "adjustment" to JavaScript doesn't impact the Java at all -- or actually, in many cases, the bit of asynchronous business actually makes the Java much more transparent. (See, for example, OpenSource Physics, Falstad physics applets, OSP, and Tracker. In that project, the process of adapting to JavaScript made the Java hugely more efficient as well and took literally seconds off the Java start-up loading by the time we were done with it all.)

And it is so delightful to simultaneously test in both Java and JavaScript on the fly. So fun!

Bob

@BobHanson
Copy link
Author

If you are interested, the fork is at BobHanson/OCL-SwingJS. It was about a day's work. Not by any means well tested. But the basics are there.

@BobHanson BobHanson reopened this Feb 3, 2023
@BobHanson
Copy link
Author

(See the closed issues for commentary

@BobHanson
Copy link
Author

Final development note on this is at BobHanson#12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant