Interacting with the controls of a JavaFX application from a foreign language (Prolog) by means of JNI

大憨熊 提交于 2019-12-24 00:33:56

问题


I would like to interact (as transparently as possible from the Java point of view) with the controls of a JavaFX application from an application in a foreign language (Prolog). Java and Prolog are connected by means of JNI and I have already resolved the JNI interaction issues.

My question is:

What is the best way to instrument an arbitrary JavaFX application so I could inject code somewhere to invoke a routine in Prolog immediately after the primary Stage has been instantiated ? (so Prolog will be able to refer to the nodes in the Scene Graph of the Stage).

I think Scenic View does something similar using agents to instrument a bit an arbitrary JavaFX application that does not have any code related to Scenic View.

In my problem, the objective is that the JavaFX interface could be created without JNI related code and having only presentation logic. The code starting the Prolog program with JNI should be somehow injected after the interface is ready. So the idea is to use Java only for the interface of my program and the core logic of my application is implemented in Prolog.

来源:https://stackoverflow.com/questions/15799940/interacting-with-the-controls-of-a-javafx-application-from-a-foreign-language-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!