A short youtube video shows the usage of the 3d mouse with a JavaFX application Lego Demo.
- Java 8 JDK (But code can be easily changed to an earlier version)
- Eclipse (As development environment)
- XCode (For the C/C++ tools on a MAC)
Installing and Building
Clone the repository with:
git clone https://github.com/hjbflyer/3DConnexionAPI 3DConnexionAPI cd 3DConnexionAPI/jni make
Building the dynamic library libConnexionAPI and the jar can be done either from command line or from Eclipse. To build from command line and run a small demo, open a terminal.
Start Eclipse and make "3DConnexionAPI" your working directory. Next open the workbench. Create a new Java project with the name "de.hjbflyer.connexion3dapi" and click "Next" and "Finish".
You will see a problems dialog. This is because of the checkstyle configuration is not yet configured. To solve this, open Eclipse->Preferences...->Checkstyle". Add a new "Project Relative Configuration" with name "hjbflyer style" and browse to hjbflyerstyle51.xml in the config sub-directory. Click "Protect Checkstyle Configuration file" and then "OK". Make the new style the default style. Rebuild the project. There should be no errors and no warnings.
In the same config directory is a file called "javafx.target". Open this file within Eclipse and click "Set as Target Platform". Computing the target platform takes a while.
Next select the "Properties" from the project context menu. Navigate to "Java Build Path->Libraries". Unfold the JRE System Library and select the "Native library location" for editing. Select the jni sub-directory in work workspace. Now you can run the demo from Eclipse.
Runnning the Demo
Building the dynamic library libConnexionAPI and the jar can be done either from command line or from Eclipse. To run a small demo, open a terminal.
java -jar ConnexioAPI.jar
We need the Connexion header files. So the driver has to be installed. On a MAC it is located in /Library/Frameworks/3DConnexionClient.framework. To help the compiler finding the header files, we have created a symbolic link.
The makefile uses an environment variable JAVA_HOME to find the JNI header files. This include path has to be set in Eclipse to build in Eclipse.
The header file de_hjbflyer_connexion3dapi_ConnexionApi.h is automatically generated by running
To generate the JavaDoc
The initial version of this project does support OS X only. To build for other operating systems, the makefile has to be adapted.
To use the API you have to include the dynamic library libConnexionAPI.dylib in your library load path. The plugin version has the library in its bundle included.
Eclipse Public License http://www.eclipse.org/legal/epl-v10.html