Hi Juan,
You have to translate it into javascript wrappers which is not as hard as it sounds. And the process is the same for anybody who wants to call Java from Servoy.
1. You see the import statements at the top of the java example - those give you the java package names.
You must use these package names when you reference a class from the library, i.e.
- Code: Select all
import org.opencv.core.Point
2. Whenever a java class is referenced you will use the fully qualified class name, including Packages.<package-name>.<class-name>, i.e.
- Code: Select all
Point
becomes
- Code: Select all
Packages.org.opencv.core.Point
3. Java requires that variables are declared with the class/type, i.e.
- Code: Select all
String foo = "bar"
becomes
- Code: Select all
var foo = "bar"
For example from your library:
- Code: Select all
Point pt = new Point();
pt.x = 10;
pt.y = 8;
becomes:
- Code: Select all
var pt = new Packages.org.opencv.core.Point();
pt.x = 10;
pt.y = 8;
hope this helps.
Best,
Sean