开发者

C++ and Java GUI linkage through SWIG

开发者 https://www.devze.com 2023-03-27 12:48 出处:网络
I am trying to include a computational chemistry/physics visualizer known as Avogadro (1) inside of my jTabbedPane project. I used QT Jambi (1) to create a JUI (Java GUI) out of Avogadro\'s UI in Ecli

I am trying to include a computational chemistry/physics visualizer known as Avogadro (1) inside of my jTabbedPane project. I used QT Jambi (1) to create a JUI (Java GUI) out of Avogadro's UI in Eclipse. I was successful in that attempt, but the GUI was (obviously functionless) upon running.

In short, the complication here is me trying to access the C++ libraries of a massive project that only has the ability to compile with CMake (Importing into Eclipse was not successful). To make it a bit worse, all I believe I need to interface with is a .cpp file that regulates the GUI an开发者_运维技巧d links it to the rest of the project, thus providing functionality. I plan to use SWIG to interface with the functions in the aforementioned cpp file and I plan for the interface to work with the C++ library to add functionality to the Java GUI.

Any thoughts on how I could do this? Do I need to SWIG the entire project?


It looks like Avogadro is open source. Therefore, you can download the source code and SWIG the entire project. This will give you the same classes in Java as you would have in C++.

If you only want a subset of Avogadro's functionality, I would suggest creating a simple bridge class in C++. This bridge class, with possibly other helper classes, could then be SWIGed. Your Java would now use the bridge class to execute the Avogadro library.

0

精彩评论

暂无评论...
验证码 换一张
取 消